Package com.ardor3d.math.type

Examples of com.ardor3d.math.type.ReadOnlyMatrix3


            return result;
        }

        // In all remaining cases, the matrix cannot be written as R*S*X+T.
        final ReadOnlyMatrix3 matrixA = isRotationMatrix() ? _matrix.multiplyDiagonalPost(_scale,
                Matrix3.fetchTempInstance()) : _matrix;

        final ReadOnlyMatrix3 matrixB = transformBy.isRotationMatrix() ? transformBy.getMatrix().multiplyDiagonalPost(
                transformBy.getScale(), Matrix3.fetchTempInstance()) : transformBy.getMatrix();

        final Matrix3 newMatrix = result._matrix;
        newMatrix.set(matrixA).multiplyLocal(matrixB);

View Full Code Here


            return true;
        }
        if (!(o instanceof ReadOnlyMatrix3)) {
            return false;
        }
        final ReadOnlyMatrix3 comp = (ReadOnlyMatrix3) o;
        if (Math.abs(getM00() - comp.getM00()) > Matrix3.ALLOWED_DEVIANCE) {
            return false;
        } else if (Math.abs(getM01() - comp.getM01()) > Matrix3.ALLOWED_DEVIANCE) {
            return false;
        } else if (Math.abs(getM02() - comp.getM02()) > Matrix3.ALLOWED_DEVIANCE) {
            return false;
        } else if (Math.abs(getM10() - comp.getM10()) > Matrix3.ALLOWED_DEVIANCE) {
            return false;
        } else if (Math.abs(getM11() - comp.getM11()) > Matrix3.ALLOWED_DEVIANCE) {
            return false;
        } else if (Math.abs(getM12() - comp.getM12()) > Matrix3.ALLOWED_DEVIANCE) {
            return false;
        } else if (Math.abs(getM20() - comp.getM20()) > Matrix3.ALLOWED_DEVIANCE) {
            return false;
        } else if (Math.abs(getM21() - comp.getM21()) > Matrix3.ALLOWED_DEVIANCE) {
            return false;
        } else if (Math.abs(getM22() - comp.getM22()) > Matrix3.ALLOWED_DEVIANCE) {
            return false;
        }

        return true;
    }
View Full Code Here

            return true;
        }
        if (!(o instanceof ReadOnlyMatrix3)) {
            return false;
        }
        final ReadOnlyMatrix3 comp = (ReadOnlyMatrix3) o;
        if (getM00() != comp.getM00()) {
            return false;
        } else if (getM01() != comp.getM01()) {
            return false;
        } else if (getM02() != comp.getM02()) {
            return false;
        } else if (getM10() != comp.getM10()) {
            return false;
        } else if (getM11() != comp.getM11()) {
            return false;
        } else if (getM12() != comp.getM12()) {
            return false;
        } else if (getM20() != comp.getM20()) {
            return false;
        } else if (getM21() != comp.getM21()) {
            return false;
        } else if (getM22() != comp.getM22()) {
            return false;
        }

        return true;
    }
View Full Code Here

        return box;
    }

    public BoundingVolume transformRotational(final ReadOnlyTransform transform, final BoundingVolume store) {

        final ReadOnlyMatrix3 rotate = transform.getMatrix();
        final ReadOnlyVector3 scale = transform.getScale();
        final ReadOnlyVector3 translate = transform.getTranslation();

        BoundingBox box;
        if (store == null || store.getType() != Type.AABB) {
            box = new BoundingBox();
        } else {
            box = (BoundingBox) store;
        }

        _center.multiply(scale, box._center);
        rotate.applyPost(box._center, box._center);
        box._center.addLocal(translate);

        final Matrix3 transMatrix = Matrix3.fetchTempInstance();
        transMatrix.set(rotate);
        // Make the rotation matrix all positive to get the maximum x/y/z extent
View Full Code Here

    @Override
    public void updateWorldTransform(final boolean recurse) {
        super.updateWorldTransform(recurse);
        if (_camera != null) {
            final ReadOnlyVector3 worldTranslation = getWorldTranslation();
            final ReadOnlyMatrix3 worldRotation = getWorldRotation();
            _camera.setFrame(worldTranslation, worldRotation);
        }
    }
View Full Code Here

        }

        @Override
        public void prepare(final ParticleSystem system) {
            _vector.set(_windDirection);
            final ReadOnlyMatrix3 mat = system.getEmitterTransform().getMatrix();
            if (_rotateWithScene && !mat.isIdentity()) {
                mat.applyPost(_vector, _vector);
            }
        }
View Full Code Here

        }

        @Override
        public void prepare(final ParticleSystem system) {
            vector.set(gravity);
            final ReadOnlyMatrix3 mat = system.getEmitterTransform().getMatrix();
            if (rotateWithScene && !mat.isIdentity()) {
                mat.applyPost(vector, vector);
            }
        }
View Full Code Here

        @Override
        public void prepare(final ParticleSystem system) {
            _line.setOrigin(_axis.getOrigin());
            _line.setDirection(_axis.getDirection());
            final ReadOnlyMatrix3 mat = system.getEmitterTransform().getMatrix();
            if (_transformWithScene && !mat.isIdentity()) {
                final Vector3 temp = Vector3.fetchTempInstance();
                mat.applyPost(_line.getOrigin(), temp);
                _line.setOrigin(temp);
                mat.applyPost(_line.getDirection(), temp);
                _line.setDirection(temp);
                Vector3.releaseTempInstance(temp);
            }
            if (_type == VT_CYLINDER) {
                _rot.fromAngleAxis(-_divergence, _line.getDirection());
View Full Code Here

TOP

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

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.