Api Ray
struct

Ray

public sealed struct Ray

A struct describing an origin and direction

Constructors

Ray(Vector3 origin, Vector3 direction)

Properties

Name Type Description
Position Vector3 Origin of the ray.
Forward Vector3 Direction of the ray.

Methods

Ray ToLocal(Transform tx)

Convert a ray to be local to this transform

Ray ToWorld(Transform tx)

Convert a ray from being local to this transform

Vector3 Project(Single distance)

Returns a point on the ray at given distance.

distance — How far from the Position the point should be.
returns — The point at given distance.
Assembly: Sandbox.System Full Name: Ray