util.IntersectRayWithOBB

From Garry's Mod
Jump to: navigation, search
 util.IntersectRayWithOBB( )

Contents

Description

Performs a "ray" box intersection and returns position, normal and the fraction.

Arguments

Vector rayStart

Origin/start position of the ray.

Arguments

Vector rayDelta

The ray vector itself. This can be thought of as: the ray end point relative to the start point.

Note that in this implementation, the ray is not infinite - it's only a segment.

Arguments

Vector boxOrigin

The center of the box.

Arguments

Angle boxAngles

The angles of the box.

Arguments

Vector boxMins

The min position of the box.

Arguments

Vector boxMaxs

The max position of the box.

Returns

Vector

Hit position, nil if not hit.

Returns

Vector

Normal/direction vector, nil if not hit.

Returns

number

Fraction of trace used, nil if not hit.
Personal tools
Navigation