Package org.terasology.rendering.assets.skeletalmesh

Examples of org.terasology.rendering.assets.skeletalmesh.Bone


    }

    @Override
    public boolean isValidAnimationFor(SkeletalMesh mesh) {
        for (int i = 0; i < data.getBoneNames().size(); ++i) {
            Bone bone = mesh.getBone(data.getBoneNames().get(i));
            boolean hasParent = data.getBoneParent().get(i) != MeshAnimationData.NO_PARENT;
            if (hasParent && (bone.getParent() == null || !bone.getParent().getName().equals(data.getBoneNames().get(data.getBoneParent().get(i))))) {
                return false;
            } else if (!hasParent && bone.getParent() != null) {
                return false;
            }
        }
        return true;
    }
View Full Code Here


            }
            if (null == joint.orientation) {
                throw new ColladaParseException("no joint orientation for joint with element id " + joint.element.id());
            }
            // index argument is not used for anything currently, so we'll just set it to -1
            joint.bone = new Bone(-1, joint.name, joint.position, joint.orientation);
        }

        for (MD5Joint joint : md5JointList) {
            for (MD5Joint childJoint : joint.childList) {
                // We can probably skip unused end nodes
View Full Code Here

            MD5 md5 = parse(stream);
            SkeletalMeshDataBuilder skeletonBuilder = new SkeletalMeshDataBuilder();
            List<Bone> bones = Lists.newArrayListWithCapacity(md5.numJoints);
            for (int i = 0; i < md5.numJoints; ++i) {
                MD5Joint joint = md5.joints[i];
                Bone bone = new Bone(i, joint.name, joint.position, joint.orientation);
                bones.add(bone);
                if (joint.parent != -1) {
                    bones.get(joint.parent).addChild(bone);
                }
                skeletonBuilder.addBone(bone);
View Full Code Here

TOP

Related Classes of org.terasology.rendering.assets.skeletalmesh.Bone

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.