Wasabi
|
#include <WOrientation.hpp>
Public Member Functions | |
void | SetPosition (float x, float y, float z) |
void | SetPosition (const WVector3 pos) |
void | Point (float x, float y, float z) |
void | Point (WVector3 target) |
void | SetAngle (WQuaternion quat) |
void | SetToRotation (const WOrientation *const device) |
void | SetULRVectors (WVector3 up, WVector3 look, WVector3 right) |
void | SetToTransformation (WMatrix mtx) |
void | Yaw (float angle) |
void | Roll (float angle) |
void | Pitch (float angle) |
void | Move (float units) |
void | Strafe (float units) |
void | Fly (float units) |
float | GetPositionX () const |
float | GetPositionY () const |
float | GetPositionZ () const |
WVector3 | GetPosition () const |
float | GetAngleX () const |
float | GetAngleY () const |
float | GetAngleZ () const |
WQuaternion | GetRotation () const |
WVector3 | GetUVector () const |
WVector3 | GetLVector () const |
WVector3 | GetRVector () const |
virtual void | SetBindingMatrix (WMatrix mtx) |
void | RemoveBinding () |
WMatrix | GetBindingMatrix () const |
bool | IsBound () const |
virtual void | OnStateChange (STATE_CHANGE_TYPE type) |
WMatrix | ComputeTransformation () const |
WMatrix | ComputeInverseTransformation () const |
A WOrientation represents a hypothetical object in 3D space. To represent position, the class uses a 3D vector. To represent rotation, the class uses a set of 3 vectors:
WMatrix WOrientation::ComputeInverseTransformation | ( | ) | const |
This function recomputes the transformation matrix for this orientation. Most objects inheriting from WOrientation have their own GetWorldMatrix functions that are more efficient to use (since they cache the matrix).
WMatrix WOrientation::ComputeTransformation | ( | ) | const |
This function recomputes the transformation matrix for this orientation. Most objects inheriting from WOrientation have their own GetWorldMatrix functions that are more efficient to use (since they cache the matrix).
void WOrientation::Fly | ( | float | units | ) |
Moves the entity up. This will result in OnOrientationChange(CHANGE_MOTION) to be called.
units | Units to move by |
float WOrientation::GetAngleX | ( | ) | const |
Gets the angle between the look vector (projected onto the yz plane) and the world z axis (0, 0, 1).
float WOrientation::GetAngleY | ( | ) | const |
Gets the angle between the look vector (projected onto the xz plane) and the world z axis (0, 0, 1).
float WOrientation::GetAngleZ | ( | ) | const |
Gets the angle between the up vector (projected onto the xy plane) and the world y axis (0, 1, 0).
WMatrix WOrientation::GetBindingMatrix | ( | ) | const |
Retrieves the binding matrix. This can be used to multiply a world matrix corresponding to this WOrientation to produce the effect of being "bound" or "stuck" to something else as it moves.
WVector3 WOrientation::GetLVector | ( | ) | const |
Retrieves the look vector of the entity.
WVector3 WOrientation::GetPosition | ( | ) | const |
Retrieves the position of the entity.
float WOrientation::GetPositionX | ( | ) | const |
Retrieves the X position of the entity.
float WOrientation::GetPositionY | ( | ) | const |
Retrieves the Y position of the entity.
float WOrientation::GetPositionZ | ( | ) | const |
Retrieves the Z position of the entity.
WQuaternion WOrientation::GetRotation | ( | ) | const |
WVector3 WOrientation::GetRVector | ( | ) | const |
Retrieves the right vector of the entity.
WVector3 WOrientation::GetUVector | ( | ) | const |
Retrieves the up vector of the entity.
bool WOrientation::IsBound | ( | ) | const |
Checks whether or not the entity should be bound to a matrix or not.
void WOrientation::Move | ( | float | units | ) |
Moves the entity forward. This will result in OnOrientationChange(CHANGE_MOTION) to be called.
units | Units to move by |
|
virtual |
A callback called by this class when the entity changes its position or orientation.
type | Orientation change type |
Reimplemented in WRigidBody, WParticles, WObject, WLight, WTerrain, WBulletRigidBody, WCamera, WRigidBody, WBone, and WInstance.
void WOrientation::Pitch | ( | float | angle | ) |
Performs a rotation around the right axis of this entity. This will result in OnOrientationChange(CHANGE_ROTATION) to be called.
angle | Angle of rotation, in degrees |
void WOrientation::Point | ( | float | x, |
float | y, | ||
float | z | ||
) |
Sets the entity's orientation to point towards a 3D point. This will result in calling OnStateChange(CHANGE_ROTATION).
x | x coordinate of the point to look at |
y | y coordinate of the point to look at |
z | z coordinate of the point to look at |
void WOrientation::Point | ( | WVector3 | target | ) |
Sets the entity's orientation to point towards a 3D point. This will result in calling OnStateChange(CHANGE_ROTATION).
target | coordinate of the point to look at |
void WOrientation::RemoveBinding | ( | ) |
Removes or disables the current binding
void WOrientation::Roll | ( | float | angle | ) |
Performs a rotation around the look axis of this entity. This will result in OnOrientationChange(CHANGE_ROTATION) to be called.
angle | Angle of rotation, in degrees |
void WOrientation::SetAngle | ( | WQuaternion | quat | ) |
Sets the rotation of the entity to match that of a quaternion. This will result in calling OnStateChange(CHANGE_ROTATION).
quat | Quaternion to match |
|
virtual |
Binds this entity to the matrix provided. A WOrientation that is bound to a matrix may choose to alter the final matrix it produces (multiply it by the binding matrix) to achieve the effect of being "bound" or "stuck" to something else as it moves.
mtx | Matrix to bind to |
void WOrientation::SetPosition | ( | const WVector3 | pos | ) |
Sets the position of this entity.
pos | New position |
void WOrientation::SetPosition | ( | float | x, |
float | y, | ||
float | z | ||
) |
Sets the position of this entity. This will result in calling OnStateChange(CHANGE_MOTION).
x | New x position |
y | New y position |
z | New z position |
void WOrientation::SetToRotation | ( | const WOrientation *const | device | ) |
Sets the orientation of this entity to match that of another. This will result in calling OnStateChange(CHANGE_ROTATION).
device | The orientation to match |
void WOrientation::SetToTransformation | ( | WMatrix | mtx | ) |
Sets the orientation & position to match that of a given transformation matrix.
mtx | Transformation matrix |
Explicitly sets the up, look and right vectors. This will result in calling OnStateChange(CHANGE_ROTATION).
up | New up vector |
look | New look vector |
right | New right vector |
void WOrientation::Strafe | ( | float | units | ) |
Moves the entity to the right. This will result in OnOrientationChange(CHANGE_MOTION) to be called.
units | Units to move by |
void WOrientation::Yaw | ( | float | angle | ) |
Performs a rotation around the up axis of this entity. This will result in OnOrientationChange(CHANGE_ROTATION) to be called.
angle | Angle of rotation, in degrees |