mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-14 07:48:58 +00:00
GRIM: Still adjustments to GetAngleBetweenActors.
This commit is contained in:
parent
aeb2a16112
commit
b1454fe84b
@ -702,13 +702,15 @@ static void GetAngleBetweenActors() {
|
||||
|
||||
Graphics::Vector3d vec1 = actor1->puckVector();
|
||||
Graphics::Vector3d vec2 = actor2->pos();
|
||||
vec1 -= actor1->pos();
|
||||
vec2 -= actor1->pos();
|
||||
vec1.z() = 0;
|
||||
vec2.z() = 0;
|
||||
vec1.normalize();
|
||||
vec2.normalize();
|
||||
float dot = vec1.dotProduct(vec2.x(), vec2.y(), 0);
|
||||
float angle = 90.0f - (180.0f * acos(dot)) / LOCAL_PI;
|
||||
float angle = 90.0f - (180.0f * asin(dot)) / LOCAL_PI;
|
||||
if (angle < 0)
|
||||
angle = -angle;
|
||||
lua_pushnumber(angle);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user