alternately does contact monitoring return 1 contact per unique body or multiple contacts per body (if this is the case)?
Is there any way other than turning on contact monitoring to get collision info between bodies?
For a RigidBody, I think that is the only way to get collision info. I think its one contact per body, but most times I only process the first contact anyway so I'm not positive.
- Edited
Unfortunately contact monitoring is a property of rigid bodies and not areas. :/
I guess I'll just use a rigid-body in kinematic mode instead of an area.
So the problem with using kinematics is of course a contact necessitates a collision and reaction to rigid bodies so you can only probe if you are fine with contacted body interacting with a kinematic mode rigid-body.
unfortunately what i want is the contact information provided by bullet but without the consequence of a collision. thus i would get object, point of contact and (less important things like normal and impulse).
So I can gather all the collision monitoring points but each would have to be probed by another shape with get_rest_info
- Edited
func collide_shape also seems to return normals 2 vector3 for each contact instead of 1, for every contact which is inconsistent with docs.
Oh, I didn’t realize you were using an Area2d node. Unfortunately there is no way to get the collision data from an Area2d, but there is a semi-working workaround. If you have a KinematicBody2D node with the layers all disabled, you can position it at the same position as your Area2d and then use move_and_collide with the test move argument on. This will return collision data that should, if I recall correctly, give a decently accurate idea of the collision position and normal for the Area2d.
- Edited
No it's all 3d. I was just thrown for a loop that the call is documented as returning contacts, not contact normal pairs.
So if you ask for a limit of 8 contacts you get 16, and half are not what I was thinking they were and the minimum was 2 points reported.
I just ignore or strip the data.
Instead of using ray casting I use the other contact probing calls of physics-direct-state. 1) cast for contacts --- spews points+normals 2) cast_motion -- casting in the direction of the points tells me that where i can invoke get_rest_info 3) get_rest_info -- returns collision object, normal and point