anileci
10-04-2007 11:11:18
I embed PhysX into my game by nxOgre. At the begin, I only work under debug mode, physX works good. But when I bulid a release version app for testting the performance these days, I found that they are quite different.
In my game, a [actor] will pick up a [box] then throw it to others for attacking. The different between d & r is the speed of actor and box. Suppose the speed in debug for actor and box is 5 and 10 units/sec. In release app, I found the actor runs very slow, maybe 2~3 units/sec. but if I pick up a box, then the actor moves faster(8~9), I'm sure I didn't modify it's speed value. And after throw out the box, the box flying speed is about 5~6 units/sec. So in release, my actor can catch up a flying box if he pick up a box
The actor is a NxCapsuleController and the box is a NxActor with NxBoxShapeDesc.
Some Init values like this:
-----------------------------------------------
pd.SetToDefault();
pd.setGravity( true );
pd.setSlopeLimit( 60 );
pd.setStep( 100 );
pd.setShapeAsCapsule( 40.0f, 40.f );
pd.setMesh( "ninja.mesh" );
pd.setWalkSpeed(70);
pd.setRunSpeed(500);
pd.setGravity(-1000);
-------------------------------------------
[box]NxActor :
m_pBody = pPhyScene->createBody(
m_Desc.name, // Name of the body
m_Desc.meshName, // Mesh to use
new nxOgre::cubeShape( desc.cubeShapeSize ),
m_Desc.density, // Density
m_Desc.recurPose
);
-------------------------------------------
Launch box:(throw it)
m_pBody->setIgnoreGravity( true );
m_pBody->setLinearVelocity( Ogre::Vector3::ZERO, 0.0f );
m_pBody->addForce( 3*150000000000.0f * dir );
-------------------------------------------
Move box with actor's skeleton animation in each frame
m_pBody->freezeAll();
m_pBody->moveTo( nxOgre::pose(pos, qua));
-------------------------------------------
FPS debug : 8~12
FPS release: 40~60
I have tried to set
//mScene->setTiming(_time / 4.0f, 4, NX_TIMESTEP_FIXED);
mScene->setTiming(_time / 4.0f, 4, NX_TIMESTEP_VARIABLE);
but it's no different.
If need, I can try to REC the game video for you.
SW version:
AGEIA PhysX SDK 2.6.2 without HW.
XPSP2 VS2003 OGRE1.25 NxOGRE0.4RC3
P4 3.0GHz 1GRAM
Can anybody give me some clue to solve this problem?
Thanks in advance!
In my game, a [actor] will pick up a [box] then throw it to others for attacking. The different between d & r is the speed of actor and box. Suppose the speed in debug for actor and box is 5 and 10 units/sec. In release app, I found the actor runs very slow, maybe 2~3 units/sec. but if I pick up a box, then the actor moves faster(8~9), I'm sure I didn't modify it's speed value. And after throw out the box, the box flying speed is about 5~6 units/sec. So in release, my actor can catch up a flying box if he pick up a box

The actor is a NxCapsuleController and the box is a NxActor with NxBoxShapeDesc.
Some Init values like this:
-----------------------------------------------
pd.SetToDefault();
pd.setGravity( true );
pd.setSlopeLimit( 60 );
pd.setStep( 100 );
pd.setShapeAsCapsule( 40.0f, 40.f );
pd.setMesh( "ninja.mesh" );
pd.setWalkSpeed(70);
pd.setRunSpeed(500);
pd.setGravity(-1000);
-------------------------------------------
[box]NxActor :
m_pBody = pPhyScene->createBody(
m_Desc.name, // Name of the body
m_Desc.meshName, // Mesh to use
new nxOgre::cubeShape( desc.cubeShapeSize ),
m_Desc.density, // Density
m_Desc.recurPose
);
-------------------------------------------
Launch box:(throw it)
m_pBody->setIgnoreGravity( true );
m_pBody->setLinearVelocity( Ogre::Vector3::ZERO, 0.0f );
m_pBody->addForce( 3*150000000000.0f * dir );
-------------------------------------------
Move box with actor's skeleton animation in each frame
m_pBody->freezeAll();
m_pBody->moveTo( nxOgre::pose(pos, qua));
-------------------------------------------
FPS debug : 8~12
FPS release: 40~60
I have tried to set
//mScene->setTiming(_time / 4.0f, 4, NX_TIMESTEP_FIXED);
mScene->setTiming(_time / 4.0f, 4, NX_TIMESTEP_VARIABLE);
but it's no different.
If need, I can try to REC the game video for you.
SW version:
AGEIA PhysX SDK 2.6.2 without HW.
XPSP2 VS2003 OGRE1.25 NxOGRE0.4RC3
P4 3.0GHz 1GRAM
Can anybody give me some clue to solve this problem?
Thanks in advance!