Jump to content

Relative angles?


Yazir

Recommended Posts

When you set -x, then it always spin you north. It can push you sideways, front or back. It isn't relative to word.

Oh you want to set the rotation relative to the word? Why didn't you state that in the first place.

Get the rotation

then subtract the rotation you want to set from the actual Z-rotation

Spin = ("spinyouwant"-zrotation) 
  

Then use that value, it will rotate the vehicle relative to the world rotation with your set amount.

-- Might be a bit more then that, I just woke up and noticed what you wanted, minds not 100% --

Link to comment

I meant world, not "word" .

Anyway, I don't think you can get me. I'll try to start from scratch.

When this:

setVehicleTurnVelocity( getPedOccupiedVehicle( localPlayer ), vx + 1, vy,vz  ) 
--*vx, vy, vz is current velocity of the car. 

is called, then if i'm heading north (up of the map), it will spin me forward, as expected, BUT if i'm heading for example east (right of the map, 90 degrees more than north),

it will spin me counter-clockwise (to left).

If i will be heading west, it will spin me clockwise (to right).

I want, to make my vehicle spin forward, not sideways.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...