Package com.ardor3d.extension.animation.skeletal

Examples of com.ardor3d.extension.animation.skeletal.Joint


    @Override
    protected void initExample() {
        final Transform j1Transform = new Transform();
        j1Transform.setTranslation(0, 0, -5);
        j1Transform.invert(j1Transform);
        final Joint j1 = new Joint("j1");
        j1.setInverseBindPose(j1Transform);
        j1.setParentIndex(Joint.NO_PARENT);

        final Transform j2Transform = new Transform();
        j2Transform.setTranslation(0, 0, 5);
        j2Transform.invert(j2Transform);
        final Joint j2 = new Joint("j2");
        j2.setInverseBindPose(j2Transform);
        j2.setParentIndex((short) 0);

        final Skeleton sk = new Skeleton("arm sk", new Joint[] { j1, j2 });

        pose1 = new SkeletonPose(sk);
        pose1.updateTransforms();
View Full Code Here


            animationClip = new AnimationClip(animationItemRoot.getName());
            animationItemRoot.setAnimationClip(animationClip);
        }

        // Make an animation channel - first find if we have a matching joint
        Joint joint = _dataCache.getElementJointMapping().get(parentElement);
        if (joint == null) {
            String nodeName = parentElement.getAttributeValue("name", (String) null);
            if (nodeName == null) { // use id if name doesn't exist
                nodeName = parentElement.getAttributeValue("id", parentElement.getName());
            }
View Full Code Here

        }
        return null;
    }

    private void buildJointLists(final JointNode jointNode, final List<Joint> jointList) {
        final Joint joint = jointNode.getJoint();
        joint.setIndex((short) jointList.size());
        if (jointNode.getParent().getJoint() != null) {
            joint.setParentIndex(jointNode.getParent().getJoint().getIndex());
        } else {
            joint.setParentIndex(Joint.NO_PARENT);
        }
        jointList.add(joint);
        for (final JointNode jointChildNode : jointNode.getChildren()) {
            buildJointLists(jointChildNode, jointList);
        }
View Full Code Here

            buildJointLists(jointChildNode, jointList);
        }
    }

    private void initDefaultJointTransforms(final JointNode jointNode) {
        final Joint j = jointNode.getJoint();
        if (j != null && jointNode.getSceneNode() != null) {
            j.setInverseBindPose(jointNode.getSceneNode().getWorldTransform().invert(null));
        }
        for (final JointNode jointChildNode : jointNode.getChildren()) {
            initDefaultJointTransforms(jointChildNode);
        }
    }
View Full Code Here

                name = dNode.getAttributeValue("id");
            }
            if (name == null) {
                name = dNode.getAttributeValue("sid");
            }
            final Joint joint = new Joint(name);
            jointChildNode = new JointNode(joint);
            jointChildNode.setParent(jointNode);
            jointNode.getChildren().add(jointChildNode);
            jointNode = jointChildNode;
View Full Code Here

                    if (found == null) {
                        throw new ColladaException("Unable to find joint with " + searcher + ": " + name, skin);
                    }
                }

                final Joint joint = _dataCache.getElementJointMapping().get(found);
                if (joint == null) {
                    logger.warning("unable to parse joint for: " + found.getName() + " " + name);
                    return;
                }
                joint.setInverseBindPose(bindMatrices.get(i));

                ourSkeleton = _dataCache.getJointSkeletonMapping().get(joint);
                order[i] = joint.getIndex();
            }

            // Make our skeleton pose
            SkeletonPose skPose = _dataCache.getSkeletonPoseMapping().get(ourSkeleton);
            if (skPose == null) {
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.animation.skeletal.Joint

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.