Physics on a very small planet asset

Post Reply
Anosch
Posts: 2
Joined: Sat Dec 03, 2016 10:36 am

Physics on a very small planet asset

Post by Anosch »

hi, is it possible to tweak bullet-lib in a way to handle physics on the surface of a very small planet? I was looking for something like forcefields or non-constant gravity vectors but couldn't find straight answers. I was also thinking of simulating the physics on a plain planar model and translating it back - but I'm not even sure this would work at all..

here an example to visualize the vision/problem (not sure if they use physics or fake it all). I want to run and jump on the (obviously) curved surface of the planet.
Image
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Physics on a very small planet asset

Post by drleviathan »

Bullet does not have a gravity field feature built in, but you can set the gravity vector on a per-object basis, which means it wouldn't be too hard to do yourself: derive a custom action from btActionInterface that computes and updates one or more objects' gravity every substep.
hyyou
Posts: 96
Joined: Wed Mar 16, 2016 10:11 am

Re: Physics on a very small planet asset

Post by hyyou »

I think the easiest way is to applyImpulse(customGravity) every time-step.

I doubt whether it has any disadvantage compared to drleviathan's answer.
Anosch
Posts: 2
Joined: Sat Dec 03, 2016 10:36 am

Re: Physics on a very small planet asset

Post by Anosch »

thanks to both of you - I'm trying them out and will post some conclusions back. (or more questions)
Post Reply