Car Physic in ThunderWheels

Anything and everything that's related to video games, physics, etc, etc or the wider 'whatever' field that doesn't fit into the other forums. You're free here.

Re: Car Physic in ThunderWheels

Postby HAhmadi » Sun Jun 06, 2010 7:16 am

Hi again
Sorry for my questions.
i have 4 questions:
wheelShapeDesc.lateralTireForceFunction.asymptoteValue = 2.0;
wheelShapeDesc.lateralTireForceFunction.asymptoteSlip = 0.2;
You said me that asymptoteValue,asymptoteSlip will not used when we are using NX_WF_CLAMPED_FRICTION flag, but here when i change the parameters values, i have different car physic.
I think the parameters is used when NX_WF_CLAMPED_FRICTION exists, or im in wrong!?

After using NxVehicle and NxWheel parameters exactly such as buggy.cfg , my car is not same as ThunderWheel vehicle, My car is slow and player can not control it such as ThunderWheel cars.

Code: Select all

   vehicleDesc.mass               = 1150;
   vehicleDesc.digitalSteeringDelta   = 0.04f;
   vehicleDesc.steeringMaxAngle      = 30.0;
   vehicleDesc.motorForce            = 13200.0;
   vehicleDesc.maxVelocity            = 440;
   wheelShapeDesc.inverseWheelMass = 1.0f;   //n ot given!? TODO
              wheelShapeDesc.lateralTireForceFunction.extremumValue= 0.9;
   wheelShapeDesc.lateralTireForceFunction.extremumSlip = 0.7;
   wheelShapeDesc.longitudalTireForceFunction.extremumValue= 0.9;
   wheelShapeDesc.longitudalTireForceFunction.extremumSlip = 0.7;
   wheelShape = static_cast<NxWheelShape *>(actor->createShape(wheelShapeDesc));

Is there anythings that i did wrong?
My car wheels accumulate forces, I explore in following :
For example when player keep "left" button for 3 seconds , one side of car wheels suspension grow.
When the player release the "left" button, The car continue turning and seems that the player did not released the key!The suspension will comeback to normal state after 2 seconds! but really why?! why this happen. The problem only occur only when i use NX_WF_CLAMPED_FRICTION.
Any idea to solve that?

When my car is steering/turning, my engine RPM reduce and also my car speed reduce with that!
I played some days with NxVehicle parameters.
I detected that vehicleDesc.steeringSteerPoint and vehicleDesc.steeringTurnPoint parameters can affect the problem.
I don't know how can i choice the parameters value? :D

Thank you for your helps.

User avatar
Posts: 178
Joined: Fri Aug 24, 2007 1:27 pm

Re: Car Physic in ThunderWheels

Postby luis » Mon Jun 07, 2010 8:40 am

0) I was plain wrong ! I made a mistake, slip value isn't used but asymptote/extremum ARE used...
1) your code looks ok, I checked my code and i'm not modifying values parsed in .cfg files, so you ok with these numbers.
Everything seems to be ok... the flags are also right:

Code: Select all

wheelShape = static_cast<NxWheelShape *>(actor->createShape(wheelShapeDesc));

2 & 3, I cannot help here, I'm not using NxVehicle, I'm using my own class to create the vehicle.

I'm creating a NxBody and then attaching the wheels manually:

Code: Select all

NxOgre::Wheel *W = static_cast<NxOgre::Wheel*>
      (mBody->addShape(new NxOgre::WheelShape(radius, sp, wp,
      //"identifier: " + node->getName() + ", identifier-type: reference" )));
      nrp  )));

I'm not sure, but perhaps your problem isn't the wheels setup, it is just the implementation of NxVehicle... also take in count i'm not using latest version of NxOgre! i'm using a very old version with my own patches.
NxOgre version 1.0-18 plus this patch: ... =jittering
and Physx 2.7.x and Ogre 1.4.9

As you can see i've been using nxogre for a while, and I also suffered lots of bugs, incompatibility problems between nxogre versions, also this library has a constant tendency to be in re-write process... i get tired of this and i'm keeping my own nxogre version. If you want to try it I could put it in my site but take in count it needs older versions of physx and ogre (although it shouldnt be a problem to port it to its newest versions).


Re: Car Physic in ThunderWheels

Postby HAhmadi » Tue Jun 08, 2010 10:35 am

Sorry again for my questions.
Im not sure you did see TileRacer or not, I did used the TileRacer vehicle properties in my testcase but also my output is very different from the TileRacer, I thinked that maybe i have wrong in my initialize of my PhysX that is in the following :

Code: Select all

   gPhysicsSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION,NULL,&myErrorStream, desc, &errorCode);
   if(!gPhysicsSDK)   return;
   gPhysicsSDK->setParameter(NX_SKIN_WIDTH, 0.025f);

   //gPhysicsSDK->setParameter(NX_MIN_SEPARATION_FOR_PENALTY, -0.05f);
   //new nx parameters
   gPhysicsSDK->setParameter(NX_VISUALIZATION_SCALE, 1.0f);

   gPhysicsSDK->setParameter(NX_VISUALIZE_BODY_AXES, 1.0f);
   gPhysicsSDK->setParameter(NX_VISUALIZE_COLLISION_SHAPES, 1.0f);
   gPhysicsSDK->setParameter(NX_VISUALIZE_COLLISION_AXES, 1.0f);
   gPhysicsSDK->setParameter(NX_VISUALIZE_CONTACT_POINT, 1.0f);
   gPhysicsSDK->setParameter(NX_VISUALIZE_CONTACT_NORMAL, 1.0f);

   gPhysicsSDK->setParameter(NX_VISUALIZE_JOINT_LOCAL_AXES, 1.0f);
   gPhysicsSDK->setParameter(NX_VISUALIZE_JOINT_WORLD_AXES, 1.0f);
   gPhysicsSDK->setParameter(NX_VISUALIZE_JOINT_LIMITS, 1.0f);
   //sleep parameters
   gPhysicsSDK->setParameter(NX_DEFAULT_SLEEP_LIN_VEL_SQUARED, 0.15*0.15);
   gPhysicsSDK->setParameter(NX_DEFAULT_SLEEP_ANG_VEL_SQUARED, 0.14*0.14);
   // Don't slow down jointed objects
   gPhysicsSDK->setParameter(NX_ADAPTIVE_FORCE, 0.0f);

Is there any different with ThunderWheel, I dont know why i can not create a vehicle same as thunderwheel ;)

Thank you very much.

User avatar
Posts: 178
Joined: Fri Aug 24, 2007 1:27 pm

Re: Car Physic in ThunderWheels

Postby luis » Sun Jun 13, 2010 11:49 am

Hmm everything looks ok... and almost all parameters doesn't have any relation with wheels so i think it is not the reason. See what is going on inside NxVehicle class...

Return to “Offtopic”

Who is online

Users browsing this forum: No registered users and 1 guest