Garry's Mod Wiki

util.IntersectRayWithPlane

  Vector util.IntersectRayWithPlane( Vector rayOrigin, Vector rayDirection, Vector planePosition, Vector planeNormal )

Description

Performs a ray-plane intersection and returns the hit position or nil.

Arguments

1 Vector rayOrigin
Origin/start position of the ray.
2 Vector rayDirection
The direction of the ray.
3 Vector planePosition
Any position of the plane.
4 Vector planeNormal
The normal vector of the plane.

Returns

1 Vector
The position of intersection, nil if not hit.