Skip to content

Commit

Permalink
fixed/completed random_math implementation, math functions updates
Browse files Browse the repository at this point in the history
removed return values, most of these matrix math functions do not return anything, fixed random math implementation
TODO check assembly
  • Loading branch information
nukeulater committed Dec 27, 2023
1 parent 93b965c commit 7f57e91
Show file tree
Hide file tree
Showing 9 changed files with 1,087 additions and 1,066 deletions.
5 changes: 2 additions & 3 deletions xlive/Blam/Engine/math/matrix_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ real_vector3d* matrix4x3_transform_vector(const real_matrix4x3* matrix, const re
return out;
}

real_matrix4x3* matrix4x3_rotation_from_angles(real_matrix4x3* matrix, real32 i, real32 j, real32 k)
void matrix4x3_rotation_from_angles(real_matrix4x3* matrix, real32 i, real32 j, real32 k)
{
matrix->scale = 1.0f;

Expand All @@ -152,10 +152,9 @@ real_matrix4x3* matrix4x3_rotation_from_angles(real_matrix4x3* matrix, real32 i,
matrix->position.x = 0.0f;
matrix->position.y = 0.0f;
matrix->position.z = 0.0f;
return matrix;
}

real_matrix4x3* __cdecl matrix4x3_rotation_from_axis_and_angle(real_matrix4x3* matrix, real_vector3d* vector, real32 axis, real32 angle)
void __cdecl matrix4x3_rotation_from_axis_and_angle(real_matrix4x3* matrix, real_vector3d* vector, real32 axis, real32 angle)
{
return INVOKE(0x775C1, 0x751B7, matrix4x3_rotation_from_axis_and_angle, matrix, vector, axis, angle);
}
Expand Down
4 changes: 2 additions & 2 deletions xlive/Blam/Engine/math/matrix_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ real_point3d* matrix4x3_transform_point(const real_matrix4x3* matrix, const real

real_vector3d* matrix4x3_transform_vector(const real_matrix4x3* matrix, const real_vector3d* in, real_vector3d* out);

real_matrix4x3* matrix4x3_rotation_from_angles(real_matrix4x3* matrix, real32 i, real32 j, real32 k);
void matrix4x3_rotation_from_angles(real_matrix4x3* matrix, real32 i, real32 j, real32 k);

real_matrix4x3* __cdecl matrix4x3_rotation_from_axis_and_angle(real_matrix4x3* matrix, real_vector3d* vector, real32 axis, real32 angle);
void __cdecl matrix4x3_rotation_from_axis_and_angle(real_matrix4x3* matrix, real_vector3d* vector, real32 axis, real32 angle);

void matrix4x3_interpolate(const real_matrix4x3* previous, const real_matrix4x3* target, real32 fractional_ticks, real_matrix4x3* out_mat);

Expand Down
Loading

0 comments on commit 7f57e91

Please sign in to comment.