Page 1 of 1

[v2] Disable raycast for CollidableReference

Posted: Wed Mar 06, 2019 12:00 pm
by AlexCereus
Hello.

Is it possible to ignore raycast for individual CollidableReference?

Re: [v2] Disable raycast for CollidableReference

Posted: Wed Mar 06, 2019 7:25 pm
by Norbo
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:

Code: Select all

        bool AllowTest(CollidableReference collidable);
        void OnRayHit(in RayData ray, ref float maximumT, float t, in Vector3 normal, CollidableReference collidable);
If AllowTest returns false for a given collidable, further testing (and OnRayHit) will not be executed.