theonn
Member
- Joined
- Nov 3, 2014
- Messages
- 80
- Reaction score
- 6
Hello Fellow Devs / Out,
I have been working on a radar, however the rotation for entities is still kind of... crazy
the code im using:
any ideas?
I have been working on a radar, however the rotation for entities is still kind of... crazy
the code im using:
PHP:
double radians = memory.angle(player, x, y);
radians = -(radians / 180.0 * Math.PI);
public static ILocation2D RotateAroundOrigin2D(double x, double y, double radians)
{
double dx = x * (double)Math.Cos(radians) - y * (double)Math.Sin(radians);
double dy = y * (double)Math.Cos(radians) + x * (double)Math.Sin(radians);
return new Location(dx, dy, 0);
}
any ideas?