Added Mtx_Diagonal().
This commit is contained in:
parent
b32275ee94
commit
1a76a7adf1
@ -495,6 +495,16 @@ void Mtx_LookAt(C3D_Mtx* out, C3D_FVec cameraPosition, C3D_FVec cameraTarget, C3
|
||||
*@param[in,out] out Output matrix.
|
||||
*/
|
||||
void Mtx_Transpose(C3D_Mtx* out);
|
||||
|
||||
/**
|
||||
* @brief Creates a matrix with the diagonal using the given parameters.
|
||||
* @param[out] out Output matrix.
|
||||
* @param[in] x The X component.
|
||||
* @param[in] y The Y component.
|
||||
* @param[in] z The Z component.
|
||||
* @param[in] w The W component.
|
||||
*/
|
||||
void Mtx_Diagonal(C3D_Mtx* out, float x, float y, float z, float w);
|
||||
///@}
|
||||
|
||||
///@name Quaternion Math
|
||||
|
10
source/maths/mtx_diagonal.c
Normal file
10
source/maths/mtx_diagonal.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include <c3d/maths.h>
|
||||
|
||||
void Mtx_Diagonal(C3D_Mtx* out, float x, float y, float z, float w)
|
||||
{
|
||||
Mtx_Identity(out);
|
||||
FVec4_Scale(out->r[0], x);
|
||||
FVec4_Scale(out->r[1], y);
|
||||
FVec4_Scale(out->r[2], z);
|
||||
FVec4_Scale(out->r[3], w);
|
||||
}
|
Loading…
Reference in New Issue
Block a user