Added width to trigger line rendering, abstracted PhysX away a bit
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
Entity_Id :: #type, isa s64;
|
||||
|
||||
Entity_Flags :: enum_flags u16 {
|
||||
NONE;
|
||||
RENDERABLE;
|
||||
COLLISION;
|
||||
PHYSICS;
|
||||
STATIC;
|
||||
TRIGGER;
|
||||
NONE :: 0;
|
||||
RENDERABLE :: 1;
|
||||
PHYSICS :: 2;
|
||||
|
||||
ANIMATED;
|
||||
ANIMATED :: 4;
|
||||
|
||||
SNAP_TO_GRID;
|
||||
UNIFORM_SCALE;
|
||||
SNAP_TO_GRID :: 8;
|
||||
UNIFORM_SCALE :: 16;
|
||||
|
||||
DONT_SAVE;
|
||||
DELETED;
|
||||
DONT_SAVE :: 32;
|
||||
DELETED :: 64;
|
||||
}
|
||||
|
||||
Renderable_Type :: enum {
|
||||
@@ -53,6 +50,52 @@ Renderable :: struct {
|
||||
|
||||
MAX_CHILDREN :: 16;
|
||||
|
||||
#if PHYSICS {
|
||||
Collider_Type :: enum {
|
||||
SPHERE;
|
||||
BOX;
|
||||
CAPSULE;
|
||||
}
|
||||
|
||||
Physics_Lock :: enum_flags u8 {
|
||||
LINEAR_X;
|
||||
LINEAR_Y;
|
||||
LINEAR_Z;
|
||||
ANGULAR_X;
|
||||
ANGULAR_Y;
|
||||
ANGULAR_Z;
|
||||
}
|
||||
|
||||
Physics_Body :: struct {
|
||||
enabled: bool;
|
||||
trigger: bool;
|
||||
dynamic: bool;
|
||||
velocity: Vector3;
|
||||
|
||||
static_friction: float;
|
||||
dynamic_friction: float;
|
||||
restitution: float;
|
||||
|
||||
lock: Physics_Lock;
|
||||
|
||||
type: Collider_Type;
|
||||
union {
|
||||
sphere : struct {
|
||||
radius: float;
|
||||
}
|
||||
box : struct {
|
||||
half_extent: Vector3;
|
||||
}
|
||||
capsule : struct {
|
||||
radius: float;
|
||||
half_height: float;
|
||||
}
|
||||
}
|
||||
|
||||
physx_handle: PhysX_Handle;
|
||||
}
|
||||
}
|
||||
|
||||
Entity :: struct {
|
||||
name: string;
|
||||
|
||||
@@ -79,10 +122,7 @@ Entity :: struct {
|
||||
animator: Animator; @DontSerialize
|
||||
|
||||
#if PHYSICS {
|
||||
// Physics
|
||||
physx_handle: PhysX_Handle;
|
||||
velocity: Vector3;
|
||||
// End physics
|
||||
physics: Physics_Body; @DontSerialize
|
||||
}
|
||||
|
||||
#if NETWORKING {
|
||||
|
||||
Reference in New Issue
Block a user