SaturnRingLibrary 0.9.1
SGL wrapper
 
Loading...
Searching...
No Matches

◆ CreateLookAt()

template<Precision P = Precision::Default>
static constexpr Matrix43 SRL::Math::Types::Matrix43::CreateLookAt ( const Vector3D & eye,
const Vector3D & target,
const Vector3D & up = Vector3D::UnitY() )
inlinestaticconstexpr

Creates a look-at matrix for positioning a camera in 3D space.

This function generates a view matrix that can be used to position a camera looking at a specific target point from a given eye position, with an up vector to define the camera's vertical orientation.

Template Parameters
PThe precision level for calculations, defaulting to Standard.
Parameters
eyeThe position of the camera in world coordinates.
targetThe point in world space that the camera is looking at.
upThe up vector, which defines the camera's vertical direction (default is Vector3D::UnitY()).
Returns
A Matrix43 representing the look-at transformation.
Note
This function assumes that the up vector is not collinear with the look vector.
Vector3D(0.0, 0.0, 5.0), // Eye position
Vector3D(0.0, 0.0, 0.0), // Target position
Vector3D::UnitY() // Up vector
);
constexpr Matrix43()
Default constructor initializing to a zero matrix.
Definition mat43.hpp:85
static constexpr Matrix43 CreateLookAt(const Vector3D &eye, const Vector3D &target, const Vector3D &up=Vector3D::UnitY())
Creates a look-at matrix for positioning a camera in 3D space.
Definition mat43.hpp:431
static consteval Vector3D UnitY()
Get a unit vector pointing along the Y axis (0,1,0).
Definition vector3d.hpp:664
A high-performance three-dimensional vector implementation optimized for Saturn hardware.
Definition vector3d.hpp:51

This function is used to create a view matrix that can be used to position a camera in 3D space. The resulting matrix can be used to transform points from world space to the camera's local space.