Forums > Jitter

Stange issues with positions of bodies and collisions


Mar 17 2013 | 11:46 am

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. --

Mar 17 2013 | 1:08 pm

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

Mar 17 2013 | 1:19 pm

All right. Thanks a lot matmat.

Mar 17 2013 | 4:44 pm

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.

Mar 22 2013 | 8:24 am

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. --

Mar 26 2013 | 12:57 am

Anyone has an idea ???

Mar 26 2013 | 5:58 pm

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

Mar 28 2013 | 1:37 am

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.

Mar 29 2013 | 8:40 am

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

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

Forums > Jitter