|
Defines |
| #define | XF_Cos(angle) XF_SIN[((angle) + 128)&511] |
| | Returns the Cos value for an angle. The value goes from -256 to 256... Watch out though : the angle is not in 360 degrees, but in 512 !
|
| #define | XF_Sin(angle) XF_SIN[((angle))&511] |
| | Returns the Sin value for an angle. The value goes from -256 to 256... Watch out though : the angle is not in 360 degrees, but in 256 !
|
Functions |
| u16 | XF_AdjustAngle (u16 angle, s16 anglerot, s32 startx, s32 starty, s32 targetx, s32 targety) |
| | Adjust an angle, for example to calculate in which direction an object shoudl turn Base angle, from 0 to 511 For how much to turn... Initial X position Initial Y position Target X position Target Y position.
|
| u16 | XF_GetAngle (s32 startx, s32 starty, s32 targetx, s32 targety) |
| | Get the angle, from 0 to 511, formed between the horizontal and the line Initial X position Initial Y position Target X position Target Y position.
|
| s64 | XF_Distance (s32 x1, s32 y1, s32 x2, s32 y2) |
| | Calculate the distance (squared) between 2 points X coordinate of the fist point Y coordinate of the first point X coordinate of the second point Y coordinate of the second point.
|