Wrap TransformNodes for different PoseStream hierarchy requirements

This commit is contained in:
ButterscotchVanilla committed 2021-12-01 20:17:35 -05:00
1 parent 57d009df5c
commit 76ab69e44e
2 files changed
+93 -12

No files matched your search

@@ -0,0 +1,47 @@
package dev.slimevr.posestreamer;
import java.util.List;
import com.jme3.math.Transform;
import io.eiren.util.collections.FastList;
import io.eiren.vr.processor.TransformNode;
public class TransformNodeWrapper {
public final TransformNode wrappedNode;
protected String name;
public final Transform localTransform;
public final Transform worldTransform;
protected TransformNodeWrapper parent;
public final List<TransformNodeWrapper> children = new FastList<>();
public TransformNodeWrapper(String name, TransformNode nodeToWrap) {
this.wrappedNode = nodeToWrap;
this.name = name;
this.localTransform = nodeToWrap.localTransform;
this.worldTransform = nodeToWrap.worldTransform;
}
public TransformNodeWrapper(TransformNode nodeToWrap) {
this(nodeToWrap.getName(), nodeToWrap);
}
public boolean hasLocalRotation () {
return wrappedNode.localRotation;
}
public void attachChild(TransformNodeWrapper node) {
this.children.add(node);
node.parent = this;
}
public String getName() {
return name;
}
}