Thanks Rob for this new patch !
using jit.phys.ghost to test position of fingers / collision with bodies : that’s also what I tried to make. But I encounter some limitations that finally made me think that a ‘test3D’ function / message in jit.world would be helpful :
- the position of the contact point is returned in world coordinate
in our example, in order to set the position1 & position2 of a jit.phys.point2point (to grab the body by it’s exact colliding point),
we’ll then need to perform a world 2 local coordinates translation …
I can’t see any easy way to do this on an arbitrary body without extra complicated patching around jit.Phys.body…
or how doing this when working with jit.phys.multiple ? …
- jit.phys.ghost reports collisions only with the surface of a body
(if the ghost is inside a body, the position of the collision will be outside of the colliding body)
sometime it’s useful to grab / attach a body from a point that is not on its surface…
I would like to have an easy way to test arbitrary 3d points and get name of colliding objects, with world + local coordinate.
here is the feature request I sent off list :
I would like to submit a feature request about jit.phys.picker :
I need to pick objects (bodies) in a 3D space, not using a mouse or a touchscreen (2D), but using 3D controllers (VR).
the current 'touch' message works in screen coordinates only, so it's not usable in 3D.
I think we're missing a solution to dynamically grab bodies in 3D, and I can imagine 2 different approaches :
- adding a 'touch3d' message / function to jit.phys.picker : it would work just like the current touch message... but in 3D, and in world coordinates.
a more general solution :
- adding a 'test' (or 'testpoint' or .. ) message / function to jit.phys.world :
it would work just like raytest, but for a point instead of a ray.
it would return colliding body with world and local coordinates.
(raytest cannot be used to test a point because it doesn't work (returns nothing) if ray length == 0. or if ray starts inside a body)
It would then be easy to use the result of this test to set a jit.phys.point2point to grab the desired body.
Thanks !