Package com.jme3.math

Examples of com.jme3.math.Quaternion.lookAt()


                localLocation.divideLocal(spatial.getParent().getWorldScale());
                tmp_inverseWorldRotation.set(spatial.getParent().getWorldRotation()).inverseLocal().multLocal(localLocation);
                spatial.setLocalTranslation(localLocation);

                if (useViewDirection) {
                    localRotationQuat.lookAt(viewDirection, Vector3f.UNIT_Y);
                    spatial.setLocalRotation(localRotationQuat);
                }
            } else {
                spatial.setLocalTranslation(getPhysicsLocation());
                localRotationQuat.lookAt(viewDirection, Vector3f.UNIT_Y);
View Full Code Here


                    localRotationQuat.lookAt(viewDirection, Vector3f.UNIT_Y);
                    spatial.setLocalRotation(localRotationQuat);
                }
            } else {
                spatial.setLocalTranslation(getPhysicsLocation());
                localRotationQuat.lookAt(viewDirection, Vector3f.UNIT_Y);
                spatial.setLocalRotation(localRotationQuat);
            }
        }
    }
View Full Code Here

    private void computeTargetDirection() {
        switch (directionType) {
            case Path:
                Quaternion q = new Quaternion();
                q.lookAt(direction, upVector);
                spatial.setLocalRotation(q);
                break;
            case LookAt:
                if (lookAt != null) {
                    spatial.lookAt(lookAt, upVector);
View Full Code Here

                }
                break;
            case PathAndRotation:
                if (rotation != null) {
                    Quaternion q2 = new Quaternion();
                    q2.lookAt(direction, upVector);
                    q2.multLocal(rotation);
                    spatial.setLocalRotation(q2);
                }
                break;
            case Rotation:
View Full Code Here

  public Ramp(World world, Vector3f base, Vector3f top, float width, float thickness, ColorRGBA color, boolean isHologram) {
    super(0, isHologram, color);

    float length = top.subtract(base).length();
    Quaternion rotation = new Quaternion();
    rotation.lookAt(base.subtract(top), Vector3f.UNIT_Y);

    // These points are an approximation. They should be extended down half
    // the thickness perpendicular to the plane of the ramp.
    Vector3f baseCenter = base.clone().subtractLocal(0.0f, thickness / 2.0f, 0.0f);
    Vector3f topCenter = top.clone().subtractLocal(0.0f, thickness / 2.0f, 0.0f);
View Full Code Here

        FrameBuffer offBuffer = new FrameBuffer(1024, 256, 1);

        //setup framebuffer's cam
        offCamera.setFrustumPerspective(45f, 4f, 1f, 1000f);
        offCamera.setLocation(new Vector3f(0f, 0f, -5f));
        offCamera.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);

        //setup framebuffer's texture
        Texture2D offTex = new Texture2D(1024, 256, Format.RGBA8);
        offTex.setMinFilter(Texture.MinFilter.Trilinear);
        offTex.setMagFilter(Texture.MagFilter.Bilinear);
View Full Code Here

    }

    private void createCamMotionPath() {
        CameraNode seagull = cinematic.bindCamera("seagull", myApp.getCamera());
        seagull.setLocalTranslation(new Vector3f(-231.00694f, 269.15887f, 319.6499f));
        seagull.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);
        //Motion1
        MotionPath path1 = new MotionPath();
        path1.addWayPoint(new Vector3f(-231.00694f, 269.15887f, 319.6499f));
        path1.addWayPoint(new Vector3f(-271.03436f, 274.78607f, 166.41858f));
        path1.addWayPoint(new Vector3f(-282.98575f, 198.66827f, -62.538017f));
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.