Entity picking questions


When I’m using raycastFirst to pick objects, I am getting also objects used for volume triggering (that only have collision components, but no rigidbody components). I would expect these objects not to be picked. Am I wrong?

Also, sometimes I would have 2 objects, one more transparent in front of the other one, and I would like to be able to pick the one in the back. Is this possible in some way?

Thanks & best regards,

From what I see ammo.js is used for picking objects using raycasts. And in ammo.js I see rayTest can be used with different callbacks (RayResultCallback, ClosestRayResultCallback , AllHitsRayResultCallback ) in order to get first hit, all hits, any hit:

/// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback
/// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.
virtual void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const; 

Can someone add support for these? Should I do it?

Thanks & best regards,

Currently the ammo build doesn’t include those extra tests :cry: I’ve been meaning to add them (at least the all hits callback) for ages.