2023-10-24 08:27:24 -04:00
|
|
|
#include "realtime.h"
|
|
|
|
|
2024-01-12 19:34:38 -05:00
|
|
|
#include <vec.h>
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x100a5b40
|
2024-01-12 19:34:38 -05:00
|
|
|
void CalcLocalTransform(const Vector3& p_posVec, const Vector3& p_dirVec, const Vector3& p_upVec, Matrix4& p_outMatrix)
|
2023-10-24 08:27:24 -04:00
|
|
|
{
|
2023-11-19 09:38:07 -05:00
|
|
|
float x_axis[3], y_axis[3], z_axis[3];
|
2023-10-24 19:38:27 -04:00
|
|
|
|
2024-01-12 19:34:38 -05:00
|
|
|
NORMVEC3(z_axis, p_dirVec);
|
2023-10-24 19:38:27 -04:00
|
|
|
NORMVEC3(y_axis, p_upVec)
|
|
|
|
VXV3(x_axis, y_axis, z_axis);
|
2024-01-12 19:34:38 -05:00
|
|
|
NORMVEC3(x_axis, x_axis);
|
2023-10-24 19:38:27 -04:00
|
|
|
VXV3(y_axis, z_axis, x_axis);
|
2024-01-12 19:34:38 -05:00
|
|
|
NORMVEC3(y_axis, y_axis);
|
|
|
|
SET4from3(p_outMatrix[0], x_axis, 0);
|
|
|
|
SET4from3(p_outMatrix[1], y_axis, 0);
|
|
|
|
SET4from3(p_outMatrix[2], z_axis, 0);
|
|
|
|
SET4from3(p_outMatrix[3], p_posVec, 1);
|
2023-10-24 08:27:24 -04:00
|
|
|
}
|