-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into versioning
- Loading branch information
Showing
15 changed files
with
149 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
File: fn_3dPreviewDisplay.sqf | ||
Author: KLM | ||
Description: | ||
Called to change the object in the 3d preview. | ||
*/ | ||
|
||
if !(params [["_className", "", [""]]]) exitWith {}; | ||
|
||
if (isNil "life_3dPreview_camera" || {isNull life_3dPreview_camera}) exitWith {}; | ||
|
||
private _isInCfg = (isClass (configFile >> "CfgVehicles" >> _className)); | ||
if (_isInCfg) then { | ||
if (isNull life_3dPreview_object || {!(_className isEqualTo typeOf life_3dPreview_object)}) then { | ||
if (!isNull life_3dPreview_object) then {deleteVehicle life_3dPreview_object;}; | ||
private _object = _className createVehicleLocal [0, 0, 0]; | ||
if (isNull _object) exitWith {diag_log format ["3dPreview - problem creating object: %1", _className]}; | ||
life_3dPreview_object = _object; | ||
life_3dPreview_object enableSimulation false; | ||
life_3dPreview_object setPos life_3dPreview_position; | ||
life_3dPreview_object setVectorUp [0, 0, 1]; | ||
private _bodyDiagonal = [boundingBoxReal _object select 0 select 0, boundingBoxReal _object select 0 select 2] distance [boundingBoxReal _object select 1 select 0, boundingBoxReal _object select 1 select 2]; | ||
private _distance = _bodyDiagonal * 2; | ||
life_3dPreview_camera_target = getPos _object; | ||
life_3dPreview_camera camSetTarget life_3dPreview_camera_target; | ||
life_3dPreview_camera camSetPos (_object modelToWorld [0, _distance, _distance * 0.3]); | ||
life_3dPreview_camera setVectorUp [0, 0, 1]; | ||
life_3dPreview_camera camCommit 0; | ||
life_3dPreview_camera_mag = vectorMagnitude (life_3dPreview_object worldToModel (getPos life_3dpreview_camera)); | ||
life_3dPreview_camera_zoom = life_3dPreview_camera_mag; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
File: fn_3dPreviewExit.sqf | ||
Author: KLM | ||
Description: | ||
Handles the cleanup of the 3d preview. | ||
*/ | ||
|
||
if !(params [["_display", displayNull, [displayNull]]]) exitWith {}; | ||
|
||
// delete objects | ||
if (!isNull life_3dPreview_object) then {deleteVehicle life_3dPreview_object;}; | ||
deleteVehicle life_3dPreview_light; | ||
life_3dPreview_camera cameraEffect ["Terminate", "BACK"]; | ||
camDestroy life_3dPreview_camera; | ||
// nil variables | ||
life_3dPreview_position = nil; | ||
life_3dPreview_object = nil; | ||
life_3dPreview_light = nil; | ||
life_3dPreview_camera = nil; | ||
life_3dPreview_camera_mag = nil; | ||
life_3dPreview_camera_zoom = nil; | ||
life_3dPreview_camera_target = nil; | ||
life_3dPreview_dragging = nil; | ||
// remove event handlers | ||
_display displayRemoveEventHandler ["MouseButtonDown", life_3dPreview_evh_down]; | ||
life_3dPreview_evh_down = nil; | ||
_display displayRemoveEventHandler ["MouseButtonUp", life_3dPreview_evh_up]; | ||
life_3dPreview_evh_up = nil; | ||
_display displayRemoveEventHandler ["MouseMoving", life_3dPreview_evh_move]; | ||
life_3dPreview_evh_move = nil; | ||
_display displayRemoveEventHandler ["MouseZChanged", life_3dPreview_evh_zoom]; | ||
life_3dPreview_evh_zoom = nil; |
Oops, something went wrong.