Package com.jme.math

Examples of com.jme.math.Vector3f


     */
    public void updateGUI() {
        // Fetch the current transform from the movable component
        Cell cell = editor.getCell();
        CellTransform cellTransform = cell.getLocalTransform();
        Vector3f translation = cellTransform.getTranslation(null);
        Quaternion rotation = cellTransform.getRotation(null);
        Vector3f scale = cellTransform.getScaling(null);
        float[] angles = rotation.toAngles(new float[3]);

        // Update the translation spinners
        translationXTF.setValue(translation.x);
        translationYTF.setValue(translation.y);
View Full Code Here


    private void updateTranslation() {
        float x = (Float) xTranslationModel.getValue();
        float y = (Float) yTranslationModel.getValue();
        float z = (Float) zTranslationModel.getValue();

        Vector3f translation = new Vector3f(x, y, z);
        if (movableComponent != null) {
            Cell cell = editor.getCell();
            CellTransform cellTransform = cell.getLocalTransform();
            cellTransform.setTranslation(translation);
            movableComponent.localMoveRequest(cellTransform);
View Full Code Here

*/
public class FirstPersonCameraProcessor extends ThirdPersonCameraProcessor {

    public FirstPersonCameraProcessor() {
        super();
        offset = new Vector3f(0,2.2f,-0.2f);
    }
View Full Code Here

*/
public class FrontHackPersonCameraProcessor extends ThirdPersonCameraProcessor {

    public FrontHackPersonCameraProcessor() {
        super();
        offset = new Vector3f(0,2.2f,4);
        cameraLook = new Vector3f(0,0,-1);
        cameraZoom = -0.2f;
    }
View Full Code Here

     */
    @InternalAPI
    public Vector3f getCameraPosition (Vector3f ret) {
  synchronized (cameraLock) {
      if (ret == null) {
    return new Vector3f(cameraPositionWorld);
      }
      ret.set(cameraPositionWorld);
      return ret;
  }
    }
View Full Code Here

     */
    Ray calcPickRayWorld (int x, int y) {
        Ray result = null;
  // Get the world space coordinates of the eye position
  Camera camera = cameraComp.getCamera();
  Vector3f eyePosWorld = camera.getLocation();

  // Convert the event from AWT coords to JME float screen space.
  // Need to invert y because (0f, 0f) is at the button left corner.
  eventPointScreen.setX((float)x);
  eventPointScreen.setY((float)(canvas.getHeight()-1-y));
View Full Code Here

     */
    public Vector3f getIntersectionPointWorld() {
        if (pickDetails == null || pickDetails.getPosition() == null) {
            return null;
        } else {
      return new Vector3f(pickDetails.getPosition());
        }
    }
View Full Code Here

     */
    public Vector3f getIntersectionPointLocal() {
        if (pickDetails == null || pickDetails.getPosition() == null) {
            return null;
        } else {
            Vector3f posWorld = pickDetails.getPosition();
            if (posWorld == null) {
                return null;
            }
            CollisionComponent cc = pickDetails.getCollisionComponent();
            Node node = cc.getNode();
            node.getLocalToWorldMatrix(world2Local);
            world2Local.invert();
            return world2Local.mult(pickDetails.getPosition(), new Vector3f());
        }
    }
View Full Code Here

                sender.send(clientID, new ErrorMessage(editMessage.getMessageID(),
                        "Unable to determine the position of the cell " +
                        "to duplicate with id " + cellID));
                return;
            }
            Vector3f offset = new Vector3f(1, 0, 1);
            Vector3f origin = position.getTranslation();
            position.setTranslation(offset.add(origin));
            state.addComponentServerState(position);

            // Set the desired name of the cell contained within the message
            state.setName(((CellDuplicateMessage)editMessage).getCellName());
View Full Code Here

     */
    public Vector3f getHitIntersectionPointWorld () {
  if (hitPickDetails == null) {
      return null;
  } else {
      return new Vector3f(hitPickDetails.getPosition());
  }
    }
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.