You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MultiRayShape API only provides AddRay which is sufficient when sensors are being statically defined in a sdf file. But there are situations where it is desirable to dynamically define a set of rayshapes to check collisions towards not-predefined directions.
For example, when simulating a "fake" object/model detection sensor in combination with the LogicalCameraSensor and a set of rays need to be casted towards objects that entered in the frustum. This would speedup computation avoiding casting rays outside the frustum.
There is no way of "clearing" a MultiRayShape and re-define the amount of rays being casted.
Alternatives considered
I had to instance a multirayshape with a pre-defined buffer of N rays and re-use them as batchs in cases where objects in frustum where > N.
A new MultiRayShape can be created each time using PhysicsEngine::CreateShape() / PhysicsEngine::CreateCollision(), but it seems that the engine keeps stacking instances internally and increasing memory usage. It seems that there is no way of detaching a shape/collision from the engine.
The text was updated successfully, but these errors were encountered:
Desired behavior
The MultiRayShape API only provides AddRay which is sufficient when sensors are being statically defined in a sdf file. But there are situations where it is desirable to dynamically define a set of rayshapes to check collisions towards not-predefined directions.
For example, when simulating a "fake" object/model detection sensor in combination with the LogicalCameraSensor and a set of rays need to be casted towards objects that entered in the frustum. This would speedup computation avoiding casting rays outside the frustum.
There is no way of "clearing" a MultiRayShape and re-define the amount of rays being casted.
Alternatives considered
I had to instance a multirayshape with a pre-defined buffer of N rays and re-use them as batchs in cases where objects in frustum where > N.
A new MultiRayShape can be created each time using PhysicsEngine::CreateShape() / PhysicsEngine::CreateCollision(), but it seems that the engine keeps stacking instances internally and increasing memory usage. It seems that there is no way of detaching a shape/collision from the engine.
The text was updated successfully, but these errors were encountered: