Suggesting a Bullet feature : Gravitons

User avatar
cippyboy
Posts: 36
Joined: Fri Aug 25, 2006 1:00 am
Location: Bucharest

Suggesting a Bullet feature : Gravitons

Post by cippyboy »

I know this sounds interesting but it's actually pretty simple. I'm trying to make a small FPS so I'll be inserting weapons soon, and I've been intrigued by the Star Wars : Force Unleashed trailers ( http://youtube.com/watch?v=VsAJ9FdPYxE& ... ed&search= ; http://youtube.com/watch?v=7iCdN2FGOaQ& ... ed&search= ) so I was thinking about force interactions and stuff like the gravity gun from Half Life 2. It would be nice to create sphere's of influence that would apply an impulse from the center towards the object, but it would be nice for the impulse to start with a big value and gradually go down. Also besides spheres, there could be boxes, or other shapes and you could also push objects toward the center, acting as magnets or aligning them.

I could do this in my code (and probably will) but having it in Bullet could improve it's quality.
mohican
Posts: 17
Joined: Mon Aug 25, 2008 5:12 pm

Re: Suggesting a Bullet feature : Gravitons

Post by mohican »

The bullet demos use a constant impulse force to clamp objects, the direction of which is recalculated for each new frame. But this causes the object to wiggle crazily around the clamping point (especially if it's got a low mass).

I also need something like what you describe for the game I am working on: some sort of "gravity well" or "gravity magnet".
Have you tried to implement anything yourself?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Suggesting a Bullet feature : Gravitons

Post by Erwin Coumans »

mohican wrote:The bullet demos use a constant impulse force to clamp objects, the direction of which is recalculated for each new frame. But this causes the object to wiggle crazily around the clamping point (especially if it's got a low mass).
You can remove/reduce this 'wiggle' in several ways. For example, during the picking you can temporarily:
  • pick at the center of the object
  • increase angular damping
  • increase the inertia tensor,
  • set the 'angular factor' to zero
  • instead of btPoint2PointConstraint, use a different constraint that also locks the rotation, such as a btGeneric6DofConstraint
and reset values after dropping/release.

Hope this helps,
Erwin
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Suggesting a Bullet feature : Gravitons

Post by sparkprime »