Isle
Loading...
Searching...
No Matches
realtime.cpp File Reference
#include "realtime.h"
#include <vec.h>
Include dependency graph for realtime.cpp:

Go to the source code of this file.

Functions

void CalcLocalTransform (const Vector3 &p_posVec, const Vector3 &p_dirVec, const Vector3 &p_upVec, Matrix4 &p_outMatrix)
 [AI] Computes a transformation matrix based on a position, direction, and up vector. More...
 

Function Documentation

◆ CalcLocalTransform()

void CalcLocalTransform ( const Vector3 p_posVec,
const Vector3 p_dirVec,
const Vector3 p_upVec,
Matrix4 p_outMatrix 
)

[AI] Computes a transformation matrix based on a position, direction, and up vector.

[AI]

Parameters
p_posVecWorld position vector (translation) to use for transformation. [AI]
p_dirVecWorld direction vector (Z axis of the matrix). This will be normalized. [AI]
p_upVecWorld up vector (Y axis of the matrix). This will be normalized and orthogonalized. [AI]
p_outMatrixOutput parameter to receive the resulting 4x4 transformation matrix, built from the supplied vectors. [AI]

[AI] The resulting matrix is suitable for orienting/repositioning an object in 3D space: the direction is used for the forward axis, up for vertical axis, and the function ensures all axes are orthogonal and normalized. [AI]

Definition at line 7 of file realtime.cpp.