Collisions dont match[OGRE+BULLET+OGREBULLET]

Please don't post Bullet support questions here, use the above forums instead.
cookiezzz
Posts: 3
Joined: Wed Aug 03, 2011 2:53 pm

Collisions dont match[OGRE+BULLET+OGREBULLET]

Post by cookiezzz »

Hi ,
I use Ogre + Bullet + OgreBullet for my application.
it works so far, but the Ogre Object and the collision don't match. Any Ideas?
Scene create:

Code: Select all


			Ogre::AxisAlignedBox boundingB = Player.Entity->getBoundingBox();
             size = boundingB.getSize(); 
			 size *= (Player.node->getScale()); // only the half needed
			 size /= 2;
             size *= 0.96f;   // Bullet margin is a bit bigger so we need a smaller size
             // after that create the Bullet shape with the calculated size
			 OgreBulletCollisions::BoxCollisionShape *sceneBoxShape = new OgreBulletCollisions::BoxCollisionShape(size);
			 Player.Body = new OgreBulletDynamics::RigidBody("PlayerPhys" ,mWorld);
			 Player.Body->setShape(   Player.node,sceneBoxShape,    
                              0.0f,         // dynamic body restitution
                               0.0f,0.1f,         // dynamic body friction
							   Ogre::Vector3(0,0,0),      // starting position of the box
							   Ogre::Quaternion(1,0,0,0));// orientation of the box
			 Player.Body->setPosition(0,900,0);
			 Player.Body->setKinematicObject(true);
			 Player.Body->showDebugShape(true);


			 
			 boundingB = Floor.Entity->getBoundingBox();
			 size = boundingB.getSize(); 
			 size *= (Floor.node->getScale());
			 size /=2;// only the half needed
             size *= 0.96f;   // Bullet margin is a bit bigger so we need a smaller size
             // after that create the Bullet shape with the calculated size
			 Floor.Shape = new OgreBulletCollisions::BoxCollisionShape(size);
			 Floor.Body = new OgreBulletDynamics::RigidBody("FloorPhys" ,mWorld);
			 Floor.Body->setStaticShape(Floor.Shape,0.1f,0.0f,Ogre::Vector3(0,0,0));
cookiezzz
Posts: 3
Joined: Wed Aug 03, 2011 2:53 pm

Re: Collisions dont match[OGRE+BULLET+OGREBULLET]

Post by cookiezzz »

no idea? :?
eSalt
Posts: 15
Joined: Tue Jul 19, 2011 4:08 pm

Re: Collisions dont match[OGRE+BULLET+OGREBULLET]

Post by eSalt »

Just give it time, these forums are pretty slow moving. We're pretty much all hobbyists on the forums, I think. As to your question, I don't quite know, sorry. I'm not very experienced personally.

I did run into a possibly similar problem when I used a model that I didn't make as a test. The collision box was not matched to the mesh correctly. (the box was the right size, but centered around the bottom of the mesh) when I used a model I made myself, the box lined up right. I suspect that the box was created around the editable location known as the "center" of the model (center of mass?), but I could be barking up the wrong tree entirely. I know when I made my own test model, I didn't change that center, and built the model about the origin (I used blender), anyways.

Also, keep in mind that I used a different toolchain, irrlicht+irrBullet. Your milage may vary, some conditions apply. :wink:

Seriously though, I hope this helps. :mrgreen:

Also, if this doesn't help, try posting your question in the feedback forum. It seems that is the most active forum for support.
cookiezzz
Posts: 3
Joined: Wed Aug 03, 2011 2:53 pm

Re: Collisions dont match[OGRE+BULLET+OGREBULLET]

Post by cookiezzz »

Thx for reaply,
but it doesnt help :x

the shapes have the wrong figure,too...

cookiezzz