mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-05 00:02:28 -08:00
Add getParent to TransformNode and add StdBVHFileStream
This commit is contained in:
4 files changed
+130
-7
No files matched your search
@@ -16,20 +16,32 @@ public class TransformNodeWrapper {
|
||||
public final Transform localTransform;
|
||||
public final Transform worldTransform;
|
||||
|
||||
public final boolean flippedOffset;
|
||||
|
||||
protected TransformNodeWrapper parent;
|
||||
public final List<TransformNodeWrapper> children = new FastList<>();
|
||||
|
||||
public TransformNodeWrapper(String name, TransformNode nodeToWrap) {
|
||||
public TransformNodeWrapper(TransformNode nodeToWrap, String name, boolean flippedOffset) {
|
||||
this.wrappedNode = nodeToWrap;
|
||||
|
||||
this.name = name;
|
||||
|
||||
this.localTransform = nodeToWrap.localTransform;
|
||||
this.worldTransform = nodeToWrap.worldTransform;
|
||||
|
||||
this.flippedOffset = flippedOffset;
|
||||
}
|
||||
|
||||
public TransformNodeWrapper(TransformNode nodeToWrap, String name) {
|
||||
this(nodeToWrap, name, false);
|
||||
}
|
||||
|
||||
public TransformNodeWrapper(TransformNode nodeToWrap, boolean flippedOffset) {
|
||||
this(nodeToWrap, nodeToWrap.getName(), flippedOffset);
|
||||
}
|
||||
|
||||
public TransformNodeWrapper(TransformNode nodeToWrap) {
|
||||
this(nodeToWrap.getName(), nodeToWrap);
|
||||
this(nodeToWrap, nodeToWrap.getName());
|
||||
}
|
||||
|
||||
public boolean hasLocalRotation () {
|
||||
@@ -37,10 +49,18 @@ public class TransformNodeWrapper {
|
||||
}
|
||||
|
||||
public void attachChild(TransformNodeWrapper node) {
|
||||
if (node.parent != null) {
|
||||
throw new IllegalArgumentException("The child node must not already have a parent");
|
||||
}
|
||||
|
||||
this.children.add(node);
|
||||
node.parent = this;
|
||||
}
|
||||
|
||||
public TransformNodeWrapper getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user