![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Represents a 3D transformation including position, rotation, and scale. More...
#include <Transform.h>
Public Member Functions | |
Transform () | |
Default constructor. | |
Transform (const Vector3D &eulerXYZS, const Vector3D &position, const Vector3D &scale) | |
Constructor initializing with Euler angles, position, and scale. | |
Transform (const Quaternion &rotation, const Vector3D &position, const Vector3D &scale) | |
Constructor initializing with rotation, position, and scale. | |
Transform (const Vector3D &eulerXYZS, const Vector3D &position, const Vector3D &scale, const Vector3D &rotationOffset, const Vector3D &scaleOffset) | |
Constructor initializing with additional rotation and scale offsets. | |
Transform (const Quaternion &rotation, const Vector3D &position, const Vector3D &scale, const Vector3D &rotationOffset, const Vector3D &scaleOffset) | |
Constructor initializing with rotation and offsets. | |
Transform (const Transform &transform) | |
Copy constructor. | |
void | SetBaseRotation (const Quaternion &baseRotation) |
Sets the base rotation of the object. | |
Quaternion | GetBaseRotation () |
Gets the base rotation of the object. | |
void | SetRotation (const Quaternion &rotation) |
Sets the current rotation of the object. | |
void | SetRotation (const Vector3D &eulerXYZS) |
Sets the current rotation of the object using Euler angles. | |
Quaternion | GetRotation () |
Gets the current rotation of the object. | |
void | SetPosition (const Vector3D &position) |
Sets the position of the object. | |
Vector3D | GetPosition () |
Gets the position of the object. | |
void | SetScale (const Vector3D &scale) |
Sets the scale of the object. | |
Vector3D | GetScale () |
Gets the scale of the object. | |
void | SetScaleRotationOffset (const Quaternion &scaleRotationOffset) |
Sets the scale rotation offset of the object. | |
Quaternion | GetScaleRotationOffset () |
Gets the scale rotation offset of the object. | |
void | SetRotationOffset (const Vector3D &rotationOffset) |
Sets the rotation offset of the object. | |
Vector3D | GetRotationOffset () |
Gets the rotation offset of the object. | |
void | SetScaleOffset (const Vector3D &scaleOffset) |
Sets the scale offset of the object. | |
Vector3D | GetScaleOffset () |
Gets the scale offset of the object. | |
void | Rotate (const Vector3D &eulerXYZS) |
Rotates the object by the given Euler angles. | |
void | Rotate (const Quaternion &rotation) |
Rotates the object by the given quaternion. | |
void | Translate (const Vector3D &offset) |
Translates the object by the given offset. | |
void | Scale (const Vector3D &scale) |
Scales the object by the given scale factors. | |
String | ToString () |
Converts the transform to a string representation. | |
Private Attributes | |
Quaternion | baseRotation |
The base rotation of the object as a quaternion. | |
Quaternion | rotation |
The current rotation of the object as a quaternion. | |
Vector3D | position |
The position of the object in 3D space. | |
Vector3D | scale |
The scale of the object in 3D space. | |
Quaternion | scaleRotationOffset |
Offset for scaling transformations relative to rotation. | |
Vector3D | scaleOffset |
Offset applied to the scale. | |
Vector3D | rotationOffset |
Offset applied to the rotation. | |
Represents a 3D transformation including position, rotation, and scale.
Definition at line 22 of file Transform.h.
Transform | ( | ) |
Default constructor.
Definition at line 4 of file Transform.cpp.
Constructor initializing with Euler angles, position, and scale.
eulerXYZS | The rotation in XYZ static Euler angles. |
position | The position vector. |
scale | The scale vector. |
Definition at line 7 of file Transform.cpp.
References EulerConstants::EulerOrderXYZS, Rotation::GetQuaternion(), position, rotation, and scale.
Constructor initializing with rotation, position, and scale.
rotation | The rotation as a quaternion. |
position | The position vector. |
scale | The scale vector. |
Definition at line 13 of file Transform.cpp.
Transform | ( | const Vector3D & | eulerXYZS, |
const Vector3D & | position, | ||
const Vector3D & | scale, | ||
const Vector3D & | rotationOffset, | ||
const Vector3D & | scaleOffset | ||
) |
Constructor initializing with additional rotation and scale offsets.
eulerXYZS | The rotation in XYZ static Euler angles. |
position | The position vector. |
scale | The scale vector. |
rotationOffset | Offset for the rotation. |
scaleOffset | Offset for the scale. |
Definition at line 19 of file Transform.cpp.
References EulerConstants::EulerOrderXYZS, Rotation::GetQuaternion(), position, rotation, rotationOffset, scale, and scaleOffset.
Transform | ( | const Quaternion & | rotation, |
const Vector3D & | position, | ||
const Vector3D & | scale, | ||
const Vector3D & | rotationOffset, | ||
const Vector3D & | scaleOffset | ||
) |
Constructor initializing with rotation and offsets.
rotation | The rotation as a quaternion. |
position | The position vector. |
scale | The scale vector. |
rotationOffset | Offset for the rotation. |
scaleOffset | Offset for the scale. |
Definition at line 27 of file Transform.cpp.
References position, rotation, rotationOffset, scale, and scaleOffset.
Copy constructor.
transform | The transform to copy. |
Definition at line 35 of file Transform.cpp.
References baseRotation, position, rotation, rotationOffset, scale, scaleOffset, and scaleRotationOffset.
Quaternion GetBaseRotation | ( | ) |
Gets the base rotation of the object.
Definition at line 49 of file Transform.cpp.
References baseRotation.
Vector3D GetPosition | ( | ) |
Gets the position of the object.
Definition at line 69 of file Transform.cpp.
References position.
Referenced by Rasterizer::Rasterize(), Triangle2D::Triangle2D(), DrGonzoProject::Update(), PhysicsSimulator::Update(), and Object3D::UpdateTransform().
Quaternion GetRotation | ( | ) |
Gets the current rotation of the object.
Definition at line 61 of file Transform.cpp.
References baseRotation, and rotation.
Referenced by Rasterizer::Rasterize(), Triangle2D::Triangle2D(), and Object3D::UpdateTransform().
Vector3D GetRotationOffset | ( | ) |
Gets the rotation offset of the object.
Definition at line 93 of file Transform.cpp.
References rotationOffset.
Referenced by Object3D::UpdateTransform().
Vector3D GetScale | ( | ) |
Gets the scale of the object.
Definition at line 77 of file Transform.cpp.
References scale.
Referenced by Triangle2D::Triangle2D(), and Object3D::UpdateTransform().
Vector3D GetScaleOffset | ( | ) |
Gets the scale offset of the object.
Definition at line 101 of file Transform.cpp.
References scaleOffset.
Referenced by Object3D::UpdateTransform().
Quaternion GetScaleRotationOffset | ( | ) |
Gets the scale rotation offset of the object.
Definition at line 85 of file Transform.cpp.
References scaleRotationOffset.
void Rotate | ( | const Quaternion & | rotation | ) |
Rotates the object by the given quaternion.
rotation | The rotation as a quaternion. |
Definition at line 109 of file Transform.cpp.
References rotation.
Rotates the object by the given Euler angles.
eulerXYZS | The rotation in XYZ static Euler angles. |
Definition at line 105 of file Transform.cpp.
References EulerConstants::EulerOrderXYZS, Rotation::GetQuaternion(), and rotation.
Scales the object by the given scale factors.
scale | The scale factors as a vector. |
Definition at line 117 of file Transform.cpp.
References scale.
void SetBaseRotation | ( | const Quaternion & | baseRotation | ) |
Sets the base rotation of the object.
baseRotation | The base rotation as a quaternion. |
Definition at line 45 of file Transform.cpp.
References baseRotation.
Referenced by Rasterizer::Rasterize().
Sets the position of the object.
position | The position vector. |
Definition at line 65 of file Transform.cpp.
References position.
Referenced by ObjectAlign::GetTransform(), BoundaryMotionSimulator::Update(), and DrGonzoProject::Update().
void SetRotation | ( | const Quaternion & | rotation | ) |
Sets the current rotation of the object.
rotation | The rotation as a quaternion. |
Definition at line 53 of file Transform.cpp.
References rotation.
Referenced by ObjectAlign::GetTransform().
Sets the current rotation of the object using Euler angles.
eulerXYZS | The rotation in XYZ static Euler angles. |
Definition at line 57 of file Transform.cpp.
References EulerConstants::EulerOrderXYZS, Rotation::GetQuaternion(), and rotation.
Sets the rotation offset of the object.
rotationOffset | The rotation offset vector. |
Definition at line 89 of file Transform.cpp.
References rotationOffset.
Referenced by ObjectAlign::GetTransform().
Sets the scale of the object.
scale | The scale vector. |
Definition at line 73 of file Transform.cpp.
References scale.
Referenced by ObjectAlign::GetTransform(), and PhysicsSimulator::Update().
Sets the scale offset of the object.
scaleOffset | The scale offset vector. |
Definition at line 97 of file Transform.cpp.
References scaleOffset.
void SetScaleRotationOffset | ( | const Quaternion & | scaleRotationOffset | ) |
Sets the scale rotation offset of the object.
scaleRotationOffset | The scale rotation offset as a quaternion. |
Definition at line 81 of file Transform.cpp.
References scaleRotationOffset.
String ToString | ( | ) |
Converts the transform to a string representation.
Definition at line 121 of file Transform.cpp.
References EulerAngles::Angles, EulerConstants::EulerOrderXYZS, Rotation::GetEulerAngles(), position, rotation, scale, and Vector3D::ToString().
Translates the object by the given offset.
offset | The translation offset vector. |
Definition at line 113 of file Transform.cpp.
References position.
|
private |
The base rotation of the object as a quaternion.
Definition at line 24 of file Transform.h.
Referenced by GetBaseRotation(), GetRotation(), SetBaseRotation(), and Transform().
|
private |
The position of the object in 3D space.
Definition at line 26 of file Transform.h.
Referenced by GetPosition(), SetPosition(), ToString(), Transform(), Transform(), Transform(), Transform(), Transform(), and Translate().
|
private |
The current rotation of the object as a quaternion.
Definition at line 25 of file Transform.h.
Referenced by GetRotation(), Rotate(), Rotate(), SetRotation(), SetRotation(), ToString(), Transform(), Transform(), Transform(), Transform(), and Transform().
|
private |
Offset applied to the rotation.
Definition at line 31 of file Transform.h.
Referenced by GetRotationOffset(), SetRotationOffset(), Transform(), Transform(), and Transform().
|
private |
The scale of the object in 3D space.
Definition at line 27 of file Transform.h.
Referenced by GetScale(), Scale(), SetScale(), ToString(), Transform(), Transform(), Transform(), Transform(), and Transform().
|
private |
Offset applied to the scale.
Definition at line 30 of file Transform.h.
Referenced by GetScaleOffset(), SetScaleOffset(), Transform(), Transform(), and Transform().
|
private |
Offset for scaling transformations relative to rotation.
Definition at line 28 of file Transform.h.
Referenced by GetScaleRotationOffset(), SetScaleRotationOffset(), and Transform().