Hi guys,
I have a design question when combining bullet with Ogre and BtOgre as the bullet wrapper. I know that this isn't the ogre forum, but since it's more a bullet question I thought it fits better in this forum.
In my Ogre scene I have a btDynamicWorld and I create an ogre mesh with its submeshes. This means, that every change to the root mesh also applies to it's submeshes (i.e. I rotate the root mesh -> the submeshes also rotates according to the root meshes center position).
If all submeshes as well as the root mesh are rigidbodies, how can they still stick to the changes made by the root mesh? Are rigidbodies even appropriate?
I'd like to have multiple meshes (they can overlap, so no collision among each other should be detected) to stick together as a 'unit', being able to apply force as a whole group, but another body should collide with the 'unit'/group.
How would I start doing this? Any ideas?
Thank you for your answers.
Design question
-
- Posts: 6
- Joined: Wed Aug 19, 2009 8:29 pm
Re: Design question
OK I solved the problem by constructing only btCollisionObjects and moving them in an update step of the model like so:
The root node doesn't contain a collisionObject (as it already exists as a rigidBody), so only the childnodes are affected.
But there is another problem I'm facing now. According to my physics professor the resulting force is F=m*g, where g on earth is 9.81 (approximately). However, If I change the mass of my object (Big differences, I tried it with 1 and 10000000000000), the object seems to be falling down at the same speed. What could I be doing wrong?
Code: Select all
if (collisionObject) {
static Ogre::Vector3 curPos;
curPos = mPosition*mNode->getParent()->getScale() + mNode->getParent()->getPosition();
collisionObject->getWorldTransform().setOrigin(btVector3(curPos.x, curPos.y, curPos.z));
collisionObject->getWorldTransform().setRotation(BtOgre::Convert::toBullet(mNode->getOrientation()));
}
But there is another problem I'm facing now. According to my physics professor the resulting force is F=m*g, where g on earth is 9.81 (approximately). However, If I change the mass of my object (Big differences, I tried it with 1 and 10000000000000), the object seems to be falling down at the same speed. What could I be doing wrong?
-
- Posts: 34
- Joined: Tue Mar 04, 2008 3:16 pm
Re: Design question
This is one of the fundamentals of dynamics: the mass of an object has nothing to do with its falling speed. Sure, F is bigger with a big m, but g is the acceleration (with a = v/t), which has nothing to do with the force.
-
- Posts: 6
- Joined: Wed Aug 19, 2009 8:29 pm
Re: Design question
Damn you're right, totally forgot about Boyle
Anyways, it appears to me that the objects in my scene don't fall quick enough. Is there anything to accelerate it other than changing the gravity?
Anyways, it appears to me that the objects in my scene don't fall quick enough. Is there anything to accelerate it other than changing the gravity?
-
- Posts: 508
- Joined: Fri May 30, 2008 2:51 am
- Location: Ossining, New York
Re: Design question
What you wanted originally was probably a btCompoundShape