Start refactor, restructure basic
This commit is contained in:
59
src/basic/basic_math.h
Normal file
59
src/basic/basic_math.h
Normal file
@@ -0,0 +1,59 @@
|
||||
#pragma once
|
||||
|
||||
struct Vec2 {
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
union Vec4 {
|
||||
struct {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float w;
|
||||
};
|
||||
struct {
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
float a;
|
||||
};
|
||||
};
|
||||
|
||||
union Vec3 {
|
||||
struct {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
struct {
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
};
|
||||
};
|
||||
|
||||
struct Rect2 {
|
||||
Vec2 min;
|
||||
Vec2 max;
|
||||
};
|
||||
|
||||
struct Vec2I {
|
||||
Int x;
|
||||
Int y;
|
||||
};
|
||||
|
||||
struct Rect2I {
|
||||
Vec2I min;
|
||||
Vec2I max;
|
||||
};
|
||||
|
||||
union Color {
|
||||
struct {
|
||||
uint8_t r;
|
||||
uint8_t g;
|
||||
uint8_t b;
|
||||
uint8_t a;
|
||||
};
|
||||
uint32_t value;
|
||||
};
|
||||
Reference in New Issue
Block a user