diff options
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) |