Garry's Mod Wiki
Description
Performs a Ray-OBB (Orientated Bounding Box) intersection and returns position, normal and the fraction if there was an intersection.
Arguments
direction * distance
Note that in this implementation, the ray is not infinite - it's only a segment.
Returns
Example
Simple example showing example usage of the function with visualization. Enter developer 1
into the in-game console, and look at any entity. Will display a red box if there is no intersection, a green one if there is an intersection.
Please note that while the example uses an entity to generate a box, it is not necessary. The whole point is to perform intersection checks against non physical objects, for example an in-world user interface screen, or testing if a player (or an NPC) is looking at a certain part of a map.
This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.
Page content is automatically updated twice a day. Edits and history are not available.
Last Parsed: Loading...