05.04.2012, 04:53
(
Последний раз редактировалось Tannz0rz; 05.04.2012 в 05:25.
)
Quote:
Hey, I just decided to use this again (I did a while ago but didn't understand trajectory enough)
Now I'm back with more knowledge! But, I can't seem to find the rotation angle? I'm assuming 'angle' is the angle of elevation, but I can't see where I input the angle of rotation in your example. If there is none, then how can I change the direction of my flight path? Say I want to set an array of paths in the direction 46 degrees from north, angled 60 degrees in the air and a heading velocity of 15 m/s and to land at a base of -5.0... |
Anyways, I've not given much look into the matter but I'm fairly certain you'd need something along the lines of:
pawn Код:
const NUM_ELEMENTS = 30; // This can be any arbitrary number, it merely represents the number of "steps" into the trajectory. For a smoother transition, a larger number of steps is ideal.
new data[NUM_ELEMENTS][FLIGHT_DATA];
GetFlightData(-5.0, 15.0, 60.0, data);
for(new i = 0; i < sizeof(data); ++i)
{
CreateObject(1337, x + (data[i][FLIGHT_DISTANCE] * floatsin(-46.0, degrees)), y + (data[i][FLIGHT_DISTANCE] * floatcos(-46.0, degrees)), z + data[i][FLIGHT_HEIGHT], 0.0, 0.0, 0.0);
}