Car Physics Help : Turning Out Of Corners

mr_burns

16-03-2008 08:32:27

Hi all,

I working through some of the PhysX tutorials, which are pretty good (for anyone interested).

I'm looking to improve on the Vehicle tutorial, particularly, 703 and 704, which is 3 and 4 wheeled drive vehicles.

Firstly, I'm trying to implement a more OO solution, which is gearing up something like this:


bool
CCar::Process(float _fDelta)
{
if (m_bBraking) // car is braking, set via the CInputMgr
{
m_bBraking = false;

// rear-wheel drive
wheel3->setBrakeTorque( m_fBrakeTorqueVal *= _fDelta );
wheel4->setBrakeTorque( m_fBrakeTorqueVal *= _fDelta );
}

if (m_bAccelerating) // car is accelerating
{
m_bAccelerating = false;

wheel3->setMotorTorque( m_fMotorTorqueVal *= _fDelta );
wheel4->setMotorTorque( m_fMotorTorqueVal *= _fDelta );
}

if (m_bTurning) // car is turning
{
m_bTurning = false;

wheel1->setSteerAngle( m_fSteerAngle *= _fDelta );
wheel2->setSteerAngle( m_fSteerAngle *= _fDelta );
}

//
// At this point, maybe I should check if the car is not turning,
// and begin to reset the front wheel turning angles, back towards
// zero?
// Simulating when a driver coming out of a corner, takes her
// hands off the steering wheel.
//

return (true);
}



Any ideas welcome. I'm trying to figure out where and how I should start to re-align the front wheels to their base starting angle (if that makes sense).

Here's a link to the PhysX tutorial (for those interested):
http://devsupport.ageia.com/ics/support ... eptID=1949

I understand this is an ODE forum, but figured their might be somewhere here who can give me a +2...

rewb0rn

16-03-2008 11:58:03

Did you realize there is an NxOgre forum next to the OgreOde forum that is in fact a forum for a PhysX wrapper?

http://www.ogre3d.org/phpBB2addons/view ... 92184d679a

mr_burns

16-03-2008 19:32:02

rewb0rn
Yes. I posted for help there too. I figured that this is a "physics" question, more than an API specific question.

rewb0rn

16-03-2008 22:15:48

Ok. Unfortunately I can't help with the problem I have not yet used vehicles.