http://www.ogre3d.org/tikiwiki/OgreBullet
http://oramind.com/ogre-bullet-a-beginners-basic-guide/
Ogre and bullet implementation
Re: Ogre and bullet implementation
Here is my an subjective and arguable propose ...
You should have to be able to do basic things in both engine BEFORE try to integrate them.
The basic things :-
It is not hard to make it happen, but for me it is really hard to make the code not messy and usable as an utility for game.
I recommends to encapsulate both engines, at least their basic features.
You should have to be able to do basic things in both engine BEFORE try to integrate them.
The basic things :-
- Ogre3d = camera, light, entity and sceneNode.
Bullet = dynamic world, (set/get) (velocity, position), rigidbody (simple shape like plane & cube)
It is not hard to make it happen, but for me it is really hard to make the code not messy and usable as an utility for game.
I recommends to encapsulate both engines, at least their basic features.
Re: .
Whatever the original question was (I can guess based on the answer). I wrote a simulator based on Ogre3D and Bullet without using OgreBullet. If you need directions on how to do that, ask me anything!
Re: .
Benelot, in your top level of program, how you encapsulate Bullet Engine?
I am creating physic object like this :-
My bullet world is encapsulated in Physic_Room that has a duty to maintain each type of physic object.
I create a custom array to store each type of them (constraint , rigid, compound, empty ).
I have to code function for allocate new physic object of each type.
I think it is error-prone.
Would you mind to share how you did?
I am creating physic object like this :-
Code: Select all
MyRigidBody* rigid = physicFactory()->createCube( position, halfSize , mass, mask );
I create a custom array to store each type of them (constraint , rigid, compound, empty ).
I have to code function for allocate new physic object of each type.
Code: Select all
class Physic_Room{
MyConstraint* allocateConstraint(){ .... }
MyRigidBody* allocateRigidbody(){ .... }
...
void addToTheBulletWorld(MyConstraint*){ .... }
void addToTheBulletWorld(MyRigidBody*){ .... }
...
void destroyConstraint(MyConstraint*){ .... }
void destroyRigidBody(MyRigidBody*){ .... }
...
};
Would you mind to share how you did?
Re: .
So basically I created a model view controller pattern, having an environment encapsulating the world, creature consisting of limbs encapsulating rigidbodies, joints encapsulating joint constraints. Each controller class then reads the model state from the physics and updates its view to represent the state. Your physics room would be similar to my environment, except that I would store creatures in a std::vector instead of storing all things separately.
This is what this generally looks like:
-A single limb:
https://github.com/benelot/minemonics/b ... y/Limb.cpp
https://github.com/benelot/minemonics/b ... y/Limb.hpp
A creature (consisting of a phenotype which in turn consists of limbs and joints):
https://github.com/benelot/minemonics/b ... eature.cpp
https://github.com/benelot/minemonics/b ... eature.hpp
This is what this generally looks like:
-A single limb:
https://github.com/benelot/minemonics/b ... y/Limb.cpp
https://github.com/benelot/minemonics/b ... y/Limb.hpp
A creature (consisting of a phenotype which in turn consists of limbs and joints):
https://github.com/benelot/minemonics/b ... eature.cpp
https://github.com/benelot/minemonics/b ... eature.hpp
Last edited by benelot on Sat Aug 13, 2016 1:08 pm, edited 1 time in total.