Package com.ardor3d.math

Examples of com.ardor3d.math.Matrix3.applyPost()


        transMatrix.setValue(2, 0, Math.abs(transMatrix.getM20()));
        transMatrix.setValue(2, 1, Math.abs(transMatrix.getM21()));
        transMatrix.setValue(2, 2, Math.abs(transMatrix.getM22()));

        _compVect1.set(getXExtent() * scale.getX(), getYExtent() * scale.getY(), getZExtent() * scale.getZ());
        transMatrix.applyPost(_compVect1, _compVect1);
        // Assign the biggest rotations after scales.
        box.setXExtent(Math.abs(_compVect1.getX()));
        box.setYExtent(Math.abs(_compVect1.getY()));
        box.setZExtent(Math.abs(_compVect1.getZ()));

View Full Code Here


        }

        _compVect1.set(bs.getCenter()).subtractLocal(_center);
        final Matrix3 tempMa = Matrix3.fetchTempInstance().fromAxes(_xAxis, _yAxis, _zAxis);

        tempMa.applyPost(_compVect1, _compVect1);

        boolean result = false;
        if (Math.abs(_compVect1.getX()) < bs.getRadius() + _extent.getX()
                && Math.abs(_compVect1.getY()) < bs.getRadius() + _extent.getY()
                && Math.abs(_compVect1.getZ()) < bs.getRadius() + _extent.getZ()) {
View Full Code Here

        // Compute the additional rotation required for the billboard to face
        // the camera. To do this, the camera must be inverse-transformed into
        // the model space of the billboard.
        _look.set(camera.getLocation()).subtractLocal(_worldTransform.getTranslation());
        final Matrix3 worldMatrix = Matrix3.fetchTempInstance().set(_worldTransform.getMatrix());
        worldMatrix.applyPost(_look, _left); // coopt left for our own purposes.
        final ReadOnlyVector3 scale = _worldTransform.getScale();
        _left.divideLocal(scale);

        // squared length of the camera projection in the xz-plane
        final double lengthSquared = _left.getX() * _left.getX() + _left.getZ() * _left.getZ();
 
View Full Code Here

                if ((Double.doubleToLongBits(pVelocity.lengthSquared()) & 0x1d) != 0) {
                    workMat.fromAngleAxis(_turnSpeed * dt, axis);
                } else {
                    workMat.fromAngleAxis(-_turnSpeed * dt, axis);
                }
                workMat.applyPost(pVelocity, pVelocity);
            }
        } else {
            final Vector3 axis = workVect2.crossLocal(workVect);
            // IN THE INNER ZONE...
            // Alter the heading based on how fast we are going
View Full Code Here

            if ((index & 0x1f) != 0) {
                workMat.fromAngleAxis(_turnSpeed * dt, axis);
            } else {
                workMat.fromAngleAxis(-_turnSpeed * dt, axis);
            }
            workMat.applyPost(pVelocity, pVelocity);
        }
        Vector3.releaseTempInstance(workVect);
        Vector3.releaseTempInstance(workVect2);
        Matrix3.releaseTempInstance(workMat);
    }
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.