Page 1 of 1

Physics on a very small planet asset

Posted: Sat Dec 03, 2016 10:49 am
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

Re: Physics on a very small planet asset

Posted: Sat Dec 03, 2016 1:31 pm
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.

Re: Physics on a very small planet asset

Posted: Sun Dec 04, 2016 1:52 am
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.

Re: Physics on a very small planet asset

Posted: Sun Dec 04, 2016 7:54 am
by Anosch
thanks to both of you - I'm trying them out and will post some conclusions back. (or more questions)