AWHDRi
03-08-2009 12:48:16
Hello, that's me again. I'm working on table tennis game. I have single mesh for scene geometry and ball mesh.
The problem
My ball falls through the geometry of the scene or stuck in it. If the ball falls from small height (up to meter), it is looks like attached to the surface and moves
like has big mass. Also the ball is always shaking.
Ball creation code
Scene geometry creation code
What I am trying to do
- Subdivision of scene mesh
- adding NxOgre::Enums::ShapeFlags_DynamicDynamicCCD flag to ball body description
- adding force to ball from volume callbacks (not working/when ball shape is triangle mesh and it interact with the volume app crashes)
The problem
My ball falls through the geometry of the scene or stuck in it. If the ball falls from small height (up to meter), it is looks like attached to the surface and moves
like has big mass. Also the ball is always shaking.
Ball creation code
if(mKeyboard->isKeyDown(OIS::KC_SPACE) && mTimeUntilNextToggle <= 0)
{
NxOgre::RigidBodyDescription balldesc;
balldesc.mMass = Real(0.003);
//balldesc.mBodyFlags |= NxOgre::Enums::ShapeFlags_DynamicDynamicCCD;
//NxOgre::ResourceSystem::getSingleton()->openArchive("shared", "file:content/stage/shared");
// NxOgre::Mesh* ball = NxOgre::MeshManager::getSingleton()->load("shared:ball.mesh.nxs");
mBall = mRenderSystem->createBody(new NxOgre::Sphere(0.02), NxOgre::Real3(mCamera->getPosition().x,
mCamera->getPosition().y, mCamera->getPosition().z), "ball.mesh", balldesc);
mTimeUntilNextToggle = 0.2;
}Scene geometry creation code
NxOgre::ResourceSystem::getSingleton()->openArchive("content", "file:content/stage/stg1");
NxOgre::Mesh* triangleMesh = NxOgre::MeshManager::getSingleton()->load("content:Model.mesh.nxs");
mScene->createSceneGeometry(triangleGeometry, NxOgre::Matrix44(NxOgre::Real3(0, 0, 0)));What I am trying to do
- Subdivision of scene mesh
- adding NxOgre::Enums::ShapeFlags_DynamicDynamicCCD flag to ball body description
- adding force to ball from volume callbacks (not working/when ball shape is triangle mesh and it interact with the volume app crashes)