Ray ToLocal( Transform& tx )

book_4_sparkGenerated
code_blocksInput

Description

The ToLocal method of the Ray struct transforms the ray from world space to local space using the provided Transform reference. This is useful when you need to work with rays in the local coordinate system of a specific object or component.

Usage

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 given transform.

Example

// 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'.