kidcdf
29-04-2008 07:54:04
In the example of Lesson701, the car can not stop as soon as it launches. so I rewrite the codes:
In Physx2.73 api manual, it says:
In the legacy friction model the output from the tire force functions is ignored. The combined material properties of the wheel and the "ground" determine the traction budget
then the car can stop after drives for servel seconds.
But in NxOgre 0.9:
the car still can not stop,why?
then I add these physx codes to set the EMULATE LEGACY Model manually. run the game, add some motoe torques,the wheels began to run, but the car didn't move,I have set the mass of car to 1.0,and all
SceneParams.defaultfriction = 0.1 ,but it still doesn't work.
"wheelShapeDesc.wheelFlags = NX_WF_EMULATE_LEGACY_WHEEL;"
// Create the default material
NxMaterial* defaultMaterial = gScene->getMaterialFromIndex(0);
defaultMaterial->setRestitution(0.9);
defaultMaterial->setStaticFriction(0.5);
defaultMaterial->setDynamicFriction(0.9);
In Physx2.73 api manual, it says:
In the legacy friction model the output from the tire force functions is ignored. The combined material properties of the wheel and the "ground" determine the traction budget
then the car can stop after drives for servel seconds.
But in NxOgre 0.9:
NxOgre::SceneParams sp;
sp.setToDefault();
sp.floor =true;
sp.gravity=NxVec3(0,-9.8,0);
sp.defaultMaterialDynamicFriction=0.9;
sp.defaultMaterialRestitution=0.9;
sp.defaultMaterialStaticFriction=0.5;
m_nxscene = m_nxworld->createScene("BumperCarPhysxScene", m_sceneMgr, sp);
NxOgre::WheelParams wp;
wp.setToNormal();
wp.suspension_damper = 1.0f;
wp.suspension_spring = 20000.f;
wp.suspension_target = 0.02f;
wp.suspension_travel = 0.01f;
wp.radius = 0.6f;
wp.inverseWheelMass = 0.1f;
wp.emulate_legacy_wheel=true;
wp.clamped_friction=false;
car->wheelset = WheelSet::createFourWheelSet(car->body, Vector3(-1.0f, -carsize.y/2, 1.8f), Vector3(1.0f, -carsize.y/2, -1.6f), wp.radius,"",wp);
the car still can not stop,why?
then I add these physx codes to set the EMULATE LEGACY Model manually. run the game, add some motoe torques,the wheels began to run, but the car didn't move,I have set the mass of car to 1.0,and all
SceneParams.defaultfriction = 0.1 ,but it still doesn't work.
for(std::list<NxOgre::Wheel*>::iterator i = car->wheelset.Drive.items.begin();i != car->wheelset.Drive.items.end();++i)
{
(*i)->getNxWheelShape()->setWheelFlags (NX_WF_EMULATE_LEGACY_WHEEL);
}