diff options
author | Justin Berger <j.david.berger@gmail.com> | 2018-03-21 09:11:54 -0600 |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2018-03-21 09:11:54 -0600 |
commit | 8a0831f2b9e458d8f1976c27f7865166ad8de6a4 (patch) | |
tree | 028773b7a0ae042c6bb9b3cc21933a617c939b65 /src/poser.c | |
parent | 0bc3b02ff3c4f975004fb19e226c3177fa811b4e (diff) | |
download | libsurvive-8a0831f2b9e458d8f1976c27f7865166ad8de6a4.tar.gz libsurvive-8a0831f2b9e458d8f1976c27f7865166ad8de6a4.tar.bz2 |
Moved pose to linmath to support stronger typing
Diffstat (limited to 'src/poser.c')
-rw-r--r-- | src/poser.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/poser.c b/src/poser.c index 1ed63da..3fb4fe8 100644 --- a/src/poser.c +++ b/src/poser.c @@ -38,17 +38,17 @@ void PoserData_lighthouse_pose_func(PoserData *poser_data, SurviveObject *so, ui // Start by just moving from whatever arbitrary space into object space. SurvivePose arb2object; - InvertPose(arb2object.Pos, object2arb.Pos); + InvertPose(&arb2object, &object2arb); SurvivePose lighthouse2obj; - ApplyPoseToPose(lighthouse2obj.Pos, arb2object.Pos, lighthouse2arb.Pos); + ApplyPoseToPose(&lighthouse2obj, &arb2object, &lighthouse2arb); // Now find the space with the same origin, but rotated so that gravity is up SurvivePose lighthouse2objUp = {}, object2objUp = {}; quatfrom2vectors(object2objUp.Rot, so->activations.accel, up); // Calculate the pose of the lighthouse in this space - ApplyPoseToPose(lighthouse2objUp.Pos, object2objUp.Pos, lighthouse2obj.Pos); + ApplyPoseToPose(&lighthouse2objUp, &object2objUp, &lighthouse2obj); // Purposefully only set this once. It should only depend on the first (calculated) lighthouse if (quatmagnitude(objUp2world->Rot) == 0) { @@ -61,8 +61,8 @@ void PoserData_lighthouse_pose_func(PoserData *poser_data, SurviveObject *so, ui // Find find the poses that map to the above SurvivePose obj2world, lighthouse2world; - ApplyPoseToPose(obj2world.Pos, objUp2world->Pos, object2objUp.Pos); - ApplyPoseToPose(lighthouse2world.Pos, objUp2world->Pos, lighthouse2objUp.Pos); + ApplyPoseToPose(&obj2world, objUp2world, &object2objUp); + ApplyPoseToPose(&lighthouse2world, objUp2world, &lighthouse2objUp); so->ctx->lighthouseposeproc(so->ctx, lighthouse, &lighthouse2world, &obj2world); } |