mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-03 00:18:30 +00:00
WARNING: REVIEWED: Follow a set of conventions
CONVENTIONS: - Functions are always self-contained, no function use another raymath function inside, required code is directly re-implemented inside - Functions input parameters are always received by value - Functions use always a "result" variable for return - Functions are always defined inline - Angles are always in radians (DEG2RAD/RAD2DEG macros provided for convenience)
This commit is contained in:
@@ -69,9 +69,6 @@ int main(void)
|
|||||||
m3 = QuaternionToMatrix(q1);
|
m3 = QuaternionToMatrix(q1);
|
||||||
|
|
||||||
v2 = QuaternionToEuler(q1);
|
v2 = QuaternionToEuler(q1);
|
||||||
v2.x *= DEG2RAD;
|
|
||||||
v2.y *= DEG2RAD;
|
|
||||||
v2.z *= DEG2RAD;
|
|
||||||
|
|
||||||
m4 = MatrixRotateZYX(v2);
|
m4 = MatrixRotateZYX(v2);
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
@@ -53,7 +53,7 @@ int main(void)
|
|||||||
|
|
||||||
Texture texture = LoadTexture("resources/cat.png");
|
Texture texture = LoadTexture("resources/cat.png");
|
||||||
|
|
||||||
float ang = 0;
|
float angle = 0.0f;
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
@@ -63,11 +63,11 @@ int main(void)
|
|||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
ang++;
|
angle++;
|
||||||
|
|
||||||
Vector2 positions[MAX_POINTS] = { 0 };
|
Vector2 positions[MAX_POINTS] = { 0 };
|
||||||
|
|
||||||
for (int i = 0; i < MAX_POINTS; i++) positions[i] = Vector2Rotate(points[i], ang);
|
for (int i = 0; i < MAX_POINTS; i++) positions[i] = Vector2Rotate(points[i], angle*DEG2RAD);
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
|
568
src/raymath.h
568
src/raymath.h
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user