gravity
Hi,
is the gravity object in cannon an acceleration or force vector?
thanks.
Right now it's an acceleration vector. I quickly looked through the implementation in Bullet and it looks like they use force. I guess force is the way to go then?
But if so, then g=-9.8 only makes sense for objects of mass 1... I'm confused.
Hey scheteppe, I hope this is a good place to ask this question. If I wanted to add gravity to an object, in my case a sphere, how would I go about it? I have a world with little gravity and a sphere with some graggable cubes. How would I be able to add gravity to that sphere so that the cubes 'fall/rotate' into/around it? Btw, thanks for your work on cannon, its great.
Hey @lighterletter,
Not sure if this is what you need, but have you checked out the callbacks demo? It has a radial gravity field. http://schteppe.github.io/cannon.js/demos/callbacks.html
Thanks
Hi @schteppe, I'm trying to figure out how to create a gravitational field to a sphere (like the Earth and normal object on it like a balloon), before you ask I did a thousand tests without good results.
I do not speak of a simple rotation around a sphere, I try to explain it: the end result should be an object that moves around a sphere (with hills and cliffs) where it falls and slows down the hills just as gravity but at the center of an irregular sphere.
This is one of the last tests but strangely still object to spin around the ball until you get away http://codepen.io/williammanco/pen/BpJNPq
Thanks
Hi, it looks like you apply a force to the body, I'm not sure what your force does? If you want gravity to pull towards the center sphere, just add a force vector toward the center sphere... no rotation matrices needed... Here's a fixed spherical gravity: http://codepen.io/anon/pen/ygvLGV
Why does it matter?