Jump to content

Relative angles?


Yazir

Recommended Posts

Posted

I know that function, but i'm not sure how to use it by desired needs. I don't want to set anglr, but force impulse of rotation.

Posted

After I read through it, Set Vehicle turn Velocity already has everything you need

  
        setVehicleTurnVelocity ( vehicle, -X Amount, -Y Amount, -Z Amount ) 
  

It is already relative to the vehicle.

Posted
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% --

Posted

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.

Posted

I meant to put world, just a typo, but get element rotation will work for what you need, make it so if the rotation is above a certain degree, use vy+1, if below vx+1. This may work, I have not done anything using the set rotation velocity function.

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...