The ToLocal
method transforms a Ray
from world space to local space using a given Transform
. This is useful when you need to work with rays in the context of a specific object's local coordinate system.
The ToLocal
method transforms a Ray
from world space to local space using a given Transform
. This is useful when you need to work with rays in the context of a specific object's local coordinate system.
To use the ToLocal
method, you need to have a Ray
instance and a Transform
reference. The method will return a new Ray
that represents the original ray in the local space of the provided transform.
// Assume 'ray' is a Ray instance and 'transform' is a Transform instance Ray localRay = ray.ToLocal(ref transform); // Now 'localRay' is the representation of 'ray' in the local space of 'transform'.