Hello.
Is it possible to ignore raycast for individual CollidableReference?
[v2] Disable raycast for CollidableReference
-
- Posts: 7
- Joined: Fri Feb 15, 2019 2:03 pm
Re: [v2] Disable raycast for CollidableReference
The specific API depends on what exactly is being tested- a specific Mesh versus the whole Simulation for example- but there is typically some callback provided to the query that lets you perform arbitrary filtering and result processing logic.
For example, the Simulation.RayCast takes a IRayHitHandler, which provides:
If AllowTest returns false for a given collidable, further testing (and OnRayHit) will not be executed.
For example, the Simulation.RayCast takes a IRayHitHandler, which provides:
Code: Select all
bool AllowTest(CollidableReference collidable);
void OnRayHit(in RayData ray, ref float maximumT, float t, in Vector3 normal, CollidableReference collidable);