boundingBoxReal: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|seealso= ?\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1 $2")
m (Some wiki formatting)
Line 10: Line 10:
|descr= [[Image:Boundingbox.jpg|right|200px]] Returns a raw bounding box of given object in model coordinates space. This command is similar to [[boundingBox]] but gives more precise measurements.<br><br>
|descr= [[Image:Boundingbox.jpg|right|200px]] Returns a raw bounding box of given object in model coordinates space. This command is similar to [[boundingBox]] but gives more precise measurements.<br><br>


{{GVI|arma3|1.92|}} An alternative syntax was introduced allowing to specify clipping type to be used, which in some cases could make bounding boxes even more precise. The output of both syntaxes was also extended to include bounding sphere diameter, identical to '''half of''' [[sizeOf]] return value.
{{GVI|arma3|1.92|}} An alternative syntax was introduced allowing to specify clipping type to be used, which in some cases could make bounding boxes even more precise. The output of both syntaxes was also extended to include bounding sphere radius, identical to '''half''' of [[sizeOf]] return value.


|s1= [[boundingBoxReal]] object
|s1= [[boundingBoxReal]] object
Line 30: Line 30:
|r2= [[Array]] - the extreme points of the model in format [[Position#PositionRelative|PositionRelative]], as well as bounding box sphere diameter, to format [<nowiki/>[xmin, ymin, zmin],[xmax, ymax, zmax], boundingSphereDiameter].
|r2= [[Array]] - the extreme points of the model in format [[Position#PositionRelative|PositionRelative]], as well as bounding box sphere diameter, to format [<nowiki/>[xmin, ymin, zmin],[xmax, ymax, zmax], boundingSphereDiameter].


|x1= <code>_bbr = [[boundingBoxReal]] [[vehicle]] [[player]];
|x1= <sqf>
_p1 = _bbr [[select]] 0;
private _bbr = boundingBoxReal vehicle player;
_p2 = _bbr [[select]] 1;
private _p1 = _bbr select 0;
_maxWidth = [[abs]] ((_p2 [[select]] 0) - (_p1 [[select]] 0));
private _p2 = _bbr select 1;
_maxLength = [[abs]] ((_p2 [[select]] 1) - (_p1 [[select]] 1));
private _maxWidth = abs ((_p2 select 0) - (_p1 select 0));
_maxHeight = [[abs]] ((_p2 [[select]] 2) - (_p1 [[select]] 2));
private _maxLength = abs ((_p2 select 1) - (_p1 select 1));
</code>
private _maxHeight = abs ((_p2 select 2) - (_p1 select 2));
</sqf>


|x2= <code>[[hint]] [[str]] (0 [[boundingBoxReal]] [[cursorObject]]);</code>
|x2= <sqf>hint str (0 boundingBoxReal cursorObject);</sqf>


|seealso= [[boundingBox]] [[sizeOf]] [[boundingCenter]]
|seealso= [[boundingBox]] [[sizeOf]] [[boundingCenter]]
}}
}}

Revision as of 09:30, 20 April 2022

Hover & click on the images for description

Description

Description:
Boundingbox.jpg
Returns a raw bounding box of given object in model coordinates space. This command is similar to boundingBox but gives more precise measurements.

Arma 3 logo black.png1.92 An alternative syntax was introduced allowing to specify clipping type to be used, which in some cases could make bounding boxes even more precise. The output of both syntaxes was also extended to include bounding sphere radius, identical to half of sizeOf return value.
Groups:
Object Manipulation

Syntax

Syntax:
boundingBoxReal object
Parameters:
object: Object
Return Value:
Array - the extreme points of the model in format PositionRelative, as well as bounding box sphere diameter, to format [[xmin, ymin, zmin],[xmax, ymax, zmax], boundingSphereDiameter].

Alternative Syntax

Syntax:
clippingType boundingBoxReal object Arma 3 logo black.png1.92
Parameters:
clippingType: Number - can be one of:
  • 0 - ClipVisual (could significantly reduce the size of bounding boxes on buildings)
  • 1 - ClipShadow
  • 2 - ClipGeometry
  • 3 - ClipGeneral (same type that is used in main syntax)
object: Object
Return Value:
Array - the extreme points of the model in format PositionRelative, as well as bounding box sphere diameter, to format [[xmin, ymin, zmin],[xmax, ymax, zmax], boundingSphereDiameter].

Examples

Example 1:
private _bbr = boundingBoxReal vehicle player; private _p1 = _bbr select 0; private _p2 = _bbr select 1; private _maxWidth = abs ((_p2 select 0) - (_p1 select 0)); private _maxLength = abs ((_p2 select 1) - (_p1 select 1)); private _maxHeight = abs ((_p2 select 2) - (_p1 select 2));
Example 2:
hint str (0 boundingBoxReal cursorObject);

Additional Information

See also:
boundingBox sizeOf boundingCenter

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note