Garry's Mod Wiki

Revision Difference

util.IntersectRayWithOBB#517959

<function name="IntersectRayWithOBB" parent="util" type="libraryfunc"> <description>Performs a "ray" box intersection and returns position, normal and the fraction.</description> <realm>Shared</realm> <args> <arg name="rayStart" type="Vector">Origin/start position of the ray.</arg> <arg name="rayDelta" type="Vector">The ray vector itself. This can be thought of as: the ray end point relative to the start point.&#xA;&#xA;Note that in this implementation, the ray is not infinite - it&#x27;s only a segment.</arg> <arg name="rayDelta" type="Vector">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.</arg> <arg name="boxOrigin" type="Vector">The center of the box.</arg> <arg name="boxAngles" type="Angle">The angles of the box.</arg> <arg name="boxMins" type="Vector">The min position of the box.</arg> <arg name="boxMaxs" type="Vector">The max position of the box.</arg> </args> <rets> <ret name="" type="Vector">Hit position, nil if not hit.</ret> <ret name="" type="Vector">Normal/direction vector, nil if not hit.</ret> <ret name="" type="number">Fraction of trace used, nil if not hit.</ret> </rets> </function>