Examples of lookAt()


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

        Vector3f location = new Vector3f(0,0,0);
        Vector3f lookDirection = new Vector3f(0,0,1);

        Quaternion rotation = new Quaternion();
        rotation.lookAt(lookDirection, new Vector3f(0f,1f,0f));
        CellTransform initialLocation = new CellTransform(rotation, location);
        setLocalTransform(initialLocation);
    }

    /**
 
View Full Code Here

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

     */
    public static Quaternion getCellRotation(CellTransform viewTransform) {
        Quaternion viewRotation = viewTransform.getRotation(null);
        Vector3f lookAt = CellPlacementUtils.getLookDirection(viewRotation, null);
        Quaternion rotation = new Quaternion();
        rotation.lookAt(lookAt.negate(), new Vector3f(0, 1, 0));
        return rotation;
    }

    /**
     * Returns the distance away to play a Cell so that its horizontal bounds
View Full Code Here

Examples of com.jme.scene.shape.Arrow.lookAt()

        rotatedOnX.setLocalRotation(new Quaternion().fromAngleAxis(90*FastMath.DEG_TO_RAD, new Vector3f(1, 0, 0)));
        rotatedOnX.attachChild(arrow);
        rotatedOnX.setLocalTranslation(position);
//        arrow.setLocalTranslation(position);
        label.setLocalTranslation(labelPosition);
        arrow.lookAt(direction, new Vector3f(0,1,0));
        rootNode.attachChild(label);
        rootNode.attachChild(rotatedOnX);
        // Fetch the world translation for the root node of the cell and set
        // the translation for this entity root node
        rootNode.setLocalTranslation(transform.getTranslation(null));
View Full Code Here

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

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

                    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

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

    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

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

                }
                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

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

  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

Examples of com.jme3.renderer.Camera.lookAt()

        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

Examples of com.jme3.scene.CameraNode.lookAt()

    }

    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.