swiveldemon Posted December 1, 2016 Share Posted December 1, 2016 When driving a car, I'm interested in being able to access things like roll, pitch, and yaw of the car (how much it is tilted and how much it has turned). Is this something that is possible? Any help or links to helpful resources would be much appreciated! Thanks! sd Link to comment Share on other sites More sharing options...
Jitnaught Posted December 2, 2016 Share Posted December 2, 2016 .NET: if (Game.Player.Character.IsInVehicle()){ Vector3 rotation = Game.Player.Character.CurrentVehicle.Rotation;} C++: if (PED::IS_PED_IN_ANY_VEHICLE(PLAYER::PLAYER_PED_ID() false)){ Vector3 rotation = ENTITY::GET_ENTITY_ROTATION(PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false));} Link to comment Share on other sites More sharing options...
swiveldemon Posted December 2, 2016 Author Share Posted December 2, 2016 sweet thank you! Also, do you know if there is a way to get the rotation rates? Having trouble finding it in the docs Link to comment Share on other sites More sharing options...
Jitnaught Posted December 2, 2016 Share Posted December 2, 2016 You mean like the change in rotation? Link to comment Share on other sites More sharing options...
swiveldemon Posted December 2, 2016 Author Share Posted December 2, 2016 correct. That and vehicle speed, current turning radius, etc. Is there a doc you are looking at for this? Link to comment Share on other sites More sharing options...
Jitnaught Posted December 2, 2016 Share Posted December 2, 2016 (edited) I don't think there is a native function for change in rotation. You'd have to subtract the current rotation by the last rotation. //not sure what language you're using so here's an example for C#. don't actually use the wait(1000) in a modVector3 oldRotation = Game.Player.Character.CurrentVehicle.Rotation;Wait(1000);Vector3 newRotation = Game.Player.Character.CurrentVehicle.Rotation;Vector3 changeInRotation = newRotation - rotation; Vehicle speed is: float speed = Game.Player.Character.CurrentVehicle.Speed //c#float speed = ENTIY::GET_ENTITY_SPEED(PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false)); //c++ Turning radius is (.NET only): Game.Player.Character.CurrentVehicle.SteeringAngle Only documentation I look at is the Native DB. I also look at the source code of Script Hook V .NET. Edited December 2, 2016 by Jitnaught Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now