ecs-test/ecs/components.odin

59 lines
817 B
Odin

package ecs
import sa "../sokol/app"
import sg "../sokol/gfx"
Mat4 :: matrix[4, 4]f32
Vec2 :: [2]f32
Vec3 :: [3]f32
Vec4 :: [4]f32
GravityComponent :: struct {
force: Vec3
}
RigidBodyComponent :: struct {
velocity: Vec3,
acceleration: Vec3,
}
TransformComponent :: struct {
position: Vec3,
rotation: Vec3,
scale: Vec3,
}
ColorComponent :: struct {
color: Vec4,
}
MeshID :: enum {
CubeMesh,
}
MeshComponent :: struct {
mesh_id: MeshID
}
MaterialID :: enum {
GridTexture,
}
MaterialComponent :: struct {
material_id: MaterialID
}
CameraComponent :: struct {
position: Vec3,
target: Vec3,
look: Vec2,
look_sensitivity: f32,
movement_speed: f32,
}
InputComponent :: struct {
mouse_movement: Vec2,
key_down: #sparse[sa.Keycode]bool,
}