techkaczynski.dev / code

summaryrefslogtreecommitdiff
path: root/physics.h
diff options
context:
space:
mode:
Diffstat (limited to 'physics.h')
-rw-r--r--physics.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/physics.h b/physics.h
index 0a92118..5a9a8d0 100644
--- a/physics.h
+++ b/physics.h
@@ -96,9 +96,9 @@ typedef struct {
/*
physics joint fields meaning changes depending on their context.
- anchor_a/axis_a are local to body_a.
- anchor_b/axis_b are local to body_b.
- axes should be normalized.
+ anchor_a/frame_rot_a define the joint frame local to body_a.
+ anchor_b/frame_rot_b define the joint frame local to body_b.
+ frame rotations are normalized quaternions.
lower/upper are generic limits
- revolute: radians
@@ -129,7 +129,8 @@ typedef struct {
Flags32 flags;
Vec3 anchor_a, anchor_b;
- Vec3 axis_a, axis_b;
+ Quaternion frame_rot_a, frame_rot_b;
+ // Vec3 axis_a, axis_b;
f32 lower, upper;
f32 spring_hz, spring_damping;
@@ -137,6 +138,7 @@ typedef struct {
} PhysicsJoint;
typedef struct {
+ u64 entity_id;
b3BodyId id;
b3ShapeId *shapes; // count is stored in PhysicsCmp
} PhysicsBodyRuntime;