lianlab / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Add 2D physics and collision detection to Bullet, including sample #208

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

There is a lot of demand for 2D physics, and possible mixing 2D and 3D 
physics.

It is trivial to restrict the degrees of freedom for rigid bodies, to 
restrict it to 2D motion.

Secondly, we can port over some of the 2D collision algorithms from Box2D 
into Bullet, the license is compatible.

Original issue reported on code.google.com by erwin.coumans on 20 Mar 2009 at 3:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by erwin.coumans on 20 Mar 2009 at 4:15

GoogleCodeExporter commented 9 years ago

Latest trunk has the option to lock individual degrees of freedom for rigid 
bodies, 
both linear and angular.

We added a new btBox2dShape and btBox2dbtBox2dCollisionAlgorithm, and ported 
some 
essential Box2D clipping method for the btBox2dShape. Also, we add a special 2D 
penetration depth algorithm for general 2D convex collision detection.

Last, some 2D - 3D examples will be added, running on CPU or CUDA.

Original comment by erwin.coumans on 20 Mar 2009 at 4:15

GoogleCodeExporter commented 9 years ago

See this commit http://code.google.com/p/bullet/source/detail?r=1645

Add 1D and 2D support for Bullet: using rigidbody->angularFactor(const
btVector3& factor) and body->setLinearFactor(const btVector3& linearFactor);
For example, to only allow linear motion in the X-Z plane, and only rotation
around Y axis use:
        body->setLinearFactor(btVector3(1,0,1));
        body->setAngularFactor(btVector3(0,1,0));

Original comment by erwin.coumans on 20 Mar 2009 at 4:17

GoogleCodeExporter commented 9 years ago
Added Box2dDemo to show how to use 2D features:

http://code.google.com/p/bullet/source/detail?r=1653

Original comment by erwin.coumans on 11 May 2009 at 7:00