/** * Updates the local X-Z view direction and the corresponding rotation * quaternion for the spatial. */ protected void updateLocalViewDirection() { //update local rotation quaternion to use for view rotation localForwardRotation.multLocal(rotatedViewDirection.set(viewDirection)); calculateNewForward(rotation, rotatedViewDirection, localUp); }
/** * Updates the local X-Z view direction and the corresponding rotation * quaternion for the spatial. */ protected void updateLocalViewDirection() { //update local rotation quaternion to use for view rotation localForwardRotation.multLocal(rotatedViewDirection.set(viewDirection)); calculateNewForward(rotation, rotatedViewDirection, localUp); }
/** * Updates the local coordinate system from the localForward and localUp * vectors, adapts localForward, sets localForwardRotation quaternion to * local Z-forward rotation. */ protected void updateLocalCoordinateSystem() { //gravity vector has possibly changed, calculate new world forward (UNIT_Z) calculateNewForward(localForwardRotation, localForward, localUp); localLeft.set(localUp).crossLocal(localForward); rigidBody.setPhysicsRotation(localForwardRotation); updateLocalViewDirection(); }
/** * Updates the local coordinate system from the localForward and localUp * vectors, adapts localForward, sets localForwardRotation quaternion to * local Z-forward rotation. */ protected void updateLocalCoordinateSystem() { //gravity vector has possibly changed, calculate new world forward (UNIT_Z) calculateNewForward(localForwardRotation, localForward, localUp); localLeft.set(localUp).crossLocal(localForward); rigidBody.setPhysicsRotation(localForwardRotation); updateLocalViewDirection(); }
/** * Updates the local X-Z view direction and the corresponding rotation * quaternion for the spatial. */ protected void updateLocalViewDirection() { //update local rotation quaternion to use for view rotation localForwardRotation.multLocal(rotatedViewDirection.set(viewDirection)); calculateNewForward(rotation, rotatedViewDirection, localUp); }
/** * Updates the local x/z-flattened view direction and the corresponding * rotation quaternion for the spatial. */ protected void updateLocalViewDirection() { //update local rotation quaternion to use for view rotation localForwardRotation.multLocal(rotatedViewDirection.set(viewDirection)); calculateNewForward(rotation, rotatedViewDirection, localUp); }
/** * Updates the local coordinate system from the localForward and localUp * vectors, adapts localForward, sets localForwardRotation quaternion to * local z-forward rotation. */ protected void updateLocalCoordinateSystem() { //gravity vector has possibly changed, calculate new world forward (UNIT_Z) calculateNewForward(localForwardRotation, localForward, localUp); localLeft.set(localUp).crossLocal(localForward); rigidBody.setPhysicsRotation(localForwardRotation); updateLocalViewDirection(); }
/** * Updates the local coordinate system from the localForward and localUp * vectors, adapts localForward, sets localForwardRotation quaternion to * local Z-forward rotation. */ protected void updateLocalCoordinateSystem() { //gravity vector has possibly changed, calculate new world forward (UNIT_Z) calculateNewForward(localForwardRotation, localForward, localUp); localLeft.set(localUp).crossLocal(localForward); rigidBody.setPhysicsRotation(localForwardRotation); updateLocalViewDirection(); }