/**
* @param bodyPart The rigid body which is to be synchronized with a node
* @param node The node which is to be synchronized with a body
*/
private void addPart(btRigidBody bodyPart, Node node) {
if (!bodyPartMap.containsKey(bodyPart)) {
bodyPartMap.put(bodyPart, new RigidBodyNodeConnection());
}
RigidBodyNodeConnection conn = bodyPartMap.get(bodyPart);
conn.followNode = node;
// Set the follow offset to the middle of the armature bone
Vector3 offsetTranslation = new Vector3();
node.getChild(0).localTransform.getTranslation(offsetTranslation).scl(0.5f);
conn.bodyNodeOffsets.put(node, offsetTranslation);
if (!ragdollMappedNodes.contains(node, true)) {
ragdollMappedNodes.add(node);
}
}
Ragdoll.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:GdxDemo3D
作者:
评论列表
文章目录