nikki wrote:You should try asking on the Bullet forums (I don't have much time these days to help).
BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)
- nikki
- Old One
- Posts: 2730
- Joined: Sat Sep 17, 2005 10:08 am
- Location: San Francisco
- x 13
- Contact:
-
Garibalde
- Halfling
- Posts: 69
- Joined: Thu Apr 16, 2009 2:38 am
- Location: Montreal, Quebec
- x 2
- Contact:
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)
Here is what i got working with the apply force/torque.kurty wrote:As you can see , i tried mNinjaBody->applyCentralForce(mTrans * evt.timeSinceLastFrame); but the result was that node and shape wasn't synchronised after few keyboard entries.
Code: Select all
Ogre::Vector3 UserForce = mDirection * 2;
Ogre::Vector3 UserTorque = mRotateval * 15;
mToolBody->setActivationState(DISABLE_DEACTIVATION);
mToolBody->applyForce(btVector3(UserForce.x,UserForce.y,UserForce.z),btVector3(0,0,0));
mToolBody->applyTorque(btVector3(UserTorque.x,UserTorque.y,UserTorque.z));
mToolState->setWorldTransform(mToolBody->getWorldTransform());
This will apply forces/torques to move the rigid body.
it seems you have to set setactivationState to DISABLE_DEACTIVATION each iteration or i find that the body stops moving.
you also have to sync the state of the body also.
hope this helps you.
Garibalde
-
Garibalde
- Halfling
- Posts: 69
- Joined: Thu Apr 16, 2009 2:38 am
- Location: Montreal, Quebec
- x 2
- Contact:
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)
I am still having issues with switching a body to kinematics and then colliding with other rigid bodies in the simulation.
The kinematic object seems to pass through the rigid bodies. However when i use force to move the object like in the
previous post everything works. From what i understand from reading all the threads in bullet forum and here is that
this should be possible. Anyone know what can possibly be wrong here.
Thanks.
Garibalde
The kinematic object seems to pass through the rigid bodies. However when i use force to move the object like in the
previous post everything works. From what i understand from reading all the threads in bullet forum and here is that
this should be possible. Anyone know what can possibly be wrong here.
Thanks.
Garibalde
- nikki
- Old One
- Posts: 2730
- Joined: Sat Sep 17, 2005 10:08 am
- Location: San Francisco
- x 13
- Contact:
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)
Just remove the dynamic body and re-add as kinematic. Make sure to set mass to 0, etc., to keep it kinematic. To make it dynamic again, do the opposite.Garibalde wrote:I am still having issues with switching a body to kinematics and then colliding with other rigid bodies in the simulation.
The kinematic object seems to pass through the rigid bodies. However when i use force to move the object like in the
previous post everything works.
-
Garibalde
- Halfling
- Posts: 69
- Joined: Thu Apr 16, 2009 2:38 am
- Location: Montreal, Quebec
- x 2
- Contact:
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)
Hi nikki,
http://www.bulletphysics.org/Bullet/php ... f=9&t=4517
I posted this in the bullet forums but no replies yet. This is what i have done and i still cant get collision between the kinematic body and rigid bodies. Can you see what i could be doing wrong here? If you have a sample code to do what i need. That would be great to just give me a kick in the right direction. I tried this all xmas and didnt get anywhere.. at least i got a kinematic body without collisions
however i would very much like collisions and physics effects on the rigid bodies.
Thanks
Garibalde
Code: Select all
Ogre::Vector3 cPos = mToolNode->getPosition() + (mDirection * 0.1);
Ogre::Vector3 tmp = mRotateval * 0.05;
Ogre::Quaternion dOri(tmp.x,tmp.y,tmp.z);
Ogre::Quaternion cOri = mToolNode->getOrientation() + dOri;
Globals::phyWorld->removeRigidBody(mToolBody);
mToolBody->setCollisionFlags(mToolBody->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT);
mToolBody->setActivationState(DISABLE_DEACTIVATION);
btTransform btt;
mToolBody->getMotionState()->getWorldTransform(btt);
btt.setOrigin(BtOgre::Convert::toBullet(cPos));
btt.setRotation(BtOgre::Convert::toBullet(cOri));
mToolBody->getMotionState()->setWorldTransform(btt);
mToolBody->setCenterOfMassTransform(btt);
Globals::phyWorld->addRigidBody(mToolBody);
mToolBody->activate(true);
I posted this in the bullet forums but no replies yet. This is what i have done and i still cant get collision between the kinematic body and rigid bodies. Can you see what i could be doing wrong here? If you have a sample code to do what i need. That would be great to just give me a kick in the right direction. I tried this all xmas and didnt get anywhere.. at least i got a kinematic body without collisions
Thanks
Garibalde
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git!)
nikki wrote:nikki wrote:You should try asking on the Bullet forums (I don't have much time these days to help).
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
dwarki27
- Gnoblar
- Posts: 2
- Joined: Fri Mar 19, 2010 11:16 am
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
Nikki, am very new to Ogre3D.. I need a little help.. How do i write a bullet debugdraw where in it coverts a ogre 3Dline(on creatin) to bullet...?
- nikki
- Old One
- Posts: 2730
- Joined: Sat Sep 17, 2005 10:08 am
- Location: San Francisco
- x 13
- Contact:
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
You mean you want to do a raycast? I'm not sure I got what 'convert ogre 3Dline to bullet' means...dwarki27 wrote:Nikki, am very new to Ogre3D.. I need a little help.. How do i write a bullet debugdraw where in it coverts a ogre 3Dline(on creatin) to bullet...?
-
dwarki27
- Gnoblar
- Posts: 2
- Joined: Fri Mar 19, 2010 11:16 am
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
well.. lemme explain.. there is a 3d sudoku game being developed.. and the cubes for it, i think use Ogre.. Inorder to interact with the individual cubes, i need a bullet transformation.. say, as soon as a line is drawn using ogre, there is a bullet layer to it.. I may not be good with the technical lingo used here..
- rogerdv
- Gnome
- Posts: 351
- Joined: Fri May 09, 2003 10:43 pm
- Location: Cuba
- x 1
- Contact:
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
Can somebody share with me some code to illustrate how to correctly move/rotate an animated shape? Im trying to implement some basic 3rd person view with free lok, but when I try to move the robot using applyCentralForce it advances but slowly sinks in the ground mesh.
- nikki
- Old One
- Posts: 2730
- Joined: Sat Sep 17, 2005 10:08 am
- Location: San Francisco
- x 13
- Contact:
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
Create a Line class that manages all the work of a Line. Let it handle creation of the Ogre stuff, and make it also create a cylinder of required length and radius to represent the line in bullet.dwarki27 wrote:well.. lemme explain.. there is a 3d sudoku game being developed.. and the cubes for it, i think use Ogre.. Inorder to interact with the individual cubes, i need a bullet transformation.. say, as soon as a line is drawn using ogre, there is a bullet layer to it.. I may not be good with the technical lingo used here..
The Bullet documentation and forums have some information on handling characters. I don't think you want complete dynamics with your robot, so the Kinematic Character Controller might be useful.rogerdv wrote:Can somebody share with me some code to illustrate how to correctly move/rotate an animated shape? Im trying to implement some basic 3rd person view with free lok, but when I try to move the robot using applyCentralForce it advances but slowly sinks in the ground mesh.
- toglia
- Gnome
- Posts: 336
- Joined: Sat Dec 08, 2007 4:28 am
- Location: Canada
- x 7
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
I need to create a hinge pivot to this mesh here, its a 320 triangle geo-sphere with inverted normals (so collisions are detected
inside).
But for some reason I can't thanks to the local inertia:
There seems to be something wrong with:
It is leaving the localInertia variable on {0,0,0} which is later giving problems to the hinge.
What is that local inertia anyway? I just want it to have a perfectly centered center of mass...
P.D.: Nikki, thanks for this cool wrapper. Its just what I was looking for.
inside).
But for some reason I can't thanks to the local inertia:
Code: Select all
Ogre::Entity* entity = mSceneManager->createEntity("bomboFisica.mesh");
BtOgre::StaticMeshToShapeConverter converter(entity);
btBvhTriangleMeshShape * shape;
shape = converter.createTrimesh();
btRigidBody::btRigidBodyConstructionInfo info(1.0, NULL, shape, btVector3(0,0,0));
btTransform frame;
frame.setIdentity();
frame.setOrigin(btVector3(0, 0, 0));
info.m_startWorldTransform = frame;
btRigidBody* body = new btRigidBody(info);
btVector3 localInertia(0.0, 0.0, 0.0);
shape->calculateLocalInertia(1.0 / body->getInvMass(), localInertia);
body->setMassProps(1.0 / body->getInvMass(), localInertia);
body->updateInertiaTensor();Code: Select all
shape->calculateLocalInertia(1.0 / body->getInvMass(), localInertia);What is that local inertia anyway? I just want it to have a perfectly centered center of mass...
P.D.: Nikki, thanks for this cool wrapper. Its just what I was looking for.
- toglia
- Gnome
- Posts: 336
- Joined: Sat Dec 08, 2007 4:28 am
- Location: Canada
- x 7
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
From the btTriangleMeshShape.cpp "moving concave objects not supported". It is weird, cause I had already hinged a compound containing concave triangles...
-
spa_10
- Gnoblar
- Posts: 3
- Joined: Fri Oct 30, 2009 4:02 pm
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
Hello,
We're working with btogre and We have some problem and we don't know what it means can anyone tell us what this is about???
OGRE EXCEPTION(4:ItemIdentityException): Resource group with name 'BtOgre' already exists! in ResourceGroupManager::createResourceGroup at ../src/OgreReResourceGroupManager.cpp(line 93)
We're working with btogre and We have some problem and we don't know what it means can anyone tell us what this is about???
OGRE EXCEPTION(4:ItemIdentityException): Resource group with name 'BtOgre' already exists! in ResourceGroupManager::createResourceGroup at ../src/OgreReResourceGroupManager.cpp(line 93)
- nikki
- Old One
- Posts: 2730
- Joined: Sat Sep 17, 2005 10:08 am
- Location: San Francisco
- x 13
- Contact:
-
spa_10
- Gnoblar
- Posts: 3
- Joined: Fri Oct 30, 2009 4:02 pm
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
Yes we're creating two instances of BtOgre::DebugDrawer because we need to work with 2 Scene Nodes because we're working with a static and a kinematic body and we don't know how to do this...
could you give us some advice?
could you give us some advice?
- nikki
- Old One
- Posts: 2730
- Joined: Sat Sep 17, 2005 10:08 am
- Location: San Francisco
- x 13
- Contact:
-
Caifie
- Gnoblar
- Posts: 17
- Joined: Tue Mar 16, 2010 11:37 am
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
hi, there!
btogre is good to use bullet in ogre, except with the new ogre1.7 terrain?
does anybody knows how to combine the new ogre1.7 terrain with the bullet?
btogre is good to use bullet in ogre, except with the new ogre1.7 terrain?
does anybody knows how to combine the new ogre1.7 terrain with the bullet?
- nikki
- Old One
- Posts: 2730
- Joined: Sat Sep 17, 2005 10:08 am
- Location: San Francisco
- x 13
- Contact:
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
If you can get the mesh data as an Ogre::VertexData object, you can do the following:-
Code: Select all
BtOgre::StaticMeshToShapeConverter conv;
conv.addStaticVertexData(vd); //Ogre::VertexData *vd; your vertex data.
shape = conv.createTrimesh();-
Caifie
- Gnoblar
- Posts: 17
- Joined: Tue Mar 16, 2010 11:37 am
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
tks, the terrain is solved.
another question, how to connect the btKinematicCharacterController to ogre.
if it is rigidbody, we can use RigidBodyState to connect a ogre scenenode.
but how can we do with the btKinematicCharacterController ? there seems nowhere to use RigidBodyState in btKinematicCharacterController.
another question, how to connect the btKinematicCharacterController to ogre.
if it is rigidbody, we can use RigidBodyState to connect a ogre scenenode.
but how can we do with the btKinematicCharacterController ? there seems nowhere to use RigidBodyState in btKinematicCharacterController.
-
afshin
- Kobold
- Posts: 34
- Joined: Wed Nov 10, 2010 11:12 pm
- Location: Canada
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
Hi Guys,
I have meshes exported from Maya and Blender to Ogre. However when I want to enable physics on these meshes, btogre conversion from mesh to bullet is not done properly. I was wondering if anyone can tell me what I am missing? Here is a simple Cube exported as mesh from maya and rendered in OGRE. I have a more complex mesh which is a tube and I have a same problem posted below.
I have posted this issue under a separate thread here: http://www.ogre3d.org/forums/viewtopic.php?f=5&t=62050
Any help is greatly appreciated

Here is my more complex mesh:

I have meshes exported from Maya and Blender to Ogre. However when I want to enable physics on these meshes, btogre conversion from mesh to bullet is not done properly. I was wondering if anyone can tell me what I am missing? Here is a simple Cube exported as mesh from maya and rendered in OGRE. I have a more complex mesh which is a tube and I have a same problem posted below.
I have posted this issue under a separate thread here: http://www.ogre3d.org/forums/viewtopic.php?f=5&t=62050
Any help is greatly appreciated

Here is my more complex mesh:

-
apanloco
- Gnoblar
- Posts: 4
- Joined: Thu Dec 30, 2010 9:41 am
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
@afshin: can you tell me what your percieved problem is? To me it looks good. The lines you see are the normals from the object. If you think they are too big you need to scale the object up (and move the camera out). The normals are always drawn with size 1. So if the cube has size 1 the normals will look like that. But if you resize the cube to let's say 100, the normals will look like small spines sticking out.
The doughnut, well, I can't say if it's correct since it's so messy but my guess is that it is correct too. Try scaling it up (and moving the camera out) and see what it looks like.
The doughnut, well, I can't say if it's correct since it's so messy but my guess is that it is correct too. Try scaling it up (and moving the camera out) and see what it looks like.
-
afshin
- Kobold
- Posts: 34
- Joined: Wed Nov 10, 2010 11:12 pm
- Location: Canada
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
apanloco wrote:@afshin: can you tell me what your percieved problem is? To me it looks good. The lines you see are the normals from the object. If you think they are too big you need to scale the object up (and move the camera out). The normals are always drawn with size 1. So if the cube has size 1 the normals will look like that. But if you resize the cube to let's say 100, the normals will look like small spines sticking out.
The doughnut, well, I can't say if it's correct since it's so messy but my guess is that it is correct too. Try scaling it up (and moving the camera out) and see what it looks like.
I figured it out ... Well initially the problem was that the mesh which I was passing to Bullet was too complex (too many vertices). This is why when something collided with something else, the frame rate per second would drop down to low numbers. What I did was I passed a separate mesh to btOgre than the one I drew on the screen. I lowered the resolution using Maya and used that for physics. The issue is now resolved. So in summery, I visualize a high-res mesh but for physics I used a low-res one and this works great.
Thanks for your response
-
rs_kryptik61636
- Gnoblar
- Posts: 2
- Joined: Sat Jan 15, 2011 11:49 am
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
Hi
I'm using BtOgre and the soft body support that Igvier provided to connect Bullet and OGRE in order to implement a surgical simulator. I'm trying to implement mesh cutting right now and as a start am trying to make small holes in the mesh. After looking at some of the Bullet demo code and the glue/fracture sample code (http://code.google.com/p/bullet/issues/detail?id=90), I came up with the following internal tick callback function:
where Globals::psb is the soft body. Does anyone have any idea where I'm going wrong?
I'm using BtOgre and the soft body support that Igvier provided to connect Bullet and OGRE in order to implement a surgical simulator. I'm trying to implement mesh cutting right now and as a start am trying to make small holes in the mesh. After looking at some of the Bullet demo code and the glue/fracture sample code (http://code.google.com/p/bullet/issues/detail?id=90), I came up with the following internal tick callback function:
Code: Select all
void cuttingCallback( btDynamicsWorld *world, btScalar timeStep )
{
int numManifolds = world->getDispatcher()->getNumManifolds();
for( int i = 0; i < numManifolds; i++ )
{
btPersistentManifold *currentManifold = world->getDispatcher()->getManifoldByIndexInternal(i);
if(!currentManifold)
continue;
for( int p = 0; p < currentManifold->getNumContacts(); p++ )
{
btVector3 hitPoint = currentManifold->getContactPoint(p).getPositionWorldOnA();
ImplicitSphere iSphere(hitPoint,10);
Globals::psb->refine(&iSphere,0.0001,true);
}
}
}
-
WhirledPeas
- Kobold
- Posts: 27
- Joined: Thu Mar 10, 2011 7:51 pm
- x 1
Re: BtOgre - Simple, Thin Bullet-Ogre Connection (now on git
Hi, I just found this little package and am interested in using it. I have a question. Do I have to build it before I use it or can I just use the headers and libraries straight out of the box?
If I do have to build, how am I supposed to edit the premake.lua file? the comments say to add the include directories for Ogre and Bullet, but I'm not sure how exactly to enter that in:
"Ogre",
"c:/ogre/include"
Also, I don't have an include directory as far as I can tell with bullet.
thanks for the help.
If I do have to build, how am I supposed to edit the premake.lua file? the comments say to add the include directories for Ogre and Bullet, but I'm not sure how exactly to enter that in:
am I supposed to make it:package.includepaths = {
-- Add Ogre, OIS and bullet include directories if you don't use pkg-config
"./exampleapp",
"../include",
}
"Ogre",
"c:/ogre/include"
Also, I don't have an include directory as far as I can tell with bullet.
thanks for the help.