Created
November 10, 2016 20:42
-
-
Save GeorgeDettmer/fc4199beda4f042d89d357d592db1e4c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
cursorObject spawn { | |
diag_log ("#################################################################################################################################" + typeOf _this); | |
_box = boundingBoxReal _this; | |
{ | |
_sel = []; _nsel = []; | |
for "_i" | |
from (_box select 0 select 2) | |
to (_box select 1 select 2) | |
step 0.1 do { | |
for "_j" | |
from (_box select 0 select 0) | |
to (_box select 1 select 0) | |
step 0.1 do { | |
{ | |
_s = _x select 0; | |
if ( | |
_this selectionPosition _s distance [0,0,0] > 0 | |
) then { | |
_sel = (_sel - [_s]) + [_s]; | |
} else { | |
_nsel = (_nsel - [_s]) + [_s]; | |
}; | |
} forEach call { | |
_p1 = _this modeltoWorld [_j,_box select 0 select 1,_i]; | |
_p2 = _this modelToWorld [_j,_box select 1 select 1,_i]; | |
drawLine3D [_p1, _p2, [1,0,0,1]]; | |
[_this, _x] intersect [_p1, _p2] | |
}; | |
}; | |
}; | |
diag_log (_x + ": " + str _sel); | |
diag_log (_x + ": " + str _nsel); | |
} forEach ["VIEW","GEOM","FIRE"]; | |
diag_log ("#################################################################################################################################" + typeOf _this); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment