Package com.ardor3d.math

Examples of com.ardor3d.math.Quaternion.fromAngleAxis()


                    // range is now 0 to 90 degrees, reflected
                    angle = Math.abs(angle);
                    // range is now -45 to 45 degrees
                    angle -= MathUtils.HALF_PI / 2.0;

                    headRotation.fromAngleAxis(angle, Vector3.UNIT_X);
                    headSource.setJointRotation(headJoint, headRotation);
                }
            }
        });
View Full Code Here


            // Neck
            final Quaternion q = Quaternion.fetchTempInstance();
            final double vv = (time % (LOOP_TIME * 2d)) / LOOP_TIME - 1d;
            final double v = (vv > 0) ? vv : -vv;
            q.fromAngleAxis(v * 60 * MathUtils.DEG_TO_RAD - 30 * MathUtils.DEG_TO_RAD, Vector3.UNIT_Z);
            targetJoint(pose, 13, q);

            q.fromAngleAxis(v * 5 * MathUtils.DEG_TO_RAD - 35 * MathUtils.DEG_TO_RAD, Vector3.UNIT_X);
            q.fromAngleAxis(v * 75 * MathUtils.DEG_TO_RAD, Vector3.UNIT_X);

View Full Code Here

            final double vv = (time % (LOOP_TIME * 2d)) / LOOP_TIME - 1d;
            final double v = (vv > 0) ? vv : -vv;
            q.fromAngleAxis(v * 60 * MathUtils.DEG_TO_RAD - 30 * MathUtils.DEG_TO_RAD, Vector3.UNIT_Z);
            targetJoint(pose, 13, q);

            q.fromAngleAxis(v * 5 * MathUtils.DEG_TO_RAD - 35 * MathUtils.DEG_TO_RAD, Vector3.UNIT_X);
            q.fromAngleAxis(v * 75 * MathUtils.DEG_TO_RAD, Vector3.UNIT_X);

            Quaternion.releaseTempInstance(q);

            p.setLocation(Math.sin(time) * 5, Math.cos(time) * 5 + 10, 5);
View Full Code Here

            final double v = (vv > 0) ? vv : -vv;
            q.fromAngleAxis(v * 60 * MathUtils.DEG_TO_RAD - 30 * MathUtils.DEG_TO_RAD, Vector3.UNIT_Z);
            targetJoint(pose, 13, q);

            q.fromAngleAxis(v * 5 * MathUtils.DEG_TO_RAD - 35 * MathUtils.DEG_TO_RAD, Vector3.UNIT_X);
            q.fromAngleAxis(v * 75 * MathUtils.DEG_TO_RAD, Vector3.UNIT_X);

            Quaternion.releaseTempInstance(q);

            p.setLocation(Math.sin(time) * 5, Math.cos(time) * 5 + 10, 5);
            if (updateLight) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.