diff options
author | nathansmithsmith <nathansmith7@mailfence.com> | 2023-07-31 19:36:10 -0600 |
---|---|---|
committer | nathansmithsmith <nathansmith7@mailfence.com> | 2023-07-31 19:36:10 -0600 |
commit | 0a720a2259aa7b10475854964ebf74900456d229 (patch) | |
tree | fd34b35e49f1d27c1da873b7fa68d6b24104d04d /src/entity.c | |
parent | fc6e0037a2f0769fdbd4c18bd96f49d55f630757 (diff) |
Sergente stuff working
Diffstat (limited to 'src/entity.c')
-rw-r--r-- | src/entity.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/entity.c b/src/entity.c index fa610d0..4136463 100644 --- a/src/entity.c +++ b/src/entity.c @@ -460,10 +460,12 @@ void entityFlyToPoint(Entity * entity, Vector3 point, EntityFlyToPointInfo * inf Quaternion rotation = QuaternionInvert(QuaternionFromMatrix(matrix)); // Rotate this fucker. - if (info->rotationSpeed == 0.0) - entity->rotation = rotation; - else - entity->rotation = QuaternionSlerp(entity->rotation, rotation, t * info->rotationSpeed); + if (info->applyRotation) { + if (info->rotationSpeed == 0.0) + entity->rotation = rotation; + else + entity->rotation = QuaternionSlerp(entity->rotation, rotation, t * info->rotationSpeed); + } // Velocity control. float speed = 0.0; @@ -485,7 +487,12 @@ void entityFlyToPoint(Entity * entity, Vector3 point, EntityFlyToPointInfo * inf break; } - Matrix m = QuaternionToMatrix(QuaternionInvert(entity->rotation)); + Matrix m; + + if (info->applyRotation) + m = QuaternionToMatrix(QuaternionInvert(entity->rotation)); + else + m = matrix; // Accelerate. if (entity->useAcceleration) |