Modders only

This commit is contained in:
intns 2024-05-04 20:48:13 +01:00
parent 9b47fb01c9
commit 9c9d194670
3 changed files with 27 additions and 6 deletions

View File

@ -3,9 +3,10 @@
// TODO: These should probably go into a precompiled header or build flags or
// something.
#define LOCALIZED true
#define MATCHING true
#define BUGFIX false
#define LOCALIZED true
#define MATCHING true
#define BUGFIX false
#define FOR_MODDING false
#define USADEMO1 1
#define USAFINAL 2

View File

@ -109,8 +109,8 @@ struct Quat {
/**
* @brief Sets the quaternion to represent a rotation around an axis.
* @param axis The axis of rotation.
* @param angle The angle of rotation.
* @note Inline, and is currently a stub.
* @param angle The angle of rotation, in degrees
* @note Inline, and is currently a stub for match (not for modding).
*/
void setAxisRotation(Vector3f& axis, f32 angle);

View File

@ -453,9 +453,29 @@ Quat::Quat()
* @note Address: N/A
* @note Size: 0xC4
*/
void Quat::setAxisRotation(Vector3f&, f32)
void Quat::setAxisRotation(Vector3f& axis, f32 angle)
{
// UNUSED/INLINED
// NOTE: This is NOT TO MATCH ANYTHING, this is a LOGICAL EQUIVALENT to what it SHOULD BE!
// FOR MODDERS ONLY!
#ifdef FOR_MODDING
// Normalize the axis
axis.normalise();
// Convert the angle from degrees to radians
f32 radianAngle = angle * (PI / 180.0f);
// Calculate the sin and cos of half the angle
f32 sinHalfAngle = sin(radianAngle / 2.0f);
f32 cosHalfAngle = cos(radianAngle / 2.0f);
// Set the quaternion to represent the rotation
v.x = axis.x * sinHalfAngle;
v.y = axis.y * sinHalfAngle;
v.z = axis.z * sinHalfAngle;
w = cosHalfAngle;
#endif
}
/**