Stange issues with positions of bodies and collisions

Mar 17, 2013 at 11:46am

Stange issues with positions of bodies and collisions

Hello,

I am trying to put a ball inside a cube (built from six blocks) to make it bounce.

However I have two issues:

1. When the patcher is first loaded the blocks are correctly placed. However if I reset the jit.phys.body objects some blocks disappear and others are not at the right place.
2. The ball seems to be able to go beyond the faces of the cubes (especially when its speed / force is high). That’s the reason I changed the block’s thickness to 1. (coming from 0.) but it does not solve the issue.

I can’t figure out how to solve this.

– Pasted Max Patch, click to expand. –
#67144
Mar 17, 2013 at 1:08pm

re,
1. you have to use @resetpos (body reset position), @resetquat (body reset quat) messages on jit.phys.body.
2.may be on “jit.phys.world”object, “fixedtimestep”(fixed time step value (Hz) of physics simulation) message could help you…
http://cycling74.com/forums/topic.php?id=38167

http://cycling74.com/forums/topic.php?id=42843

mathieu

#241595
Mar 17, 2013 at 1:19pm

All right. Thanks a lot matmat.

#241596
Mar 17, 2013 at 4:44pm

you also might be interested in the “setresetstate” message to phys.body.
this will set the resetpos and resetquat attributes to the current position and quat values.

#241597
Mar 22, 2013 at 8:24am

I can’t get my ball to bounce on the cube’s walls without escaping the cube at some point.

Are my settings correct or do I ask too much from jit.physics ?

– Pasted Max Patch, click to expand. –
#241598
Mar 26, 2013 at 12:57am

Anyone has an idea ???

#241599
Mar 26, 2013 at 5:58pm

hi,
may be the “restitution” is a cause..The restitution is the proportion of kinetic energy preserved on impact.If it’s greater than 1, the energy increase, so….
2. for the “qmetro”, you have to write “qmetro @interval 30 hz”, otherwise the default interval is 5ms…
I hope it can help you

#241600
Mar 28, 2013 at 1:37am

modifying the position / rotation values of a dynamic rigid body will not yield an accurate physical simulation.
you should use forces / impulses, or constraints to move dynamic rigid bodies.
eg, the phys.picker object is simply a phys.point2point constraint.

#241601
Mar 29, 2013 at 8:40am

Ha haaa. Ok I’ll dig that. Thanks Rob.

#241602

You must be logged in to reply to this topic.