PR #553 adds LevelLocals.SphericalCoords, a method that computes spherical coordinates from one point in the world to another.
This can be trivially wrapped to create a PitchTo method,
as was requested back in March:
Code: Select all
extend class Actor
{
clearscope double PitchTo(Actor other) const
{
Vector3 sphericalCoords = LevelLocals.SphericalCoords(Pos, other.Pos);
return sphericalCoords.Y;
}
}
I could also add PitchTo and SphericalCoordsTo methods to the Actor class, but
as discussed, I'm leaving non-static Actor methods alone for now, pending the completion of the client-server branch. LevelLocals.SphericalCoords operates on world coordinates and doesn't look at actors at all, so it should be safe.