Description
Returns axis-aligned bounding box (AABB) of a orientated bounding box (OBB) based on entity's rotation.
Arguments
1 Vector minMinimum extent of an OBB in local coordinates.
2 Vector maxMaximum extent of an OBB in local coordinates.
Returns
1 Vector Minimum extent of the AABB relative to entity's position.
2 Vector Maximum extent of the AABB relative to entity's position.
Example
The entity's AABB center (regardless of model origin) is stored in 'pos'.
Output: pos has the coordinates of the AABB center.
Example
If developer is set to 1, displays entity's OBB and it's AABB based on entity's rotation.
The OBB can be any bounding box, not simply OBB of the model/entity.
local e
= Entity(
123 )
local minsB, maxsB
= e:
OBBMins(),
e:
OBBMaxs()
local minsA, maxsA
= e:
GetRotatedAABB( minsB, maxsB )
debugoverlay.
Box(
e:
GetPos(), minsA, maxsA,
10,
Color(
255,
255,
255,
32 ) )
debugoverlay.
BoxAngles(
e:
GetPos(), minsB, maxsB,
e:
GetAngles(),
10,
Color(
255,
0,
255,
32 ) )
Output: Pink = OBB, white = AABB