[Include] [INC]Trajectory - V 0.1 || By ~Cueball~
#13

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
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...
I hope you realize you've made people think that this is a recent addition to the forum! Haha! Flawless bump indeed.

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);
}
Hopefully I've helped some!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)