mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-21 01:21:25 -08:00
Add closeOutput for specific stream
This commit is contained in:
2 files changed
+10
-4
No files matched your search
@@ -156,14 +156,14 @@ public class BVHFileStream extends PoseDataStream {
|
||||
}
|
||||
|
||||
private void writeNodeHierarchyRotation(TransformNodeWrapper node, Quaternion inverseRootRot) throws IOException {
|
||||
rotBuf = node.localTransform.getRotation(rotBuf);
|
||||
rotBuf = node.worldTransform.getRotation(rotBuf);
|
||||
|
||||
// Adjust to local rotation
|
||||
if (inverseRootRot != null) {
|
||||
rotBuf = node.calculateLocalRotationInverse(inverseRootRot, rotBuf);
|
||||
}
|
||||
|
||||
// Yaw, roll, pitch
|
||||
// Yaw (Z), roll (X), pitch (Y)
|
||||
angleBuf = rotBuf.toAngles(angleBuf);
|
||||
// Output in order of Z, X, Y
|
||||
writer.write(Float.toString(angleBuf[2] * FastMath.RAD_TO_DEG) + " " + Float.toString(angleBuf[0] * FastMath.RAD_TO_DEG) + " " + Float.toString(-angleBuf[1] * FastMath.RAD_TO_DEG));
|
||||
|
||||
@@ -102,9 +102,15 @@ public class PoseStreamer {
|
||||
PoseDataStream poseFileStream = this.poseFileStream;
|
||||
|
||||
if (poseFileStream != null) {
|
||||
poseFileStream.writeFooter(skeleton);
|
||||
poseFileStream.close();
|
||||
closeOutput(poseFileStream);
|
||||
this.poseFileStream = null;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void closeOutput(PoseDataStream poseFileStream) throws IOException {
|
||||
if (poseFileStream != null) {
|
||||
poseFileStream.writeFooter(skeleton);
|
||||
poseFileStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user