/** * Resets the orientation of this {@link ATransformable3D} object to look at its look at target * and use the specified {@link Vector3} as up. If this is part of a scene graph, the graph will * be notified of the change. * * @param upAxis {@link Vector3} The direction to use as the up axis. * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D resetToLookAt(Vector3 upAxis) { mTempVec.subtractAndSet(mLookAt, mPosition); // In OpenGL, Cameras are defined such that their forward axis is -Z, not +Z like we have // defined objects. if (mIsCamera) mTempVec.inverse(); mOrientation.lookAt(mTempVec, upAxis); mLookAtValid = true; markModelMatrixDirty(); return this; }
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); }