Package com.jme.math

Examples of com.jme.math.Vector3f


        // Create a sub-node to hold the second arrow. We must rotate it 180
        // degrees (about the +y axis since arrows by default point up). We
        // also must translate it down. Attach the second arrow to this node.
        Node subNode2 = new Node();
        Quaternion q = new Quaternion().fromAngleAxis((float)Math.PI, new Vector3f(0, 0, 1));
        subNode2.setLocalRotation(q);
        subNode2.setLocalTranslation(0, -length / 2, 0);
        subNode2.attachChild(a2);

        // Attach the first arrow and the subnode to the main node
View Full Code Here


            this.rotation = new Quaternion();
        else
            this.rotation = rotate.clone();

        if (translate==null)
            this.translation = new Vector3f();
        else
            this.translation = translate.clone();

        this.scale = scale;
    }
View Full Code Here

        return out;
    }

    protected Vector3f toVector(Point point) {
        return new Vector3f(getX(point.x, point.y), 0f,
                                  getZ(point.x, point.y));
    }
View Full Code Here

            this.rotation = new Quaternion();
        else
            this.rotation = rotate.clone();

        if (translate==null)
            this.translation = new Vector3f();
        else
            this.translation = translate.clone();

        if (scale == null) {
            this.scale = 0.0f;
View Full Code Here

    }

    private CellTransform(CellTransform orig) {
        this.rotation = new Quaternion(orig.rotation);
        this.translation = new Vector3f(orig.translation);
        this.scale = orig.scale;
    }
View Full Code Here

     * Transform the BoundingVolume
     * @param ret
     */
    public void transform(BoundingVolume ret) {
        assert(ret!=null);
        ret.transform(rotation,translation, new Vector3f(scale, scale, scale), ret);
    }
View Full Code Here

     * @param translation object to return (to avoid gc)
     * @return the translation for this transform
     */
    public Vector3f getTranslation(Vector3f translation) {
        if (translation==null)
            return new Vector3f(this.translation);
       
        translation.set(this.translation);
        return translation;
    }
View Full Code Here

     * Set the translation.
     * @param translation set the translation for this transform
     */
    public void setTranslation(Vector3f translation) {
        if (this.translation==null)
            this.translation = new Vector3f();
        else
            this.translation.set(translation);
    }
View Full Code Here

     * @param scale Populate this object with the scale if non-null
     * @return The scaling factors
     */
    public Vector3f getScaling(Vector3f scale) {
        if (scale == null) {
            scale = new Vector3f(this.scale, this.scale, this.scale);
        }
        else {
            scale.set(this.scale, this.scale, this.scale);
        }
        return scale;
View Full Code Here

                "] [s=" + scale+"]";

    }

    private String printQuat(Quaternion q) {
        Vector3f axis = new Vector3f();
        float angle = q.toAngleAxis(axis);
        return axis+":"+Math.toDegrees(angle);
    }
View Full Code Here

TOP

Related Classes of com.jme.math.Vector3f

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.