Page MenuHomeFeedback Tracker

[Feature Request] drawBoundingBox
New, NormalPublic

Description

Drawing a bounding box requires an elaborate script function which looks like this

bb = {
	_bbx = [_this select 0 select 0, _this select 1 select 0];
	_bby = [_this select 0 select 1, _this select 1 select 1];
	_bbz = [_this select 0 select 2, _this select 1 select 2];
	_arr = [];
	0 = {
		_y = _x;
		0 = {
			_z = _x;
			0 = {
				0 = _arr pushBack (_obj modelToWorld [_x,_y,_z]);
			} count _bbx;
		} count _bbz;
		reverse _bbz;
	} count _bby;
	_arr pushBack (_arr select 0);
	_arr pushBack (_arr select 1);
	_arr
};
bbox = (0 boundingBox _obj) call bb;
bboxr = (0 boundingBoxReal _obj) call bb;
for "_i" from 0 to 7 step 2 do {
	drawLine3D [
		bbox select _i,
		bbox select (_i + 2),
		[0,0,1,1]
	];
	drawLine3D [
		bboxr select _i,
		bboxr select (_i + 2),
		[0,1,0,1]
	];
	drawLine3D [
		bbox select (_i + 2),
		bbox select (_i + 3),
		[0,0,1,1]
	];
	drawLine3D [
		bboxr select (_i + 2),
		bboxr select (_i + 3),
		[0,1,0,1]
	];
	drawLine3D [
		bbox select (_i + 3),
		bbox select (_i + 1),
		[0,0,1,1]
	];
	drawLine3D [
		bboxr select (_i + 3),
		bboxr select (_i + 1),
		[0,1,0,1]
	];
};

A dedicated SQF command to draw bounding box would be used by many modders

something like

addMissionEventHandler [
	'Draw3D',
	{
		0 drawBoundingBox cursorObject;			// 0 being the boundingbox clipping type, similar to "boundingBoxReal" alt syntax
	}
];

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General

Event Timeline