Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Aug 03, 2011 2:58 pm 
Offline

Joined: Wed Aug 03, 2011 2:53 pm
Posts: 3
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:

         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));


Top
 Profile  
 
PostPosted: Fri Aug 05, 2011 10:06 am 
Offline

Joined: Wed Aug 03, 2011 2:53 pm
Posts: 3
no idea? :?


Top
 Profile  
 
PostPosted: Fri Aug 05, 2011 3:10 pm 
Offline

Joined: Tue Jul 19, 2011 4:08 pm
Posts: 15
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.


Top
 Profile  
 
PostPosted: Fri Aug 05, 2011 5:37 pm 
Offline

Joined: Wed Aug 03, 2011 2:53 pm
Posts: 3
Thx for reaply,
but it doesnt help :x

the shapes have the wrong figure,too...

cookiezzz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group