Entity/GetRotatedAABB

From Garry's Mod
Jump to: navigation, search
 Entity:GetRotatedAABB( )

Contents

Description

Returns the min and max of the entity's axis-aligned bounding box.

Arguments

Vector min

Minimum extent of the bounding box.

Arguments

Vector max

Maximum extent of the bounding box.

Returns

Vector

Minimum extent of the AABB

Returns

Vector

Maximum extent of the AABB

Examples

Example

The entity's AABB center (regardless of model origin) is stored in 'pos'.

local a, b = ent:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() )
local pos = ( ent:GetPos() + ( a + b ) / 2 )

Output:

pos has the coordinates of the AABB center.
Personal tools
Navigation