/** @param model The source {@link Model}
* @param transform The {@link Matrix4} instance for this ModelInstance to reference or null to create a new matrix.
* @param nodeId The ID of the {@link Node} within the {@link Model} for the instance to contain
* @param recursive True to recursively search the Model's node tree, false to only search for a root node
* @param parentTransform True to apply the parent's node transform to the instance (only applicable if recursive is true).
* @param mergeTransform True to apply the source node transform to the instance transform, resetting the node transform. */
public SharedModel(final Model model, final Matrix4 transform, final String nodeId, boolean recursive, boolean parentTransform, boolean mergeTransform) {
this.model = model;
this.transform = transform == null ? new Matrix4() : transform;
nodePartBones.clear();
Node copy, node = model.getNode(nodeId, recursive);
this.nodes.add(copy = copyNode(null, node));
if (mergeTransform) {
this.transform.mul(parentTransform ? node.globalTransform : node.localTransform);
copy.translation.set(0,0,0);
copy.rotation.idt();
copy.scale.set(1,1,1);
} else if (parentTransform && copy.parent != null)
this.transform.mul(node.parent.globalTransform);
setBones();
copyAnimations(model.animations);
calculateTransforms();
}
SharedModel.java 文件源码
java
阅读 83
收藏 0
点赞 0
评论 0
项目:vtm
作者:
评论列表
文章目录