problem in creating a simple barrier with jit.phys.body

pethold's icon

hello jitter experts,

i am new to the phys objects in max 6.
i simply want to create a barrier, which should behave like a "wall" of the worldbox.
the barrier i have created does only work in one direction (if the sphere moves from top to bottom)

i am a bit lost in the attribute "jungle" of the phys objects.
perhaps someone can show me, what i am doing wrong.

best,
p.

Max Patch
Copy patch and select New From Clipboard in Max.

here is my example patch:

matmat's icon

hi,
you can set "@fixedtimestep 90 @maxsubsteps 4" attributes on jit.phys.world object.
With fixedtimestep you can increase the resolution of the simulation.
maxsubsteps is very important,
see in the jit.phys.world reference...
mathieu

diablodale's icon

As matmat implied, you are encountering a situation where the wall is not being seen/applied. The simulation calculates body positions/velocities/etc with discrete steps. Your ball is moving so fast that it never collides with the wall during one of those steps. It just happens to calculate one step below the wall and the next step is above the wall. You can see related behavior if you mouse select the ball when it is below the wall and gentle throw it up. It will likely hit the wall and fall down.

In addition to increasing the resolution/number of simulation steps, you could also increase the thickness of your wall so that it is more likely the ball will hit (or be within) the wall during one of those simulation steps. Or perhaps overlay a jit.phys.ghost on shared coordinates.