![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Manages camera orientation and axis alignment. More...
#include <CameraLayout.h>
Public Types | |
enum | ForwardAxis { XForward , YForward , ZForward , XNForward , YNForward , ZNForward } |
Defines possible forward axes for the camera. More... | |
enum | UpAxis { XUp , YUp , ZUp , XNUp , YNUp , ZNUp } |
Defines possible up axes for the camera. More... | |
Public Member Functions | |
CameraLayout (ForwardAxis forwardAxis, UpAxis upAxis) | |
Constructs a CameraLayout with specified forward and up axes. | |
ForwardAxis | GetForwardAxis () |
Retrieves the camera's forward axis. | |
UpAxis | GetUpAxis () |
Retrieves the camera's up axis. | |
Vector3D | GetForwardVector () |
Retrieves the camera's forward vector. | |
Vector3D | GetUpVector () |
Retrieves the camera's up vector. | |
Quaternion | GetRotation () |
Retrieves the camera's rotation. | |
Private Member Functions | |
bool | VerifyTransform () |
Verifies the validity of the camera's transformation. | |
void | CalculateTransform () |
Calculates the camera's transformation based on its axes. | |
Private Attributes | |
Quaternion | rotation |
Rotation representing the camera's orientation. | |
ForwardAxis | forwardAxis |
The camera's forward axis. | |
UpAxis | upAxis |
The camera's up axis. | |
Manages camera orientation and axis alignment.
The CameraLayout class defines the camera's orientation using forward and up axes. It provides methods for retrieving orientation vectors and rotation information.
Definition at line 23 of file CameraLayout.h.
Defines possible forward axes for the camera.
Definition at line 29 of file CameraLayout.h.
Defines possible up axes for the camera.
Definition at line 42 of file CameraLayout.h.
CameraLayout | ( | ForwardAxis | forwardAxis, |
UpAxis | upAxis | ||
) |
Constructs a CameraLayout with specified forward and up axes.
forwardAxis | The forward axis of the camera. |
upAxis | The up axis of the camera. |
Definition at line 3 of file CameraLayout.cpp.
References CalculateTransform(), forwardAxis, and upAxis.
|
private |
Calculates the camera's transformation based on its axes.
Definition at line 20 of file CameraLayout.cpp.
References Vector3D::CrossProduct(), GetForwardVector(), Rotation::GetQuaternion(), GetUpVector(), rotation, Quaternion::UnitQuaternion(), and VerifyTransform().
Referenced by CameraLayout().
CameraLayout::ForwardAxis GetForwardAxis | ( | ) |
Retrieves the camera's forward axis.
Definition at line 33 of file CameraLayout.cpp.
References forwardAxis.
Vector3D GetForwardVector | ( | ) |
Retrieves the camera's forward vector.
Definition at line 41 of file CameraLayout.cpp.
References forwardAxis, Vector3D::X, XForward, XNForward, Vector3D::Y, YForward, YNForward, Vector3D::Z, and ZNForward.
Referenced by CalculateTransform().
Quaternion GetRotation | ( | ) |
Retrieves the camera's rotation.
Definition at line 71 of file CameraLayout.cpp.
References rotation.
Referenced by Rasterizer::Rasterize().
CameraLayout::UpAxis GetUpAxis | ( | ) |
Retrieves the camera's up axis.
Definition at line 37 of file CameraLayout.cpp.
References upAxis.
Vector3D GetUpVector | ( | ) |
Retrieves the camera's up vector.
Definition at line 56 of file CameraLayout.cpp.
References upAxis, Vector3D::X, XNUp, XUp, Vector3D::Y, YNUp, Vector3D::Z, ZNUp, and ZUp.
Referenced by CalculateTransform().
|
private |
Verifies the validity of the camera's transformation.
Definition at line 10 of file CameraLayout.cpp.
References forwardAxis, upAxis, XForward, XNForward, XNUp, XUp, YForward, YNForward, YNUp, YUp, ZNUp, and ZUp.
Referenced by CalculateTransform().
|
private |
The camera's forward axis.
Definition at line 53 of file CameraLayout.h.
Referenced by CameraLayout(), GetForwardAxis(), GetForwardVector(), and VerifyTransform().
|
private |
Rotation representing the camera's orientation.
Definition at line 52 of file CameraLayout.h.
Referenced by CalculateTransform(), and GetRotation().
|
private |
The camera's up axis.
Definition at line 54 of file CameraLayout.h.
Referenced by CameraLayout(), GetUpAxis(), GetUpVector(), and VerifyTransform().