aboutsummaryrefslogtreecommitdiff
path: root/src/entity.c
diff options
context:
space:
mode:
authornathansmithsmith <nathansmith7@mailfence.com>2023-07-31 19:36:10 -0600
committernathansmithsmith <nathansmith7@mailfence.com>2023-07-31 19:36:10 -0600
commit0a720a2259aa7b10475854964ebf74900456d229 (patch)
treefd34b35e49f1d27c1da873b7fa68d6b24104d04d /src/entity.c
parentfc6e0037a2f0769fdbd4c18bd96f49d55f630757 (diff)
Sergente stuff working
Diffstat (limited to 'src/entity.c')
-rw-r--r--src/entity.c17
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)