fix error in Vec2F32 structure, it should be a union not a struct.

This commit is contained in:
Tijani Lawal 2024-09-01 14:14:59 -05:00
parent 4bcaac6c43
commit b3c40d60a3

View File

@ -1,7 +1,7 @@
#ifndef BASE_MATH_H #ifndef BASE_MATH_H
#define BASE_MATH_H #define BASE_MATH_H
typedef struct Vec2F32 Vec2F32; typedef union Vec2F32 Vec2F32;
union Vec2F32 { union Vec2F32 {
struct { struct {
f32 x; f32 x;
@ -10,14 +10,14 @@ union Vec2F32 {
f32 v[2]; f32 v[2];
}; };
typedef struct Vec3F32 Vec3F32; typedef union Vec3F32 Vec3F32;
union Vec3F32 { union Vec3F32 {
struct { struct {
f32 x; f32 x;
f32 y; f32 y;
f32 z; f32 z;
}; };
f32 v[2]; f32 v[3];
}; };
Vec3F32 vec3f32_rotate_x(Vec3F32 vector, float angle); Vec3F32 vec3f32_rotate_x(Vec3F32 vector, float angle);