/** * Alter the character's view direction. Note this only defines the * orientation in the local X-Z plane. * * @param vec a direction vector (not null, unaffected) */ public void setViewDirection(Vector3f vec) { viewDirection.set(vec); updateLocalViewDirection(); }
/** * Alter the character's view direction. Note this only defines the * orientation in the local X-Z plane. * * @param vec a direction vector (not null, unaffected) */ public void setViewDirection(Vector3f vec) { viewDirection.set(vec); updateLocalViewDirection(); }
/** * Rotate the physics object to the specified orientation. * <p> * We don't set the actual physics rotation but the view rotation here. It * might actually be altered by the calculateNewForward method. * * @param quat desired orientation (not null, unaffected) */ @Override protected void setPhysicsRotation(Quaternion quat) { rotation.set(quat); rotation.multLocal(rotatedViewDirection.set(viewDirection)); updateLocalViewDirection(); }
/** * Rotate the physics object to the specified orientation. * <p> * We don't set the actual physics rotation but the view rotation here. It * might actually be altered by the calculateNewForward method. * * @param quat desired orientation (not null, unaffected) */ @Override protected void setPhysicsRotation(Quaternion quat) { rotation.set(quat); rotation.multLocal(rotatedViewDirection.set(viewDirection)); 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 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(); }
/** * Sets the view direction for the character. Note this only defines the * rotation of the spatial in the local x/z plane of the character. * * @param vec */ public void setViewDirection(Vector3f vec) { viewDirection.set(vec); updateLocalViewDirection(); }
/** * Alter the character's view direction. Note this only defines the * orientation in the local X-Z plane. * * @param vec a direction vector (not null, unaffected) */ public void setViewDirection(Vector3f vec) { viewDirection.set(vec); updateLocalViewDirection(); }
/** * This is implemented from AbstractPhysicsControl and called when the * spatial is attached for example. We don't set the actual physics rotation * but the view rotation here. It might actually be altered by the * calculateNewForward method. * * @param quat */ @Override protected void setPhysicsRotation(Quaternion quat) { rotation.set(quat); rotation.multLocal(rotatedViewDirection.set(viewDirection)); updateLocalViewDirection(); }
/** * Rotate the physics object to the specified orientation. * <p> * We don't set the actual physics rotation but the view rotation here. It * might actually be altered by the calculateNewForward method. * * @param quat desired orientation (not null, unaffected) */ @Override protected void setPhysicsRotation(Quaternion quat) { rotation.set(quat); rotation.multLocal(rotatedViewDirection.set(viewDirection)); 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 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(); }