Package com.ardor3d.math

Examples of com.ardor3d.math.Line3


                        arrow == _yArrow ? Vector3.UNIT_Y : //
                                Vector3.UNIT_Z);

        // rotate to arrow plane
        _handle.getRotation().applyPost(_calcVec3C, _calcVec3C);
        final Line3 arrowLine = new Line3(_calcVec3A, _calcVec3C.normalize(_calcVec3D));

        // make plane object
        final Plane pickPlane = new Plane().setPlanePoints(_calcVec3A, _calcVec3B, _calcVec3C.addLocal(_calcVec3A));

        // find out where we were hitting the plane before
        getPickRay(oldMouse, camera);
        if (!_calcRay.intersectsPlane(pickPlane, _calcVec3A)) {
            return _calcVec3A.zero();
        }

        // find out where we are hitting the plane now
        getPickRay(new Vector2(current.getX(), current.getY()), camera);
        if (!_calcRay.intersectsPlane(pickPlane, _calcVec3B)) {
            return _calcVec3A.zero();
        }

        // Cast us to the line along our arrow
        arrowLine.distanceSquared(_calcVec3A, _calcVec3C);
        arrowLine.distanceSquared(_calcVec3B, _calcVec3D);

        // convert to target coord space
        final Node parent = manager.getSpatialTarget().getParent();
        if (parent != null) {
            parent.getWorldTransform().applyInverse(_calcVec3C);
View Full Code Here


        public void write(final OutputCapsule capsule) throws IOException {
            super.write(capsule);
            capsule.write(_type, "type", VT_CYLINDER);
            capsule.write(_strength, "strength", 1.0);
            capsule.write(_divergence, "divergence", 0.0);
            capsule.write(_axis, "axis", new Line3(new Vector3(), new Vector3(Vector3.UNIT_Y)));
            capsule.write(_height, "height", 0.0);
            capsule.write(_radius, "radius", 1.0);
            capsule.write(_random, "random", false);
            capsule.write(_transformWithScene, "transformWithScene", true);
        }
View Full Code Here

        public void read(final InputCapsule capsule) throws IOException {
            super.read(capsule);
            _type = capsule.readInt("type", VT_CYLINDER);
            _strength = capsule.readDouble("strength", 1.0);
            _divergence = capsule.readDouble("divergence", 0.0);
            _axis.set((Line3) capsule.readSavable("axis", new Line3(new Vector3(), new Vector3(Vector3.UNIT_Y))));
            _height = capsule.readDouble("height", 0.0);
            _radius = capsule.readDouble("radius", 1.0);
            _random = capsule.readBoolean("random", false);
            _transformWithScene = capsule.readBoolean("transformWithScene", true);
        }
View Full Code Here

TOP

Related Classes of com.ardor3d.math.Line3

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.