45 lines
585 B
Odin
45 lines
585 B
Odin
package ecs
|
|
|
|
import sg "../sokol/gfx"
|
|
|
|
Mat4 :: matrix[4, 4]f32
|
|
|
|
Vec2 :: [2]f32
|
|
Vec3 :: [3]f32
|
|
Vec4 :: [4]f32
|
|
|
|
Gravity :: struct {
|
|
force: Vec3
|
|
}
|
|
|
|
RigidBody :: struct {
|
|
velocity: Vec3,
|
|
acceleration: Vec3,
|
|
}
|
|
|
|
Transform :: struct {
|
|
position: Vec3,
|
|
rotation: Vec3,
|
|
scale: Vec3,
|
|
}
|
|
|
|
Color :: struct {
|
|
color: Vec4,
|
|
}
|
|
|
|
Mesh :: struct {
|
|
vertex_buffer: sg.Buffer,
|
|
index_buffer: sg.Buffer,
|
|
}
|
|
|
|
Material :: struct {
|
|
shader: sg.Shader,
|
|
image: sg.Image,
|
|
sampler: sg.Sampler,
|
|
}
|
|
|
|
Camera :: struct {
|
|
position: Vec3,
|
|
target: Vec3,
|
|
look: Vec2
|
|
}
|