Garry's Mod Wiki

Revision Difference

Entity:GetRotatedAABB#515595

<function name="GetRotatedAABB" parent="Entity" type="classfunc">⤶ <description>Returns the min and max of the entity's axis-aligned bounding box.</description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="min" type="Vector">Minimum extent of the bounding box.</arg>⤶ <arg name="max" type="Vector">Maximum extent of the bounding box.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="Vector">Minimum extent of the AABB</ret>⤶ <ret name="" type="Vector">Maximum extent of the AABB</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>The entity's AABB center (regardless of model origin) is stored in 'pos'.</description>⤶ <code>⤶ local a, b = ent:GetRotatedAABB( v:OBBMins(), v:OBBMaxs() )⤶ local pos = ( ent:GetPos() + ( a + b ) / 2 )⤶ </code>⤶ <output>pos has the coordinates of the AABB center.</output>⤶ ⤶ </example>