Forums > Jitter

How To Get Objects To Stay Still in Physworld?

December 8, 2013 | 6:18 am

Hi – how can i get objects to not float around when using jit.physworld? If gravity is the same in all directions, shouldn’t the objects not move? I keep having the objects float to the top right hand corner. I’ve included an example patch. Thanks!

<code>

– Pasted Max Patch, click to expand. –

</code>


December 8, 2013 | 10:50 pm

Hi again!

Your patch does not work for me at all. However, open up the help file for jit.phys.body. Now set the body’s mass to 0. Notice that the object can still be clicked with the phys.picker, and collisions can still be reported. However, since the mass is 0, the sphere is suspended in space and cannot move while the mass is still 0.

Good luck!


December 9, 2013 | 11:10 am

your patch has a few issues. you’ve provided the gl-context name as the first arg to the phys.world. this is incorrect, as the phys.world needs a unique name argument to use as it’s physics-world-contect name. if you simply don’t provide an argument, a random unique id will be created automatically.

if you want the objects to not move, you need to 0 all the forces. in your patch there are two forces acting on the bodies, the first is the world gravity vector, and the second is the force matrix from phys.multiple. zero-ing gravity means setting all the vector axes to 0, not the same value. a gravity vector of 1 1 1, means the force will act in the direction 1 1 1.

you should also send 0 values to the force matrix.


Viewing 3 posts - 1 through 3 (of 3 total)