# Tostaky42

Member

7

113 Neutral

• Rank
Newbie
1. ## Handbrake physics on a car game

Hi,   I'm working on a 2d top down car game project. I'm on the physic part and I did the physics from scratch, with no middleware physics lib. From now I've calculated the lateral forces on front/rear wheels with the slip angle (the angle between the tire's heading and its direction of travel).   To find the slip angle: I do the sum of the sideslip (arctan between velocity.y and velocity.x) , the rotation angle (arctan between angular velocity ->yaw and the velocity.x) and  the steer angle.   And finally the traction / resistance force. It works pretty well, but i want to add handbrake on my car. And i don't see exactly how to implement it, I just want a feeling fun, not realistic. Anyone have some ideas ? Thank you :)
2. ## Apply torque on angular acceleration

Okay, thank you man. I fixed my problem. Now I have a physic engine who handle lateral forces and torques.
3. ## Apply torque on angular acceleration

Thank you for that clarification,  I understand better these notions :). im sorry but i have one more question. In my case I want to have like one button for accelerate the car, and the two arrows buttons to rotate my car left and right. The car will accelerate in the direction of the head of the car. Like in MicroMachine, or other top down car game. In this case do I need to store the orientation of the car and to apply it, each frames, to the traction force ? And how do i apply it to this traction force ?
4. ## Apply torque on angular acceleration

Yes but the velocity vector is my direction vector here (its magnitude is the speed of the car). So i need to rotate it, no ? If I apply a force like Vector3(5000,0,0) it will go always on the direction of the right side of the screen, I want that this direction turn. I dont know if im enough clear, sorry for that ...
5. ## Apply torque on angular acceleration

Okay, thank you for your advices, I found the problem, the rotation is good but its not applicated to the velocity vector. Its applied to the transform matrix of my object. How can i apply the rotation to the velocity vector ? Thank you in advance
6. ## Apply torque on angular acceleration

_inverseInertiaTensorWorld.transform(_torqueAccumulate) seems to work correctly. But the value of torque is null at this moment, and the interial tensor has good value. So I think the way to find torque is not the right way. What I want to do is to apply on the front side of the car to turn it left or right.  I do a vector product to find it. The orientation is not changing. I mean by this if I apply a force like Vector3(0,100,0), my object will still go up and the orientation will not change...    I change the matrix of the object each end of frame with the orientation and the position.