Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.00

Description

Description:

Returns a bounding box of given object in model coordinate space. If an object has been setScale, then this is taken into account.

Note: Man-type objects that are scaled do not have their bounding box adjusted.

Syntax

Syntax:boundingBox object
Parameters:
  • object : Object - Unit, vehicle or object.
Return Value:
Array - An array with the extreme points of the model.

Format: [[minX, minY, minZ], [maxX, maxY, maxZ]]

Alternative Syntax

Syntax:boundingBox [object, lod] (V1.65+ and V2.03+)
Parameters:
  • object : Object - Unit, vehicle, or object (be aware that for vehicles, the returned bounding box is larger than might be expected - it includes eventual proxies, and has a factor of 1.2 applied.
  • lod : String - LOD to examine. Can be "FIRE", "VIEW", or "GEOM". If the LOD does not exist, the same values as for the default syntax are returned.
    V3.2+: "PHYSX" returns bounding box for PhysX vehicles, or [0,0,0] for non PhysX ones.
Return Value:Array - [[minX, minY, minZ], [maxX, maxY, maxZ]]

Examples

Examples:
_box = boundingBox bus1; // Might return: [[-2.1,-4.7,-2.5],[2.1,4.7,2.5]]
_box = boundingBox [bus1,"FIRE"]

Additional Information

See also: sizeOf, boundingCenter
Multiplayer: 
Problems: 

Notes