LibGDX: 跟踪节点 while moving/animate
LibGDX: Tracking nodes while moving/animate
有谁知道如何在 moving/animate 时跟踪 ModelInstance 中节点的位置?
Vector3 moving = new Vector3()
entity.modelInstance.getNode("RightHand").localTransform.getTranslation(moving);
modelInstance 移动位置时似乎没有引用该值。
使用此代码时会出现相同的结果
mov = beMainChar.modelInstance.getNode("RightHand").translation
提前致谢
RightHand
的 localTransform
不会改变,因为 ModelInstance
被翻译成另一个全局位置,为此你需要检查 globalTransform
的 Node
.
Vector3 moving = new Vector3();
entity.modelInstance.calculateWorldTransform();
entity.ModelInstance.getNode("RightHand").globalTransform.getTranslation(moving);
有谁知道如何在 moving/animate 时跟踪 ModelInstance 中节点的位置?
Vector3 moving = new Vector3()
entity.modelInstance.getNode("RightHand").localTransform.getTranslation(moving);
modelInstance 移动位置时似乎没有引用该值。
使用此代码时会出现相同的结果
mov = beMainChar.modelInstance.getNode("RightHand").translation
提前致谢
RightHand
的 localTransform
不会改变,因为 ModelInstance
被翻译成另一个全局位置,为此你需要检查 globalTransform
的 Node
.
Vector3 moving = new Vector3();
entity.modelInstance.calculateWorldTransform();
entity.ModelInstance.getNode("RightHand").globalTransform.getTranslation(moving);