Package com.ardor3d.math.type

Examples of com.ardor3d.math.type.ReadOnlyTransform


        SubTexUtil._vals[5] = rightH;
        SubTexUtil._vals[6] = leftW;
        SubTexUtil._vals[7] = rightH;

        // Set our transform
        final ReadOnlyTransform worldT = appliedTransform != null ? appliedTransform : Transform.IDENTITY;
        final Vector3 v = Vector3.fetchTempInstance();
        v.set(x, y, 0);
        worldT.applyForwardVector(v);
        worldT.multiply(subTex.getTransform(), SubTexUtil._helperT);
        SubTexUtil._helperT.translate(v);
        Vector3.releaseTempInstance(v);
        SubTexUtil._mesh.setWorldTransform(SubTexUtil._helperT);

        // set our vertices into the mesh
View Full Code Here


        final short parentIndex = joints[jointIndex].getParentIndex();

        // neckBindGlobalTransform is the neck bone -> model space transform. essentially, it is the world transform of
        // the neck bone in bind pose.
        final ReadOnlyTransform inverseNeckBindGlobalTransform = joints[jointIndex].getInverseBindPose();
        final ReadOnlyTransform neckBindGlobalTransform = inverseNeckBindGlobalTransform.invert(calcTrans1);

        calcQuat1.fromRotationMatrix(neckBindGlobalTransform.getMatrix());
        calcQuat1.slerpLocal(calcQuat1, rotation, 1);

        final Transform subTransform = calcTrans2.setIdentity();
        subTransform.setRotation(calcQuat1);

        // Calculate a global version of that transform, as if it were attached to the neck
        final Transform subGlobal = neckBindGlobalTransform.multiply(subTransform, calcTrans3);

        // now remove the global/world transform of the neck's parent bone, leaving us with just the local transform of
        // neck + rotation.
        final Transform local = joints[parentIndex].getInverseBindPose().multiply(subGlobal, calcTrans2);
View Full Code Here

        final short parentIndex = joints[jointIndex].getParentIndex();

        // neckBindGlobalTransform is the neck bone -> model space transform. essentially, it is the world transform of
        // the neck bone in bind pose.
        final ReadOnlyTransform inverseNeckBindGlobalTransform = joints[jointIndex].getInverseBindPose();
        final ReadOnlyTransform neckBindGlobalTransform = inverseNeckBindGlobalTransform.invert(calcTrans1);

        // Get a vector representing forward direction in neck space, use inverse to take from world -> neck space.
        forwardDirection.set(bindPoseDirection);
        inverseNeckBindGlobalTransform.applyForwardVector(forwardDirection, forwardDirection);

        // Get a vector representing a direction to the camera in neck space.
        targetPos.subtract(globalTransforms[jointIndex].getTranslation(), cameraDirection);
        cameraDirection.normalizeLocal();
        inverseNeckBindGlobalTransform.applyForwardVector(cameraDirection, cameraDirection);

        // Calculate a rotation to go from one direction to the other and set that rotation on a blank transform.
        calcQuat1.fromVectorToVector(forwardDirection, cameraDirection);
        calcQuat1.slerpLocal(Quaternion.IDENTITY, calcQuat1, targetStrength);

        final Transform subTransform = calcTrans2.setIdentity();
        subTransform.setRotation(calcQuat1);

        // Calculate a global version of that transform, as if it were attached to the neck
        final Transform subGlobal = neckBindGlobalTransform.multiply(subTransform, calcTrans3);

        // now remove the global/world transform of the neck's parent bone, leaving us with just the local transform of
        // neck + rotation.
        final Transform local = joints[parentIndex].getInverseBindPose().multiply(subGlobal, calcTrans2);
View Full Code Here

TOP

Related Classes of com.ardor3d.math.type.ReadOnlyTransform

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.