Quantcast
Viewing all articles
Browse latest Browse all 4929

Bullet3d basics

@nathanblanchard12 wrote:

So I wanted to know what would be the best way to go about implementing the stuff below:

I wanted to use an external model (.3ds, .obj) and have a method apply bullet3d properties to it.
(I'm thinking I have to do something with the ofxBulletSoftTriMesh but I looked at the example in bullet3d and it only works with the included model in softbodymesh example)

mesh.load("lofi-bunny.ply");
mesh.setMode( OF_PRIMITIVE_TRIANGLES );
shared_ptr bunny(new ofxBulletSoftTriMesh());
bunny->create( &world, mesh, tt, 2 * tscale );
bunny->getSoftBody()->generateBendingConstraints( 3, bunny->getSoftBody()->m_materials[0] ); bunny->getSoftBody()->randomizeConstraints();
bunny->getSoftBody()->scale( btVector3( 0.025*tscale, 0.025*tscale, 0.025*tscale) );
bunny->getSoftBody()->m_cfg.collisions = btSoftBody::fCollision::CL_SS +
btSoftBody::fCollision::CL_RS;
bunny->getSoftBody()->generateClusters(6);
bunny->add();
bunnies.push_back( bunny );

The above doesn't work for me. I dont necessarily want it to be a softbody just a body with physics.

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles