|
Post by Karvy on Aug 29, 2016 6:29:13 GMT
I know that if I want to get a vector's cordinates with a given angle and module I have to solve this: on x axis: module*cos(x angle of the velocity vector) ; and on the y axis: module*sin(x angle). What about the Z axis? and which angle should I use (x,y,z)? I'm asking this becaus I want to get the projectile velocity in the 3 axes (I can't do it with iObjectVelocity()).
Thanks.
|
|
|
Post by WhyNot on Aug 29, 2016 16:18:59 GMT
I don't get you bro what do you mean by velocity in 3 axis? ?
|
|
|
Post by Karvy on Aug 29, 2016 18:20:13 GMT
WhyNot I mean, if you shoot a bullet it has a world-relative X velocitty, Y velocity and Z velocity.. So with a given angle and speed I want to know those values.
|
|
|
Post by TinSoldier on Aug 29, 2016 18:47:31 GMT
iObjectVelocity(OBJ_X,Vector3) Well this is a vector3 so it returns vector3(x,y,z) so
Vector3 Vel;
Vel.x , Vel.y, Vel.z should give you the velocity you need.
|
|
|
Post by WhyNot on Aug 30, 2016 2:25:18 GMT
you mean the postion or ??
|
|
|
Post by Karvy on Aug 31, 2016 6:24:08 GMT
OK dont worry guys, now I have it covered, after searching a bit more I found the solution:
If you want to know the coordinates of a vector with given module(or speed in my project) and direction: X coordinates: IvI*iFloatSin(z angle)*iFloatCos(x angle) Y coordinates: IvI*iFloatSin(x angle)*iFloatSin(z angle) Z coordinates: IvI*iFloatCos(z angle)
|
|