Fix skeleton nodes rotation being affected by parent nodes rotation

This commit is contained in:
Eiren Rain
2021-01-14 03:29:54 +03:00
parent 9db609305d
commit edd3dbd123
2 changed files with 6 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ public class TransformNode {
public final Transform localTransform = new Transform();
public final Transform worldTransform = new Transform();
public final List<TransformNode> children = new FastList<>();
public boolean localRotation = false;
private TransformNode parent;
public void attachChild(TransformNode node) {
@@ -29,7 +30,10 @@ public class TransformNode {
worldTransform.set(localTransform);
} else {
worldTransform.set(localTransform);
worldTransform.combineWithParent(parent.worldTransform);
if(localRotation)
worldTransform.combineWithParent(parent.worldTransform);
else
worldTransform.combineWithParentGlobalRotation(localTransform);
}
}
}

View File

@@ -137,7 +137,7 @@ public class TrackersUDPServer extends Thread {
sensor = trackersMap.get(addr);
}
if(sensor == null) {
IMUTracker imu = new IMUTracker("udp://" + handshakePacket.getAddress().toString(), this);
IMUTracker imu = new IMUTracker("udp:/" + handshakePacket.getAddress().toString(), this);
trackersConsumer.accept(imu);
sensor = new TrackerConnection(imu, addr);
int i = 0;