Isle
Loading...
Searching...
No Matches
realtime.cpp
Go to the documentation of this file.
1#include "realtime.h"
2
3#include <vec.h>
4
5// FUNCTION: LEGO1 0x100a5b40
6// FUNCTION: BETA10 0x10168127
7void CalcLocalTransform(const Vector3& p_posVec, const Vector3& p_dirVec, const Vector3& p_upVec, Matrix4& p_outMatrix)
8{
9 float x_axis[3], y_axis[3], z_axis[3];
10
11 NORMVEC3(z_axis, p_dirVec);
12 NORMVEC3(y_axis, p_upVec)
13 VXV3(x_axis, y_axis, z_axis);
14 NORMVEC3(x_axis, x_axis);
15 VXV3(y_axis, z_axis, x_axis);
16 NORMVEC3(y_axis, y_axis);
17 SET4from3(p_outMatrix[0], x_axis, 0);
18 SET4from3(p_outMatrix[1], y_axis, 0);
19 SET4from3(p_outMatrix[2], z_axis, 0);
20 SET4from3(p_outMatrix[3], p_posVec, 1);
21}
4x4 Matrix class with virtual interface for manipulation and transformation.
Definition: matrix.h:24
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
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.
Definition: realtime.cpp:7
#define NORMVEC3(dst, src)
[AI] Normalizes the given 3D vector, storing the result in the destination (dst) array.
Definition: realtime.h:9
#define VXV3(to, v1, v2)
Definition: vec.h:498
#define SET4from3(to, from, pad)
Definition: vec.h:782