Posts: 1,779
Threads: 126
Joined: Oct 2010
pawn Код:
new
Float:fPX, Float:fPY, Float:fPZ,
Float:fVX, Float:fVY, Float:fVZ;
GetPlayerObjectPos(playerid, fPX, fPY, fPZ);
GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ);
//FORWARD
fPX += floatmul(fVX, fScale);
fPY += floatmul(fVY, fScale);
// I not use this fPZ += floatmul(fVZ, fScale);
//BACK
fPX -= floatmul(fVX, fScale);
fPY -= floatmul(fVY, fScale);
//RIGHT?
//LEFT?
I want to move the object forward, back, right, left depending camera vector.
Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
Basically you mean translate the movement directions based on camera vector? If that is the case you would need to do the following.
1.) Get camera facing angle
2.) Add angle your movement angle (0, 90, 180, 270)
3.) Get the position in front of that angle
Posts: 1,779
Threads: 126
Joined: Oct 2010
28.02.2015, 13:16
(
Последний раз редактировалось adri1; 28.02.2015 в 14:02.
)
Quote:
Originally Posted by Pottus
Basically you mean translate the movement directions based on camera vector?
|
Yes, i guess, my english isn't fluid
EDIT: Ok, thanks Pottus.
EDIT2:
1)Ok
2)Ok
3)3.) Get the position in front of that angle.... How?
Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
Just so there is no confusion the last step is this.
GetXYInFrontOfPoint()