Description
The NormalToLocal
method of the Transform
struct converts a normal vector from world space to local space. This is useful when you need to transform a normal vector that is defined in the global coordinate system into the local coordinate system of a specific object or entity.
Usage
To use the NormalToLocal
method, you need to have a Transform
instance. Pass the world space normal vector as a reference parameter to the method. The method will return the corresponding normal vector in local space.
Example
// Example of using NormalToLocal
Transform transform = new Transform();
Vector3 worldNormal = new Vector3(0, 1, 0); // Example world normal
Vector3 localNormal = transform.NormalToLocal(ref worldNormal);
// localNormal now contains the normal vector in local space