private void showHudPositionHelper(Quaternion currentOrientation) { final Vector3 movement = WorldParameters.FORWARD_AXIS.clone(); Quaternion relative = currentOrientation.clone(); movement.rotateBy(relative).multiply(3); movement.inverse(); centralPane.getPosition().add(movement); // TODO move off to the side. leftTopPlane.getPosition().add(movement); // leftBottomPlane.getPosition().add(movement); }
/** * Utility method to move the specified number of units along the current up axis. This will also * adjust the look at target (if a valid one is currently set). * * @param units {@code double} Number of units to move. If negative, movement will be in the * "down" direction. */ public void moveUp(double units) { mTempVec.setAll(WorldParameters.UP_AXIS); mTempVec.rotateBy(mOrientation).normalize(); mTempVec.multiply(units); mPosition.add(mTempVec); if (mLookAtEnabled && mLookAtValid) { mLookAt.add(mTempVec); resetToLookAt(); } markModelMatrixDirty(); }
public Vector3 transferTo3D(Point2D point) { Vector3 newPoint = new Vector3(point.x(), point.y(), 0); newPoint.rotateBy(inversePlaneZRotation); newPoint.add(planeOrigin); return newPoint; }
public Point2D transferTo2D(Vector3 point) { point = point.clone(); point.subtract(planeOrigin); point.rotateBy(planeZRotation); return new Point2D(point.x, point.y); }