Bullet integration.

Working on a wrapper to ease access to the ogre objects, in a namespace called polymorph 🙂

For instance, here is how to declare objects.

polymorph::PBullet::start();

// simple nodes
n0.sphere( sceneMgr );
n0.orientation( Vector3( 0.3,-0.1,0 ) );
n0.scale( 2.46 );
n0.move( Vector3( -12,8,0 ) );
n0.debug( true );

n1.sphere( sceneMgr );
n1.debug( true );
n1.orientation( Vector3( -0.5,0.1,0 ) );
n1.scale( 4 );
n1.move( Vector3( 12,0,0 ) );

// parenting n1 to n0
n0.attach( &n1 );

// nodes with physics
my_sphere.sphere( sceneMgr );
my_sphere.orientation( Vector3( 0.3,-0.1,0 ) );
my_sphere.scale( 2.46 );
my_sphere.move( Vector3( -12,8,0 ) );
my_sphere.debug( true );
my_sphere.physics( polymorph::BT_DYNAMIC_SPHERE );

my_node.load( sceneMgr, “General”, “ob.mesh” );
my_node.physics( polymorph::BT_DYNAMIC_FREE, “General”, “ob-physics.mesh” );
my_node.scale( 5 );
my_node.debug( true );

Once done, to move an object, you call:

my_sphere.yaw( Radian( 0.005 ) );
my_node.yaw( Radian( 0.02 ), true );
my_node.move( Vector3( -12,8,0 ) )

Very soon, custom meshes will be available into Bullet!

See P.E.2.0/bullet/app for sources.

ogre-render-window_690