Advertisement
KRDucky

BoundingBox

Feb 15th, 2016
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.31 KB | None | 0 0
  1. ******************************************************************************************
  2. // * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
  3. // ******************************************************************************************
  4. // @file Name: fn_boundingBoxReal.sqf
  5. // @file Author: AgentRev
  6.  
  7. // Since BIS are unable to make a command that returns the actual, genuine bounding box of an object (boundingBoxReal is shit and boundingBox is ever shittier),
  8. // I decided to extract the bounding boxes using an intersect scanner I made, which is at the bottom of this file
  9.  
  10. private ["_vehicle", "_vehClass", "_realBoundingBoxes", "_boundingBoxReal"];
  11. _vehicle = _this;
  12. _vehClass = typeOf _vehicle;
  13.  
  14. _realBoundingBoxes =
  15. [
  16. // Vehicle variants are ordered according to their class inheritance, disrupting those orders can cause unexpected results
  17. [
  18. "ReammoBox_F",
  19. [
  20. ["Box_NATO_Wps_F", [[-0.5,-0.4,-0.2],[0.6,0.4,0.2]]],
  21. ["Box_NATO_WpsSpecial_F", [[-0.8,-0.4,-0.2],[0.8,0.3,0.2]]],
  22. ["Box_NATO_Ammo_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  23. ["Box_NATO_AmmoOrd_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  24. ["Box_NATO_Grenades_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  25. ["Box_NATO_Support_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  26. ["Box_NATO_WpsLaunch_F", [[-0.8,-0.2,-0.2],[0.8,0.2,0.2]]],
  27. ["Box_NATO_AmmoVeh_F", [[-0.8,-0.8,-0.8],[0.8,0.8,0.8]]],
  28. ["Box_East_Wps_F", [[-0.5,-0.4,-0.2],[0.6,0.4,0.2]]],
  29. ["Box_East_WpsSpecial_F", [[-0.8,-0.4,-0.2],[0.8,0.3,0.2]]],
  30. ["Box_East_Ammo_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  31. ["Box_East_AmmoOrd_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  32. ["Box_East_Grenades_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  33. ["Box_East_Support_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  34. ["Box_East_WpsLaunch_F", [[-0.8,-0.2,-0.2],[0.8,0.2,0.2]]],
  35. ["Box_East_AmmoVeh_F", [[-0.8,-0.8,-0.8],[0.8,0.8,0.8]]],
  36. ["Box_IND_Wps_F", [[-0.5,-0.4,-0.2],[0.6,0.4,0.2]]],
  37. ["Box_IND_WpsSpecial_F", [[-0.8,-0.4,-0.2],[0.8,0.3,0.2]]],
  38. ["Box_IND_Ammo_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  39. ["Box_IND_AmmoOrd_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  40. ["Box_IND_Grenades_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  41. ["Box_IND_Support_F", [[-0.2,-0.3,-0.3],[0.3,0.4,0.3]]],
  42. ["Box_IND_WpsLaunch_F", [[-0.8,-0.2,-0.2],[0.8,0.2,0.2]]],
  43. ["Box_IND_AmmoVeh_F", [[-0.8,-0.8,-0.8],[0.8,0.8,0.8]]],
  44. ["B_supplyCrate_F", [[-0.8,-0.6,-12.1],[0.8,0.6,-10.7]]],
  45. ["C_supplyCrate_F", [[-0.8,-0.6,-12.1],[0.8,0.6,-10.7]]]
  46. ]
  47. ],
  48. [
  49. "Truck_F",
  50. [
  51. ["C_Van_01_box_F", [[-1.2,-3.5,-1.9],[1.2,2.2,1.5]]],
  52. ["C_Van_01_fuel_F", [[-1.2,-3.3,-1.9],[1.2,2.2,1]]],
  53. ["I_G_Van_01_fuel_F", [[-1.2,-3.3,-1.9],[1.2,2.2,1]]],
  54. ["Van_01_base_F", [[-1.2,-3.5,-1.9],[1.2,2.2,0.8]]],
  55. ["B_Truck_01_ammo_F", [[-1.2,-4.8,-2],[1.3,5.1,1.6]]],
  56. ["B_Truck_01_box_F", [[-1.3,-5.8,-2.3],[1.3,5.2,2.2]]],
  57. ["B_Truck_01_fuel_F", [[-1.2,-5.1,-2],[1.3,5,1.6]]],
  58. ["B_Truck_01_medical_F", [[-1.4,-5.1,-2.2],[1.1,5.1,1.3]]],
  59. ["B_Truck_01_Repair_F", [[-1.3,-5.8,-2.3],[1.3,5.2,2.2]]],
  60. ["B_Truck_01_mover_F", [[-1.2,-4.2,-2],[1.3,4.8,1.1]]],
  61. ["Truck_01_base_F", [[-1.2,-5.1,-2.3],[1.3,5.1,1.3]]],
  62. ["O_Truck_02_ammo_F", [[-1.4,-5.4,-2.4],[1.3,2.8,1]]],
  63. ["O_Truck_02_medical_F", [[-1.5,-3.8,-2.4],[1.2,4.1,1]]],
  64. ["O_Truck_02_box_F", [[-1.4,-5.4,-2.4],[1.3,2.8,1]]],
  65. ["O_Truck_02_fuel_F", [[-1.3,-5.1,-2.4],[1.3,2.8,0.9]]],
  66. ["I_Truck_02_ammo_F", [[-1.4,-5.4,-2.4],[1.3,2.8,1]]],
  67. ["I_Truck_02_medical_F", [[-1.5,-3.8,-2.4],[1.2,4.1,1]]],
  68. ["I_Truck_02_box_F", [[-1.4,-5.4,-2.4],[1.3,2.8,1]]],
  69. ["I_Truck_02_fuel_F", [[-1.3,-5.1,-2.4],[1.3,2.8,0.9]]],
  70. ["Truck_02_base_F", [[-1.3,-3.8,-2.4],[1.4,4.1,1]]],
  71. ["O_Truck_03_ammo_F", [[-1.6,-5.3,-2.1],[1.7,3.5,1.4]]],
  72. ["O_Truck_03_device_F", [[-1.6,-5.3,-2.1],[1.7,3.5,1.2]]],
  73. ["O_Truck_03_fuel_F", [[-1.6,-5.2,-2.2],[1.7,3.5,1.2]]],
  74. ["O_Truck_03_medical_F", [[-1.6,-5.1,-2.4],[1.7,3.7,1.3]]],
  75. ["O_Truck_03_repair_F", [[-1.6,-5.3,-2.1],[1.7,3.5,1.3]]],
  76. ["Truck_03_base_F", [[-1.6,-5.1,-2.4],[1.7,3.7,1.4]]],
  77. ["CUP_B_BM21_CDF", [[-1.3,-3.2,-2],[1.4,4.1,1.3]]],
  78. ["CUP_B_Ural_CDF", [[-1.3,-3.4,-2.1],[1.3,4.2,1]]],
  79. ["CUP_B_Ural_Empty_CDF", [[-1.3,-3.1,-2],[1.3,4.2,1]]],
  80. ["CUP_B_Ural_Open_CDF", [[-1.3,-3.4,-2.2],[1.3,4.2,0.7]]]
  81. ]
  82. ],
  83. [
  84. "Tank_F",
  85. [
  86. ["B_APC_Tracked_01_AA_F", [[-2.3,-4.9,-2.8],[2.3,2.7,0.8]]],
  87. ["B_APC_Tracked_01_CRV_F", [[-2.3,-4.9,-2.4],[2.3,3.8,0.8]]],
  88. ["CUP_B_M113_USA", [[-0.9,-2.6,-2.6],[1.8,2.6,0.2]]],
  89. ["CUP_B_M163_USA", [[-0.8,-2.2,-2.1],[1.9,2.7,0.9]]],
  90. ["CUP_M1_Abrams_base", [[-1.9,-4.6,-4.1],[1.8,4.8,0.3]]],
  91. ["CUP_M1A2_TUSK_base", [[-2.1,-4.8,-4.1],[2,4.9,0.7]]],
  92. ["CUP_B_M270_DPICM_USA", [[-1.6,-3.7,-2.4],[1.5,3.5,0.4]]],
  93. ["CUP_B_M270_DPICM_USMC", [[-1.6,-3.7,-2.4],[1.5,3.5,0.4]]],
  94. ["CUP_B_M270_HE_USA", [[-1.6,-3.7,-2.4],[1.5,3.5,0.4]]],
  95. ["CUP_B_M270_HE_USMC", [[-1.6,-3.7,-2.4],[1.5,3.5,0.4]]],
  96. ["CUP_B_T72_CDF", [[-1.8,-4.6,-1.9],[1.8,5.1,0.9]]],
  97. ["APC_Tracked_01_base_F", [[-2.3,-4.9,-2.4],[2.3,2.6,0.7]]],
  98. ["O_APC_Tracked_02_AA_F", [[-1.9,-5,-2.6],[2,2.5,0.6]]],
  99. ["APC_Tracked_02_base_F", [[-1.9,-5,-2.4],[2,2.5,1.1]]],
  100. ["APC_Tracked_03_base_F", [[-1.7,-3.8,-2.3],[1.7,2.9,0.8]]],
  101. ["MBT_01_arty_base_F", [[-2.3,-5.6,-2.9],[2.4,5.6,1.1]]],
  102. ["MBT_01_mlrs_base_F", [[-2.3,-4.5,-1.7],[2.4,2.9,2.1]]],
  103. ["B_MBT_01_TUSK_F", [[-2.3,-4.5,-2.5],[2.4,4.2,0.3]]],
  104. ["MBT_01_base_F", [[-2.3,-4.5,-2.1],[2.4,4.2,0.7]]],
  105. ["MBT_02_arty_base_F", [[-2,-5.5,-2.6],[2.1,5.7,1]]],
  106. ["MBT_02_base_F", [[-1.8,-5,-2.2],[1.8,5.1,0.9]]],
  107. ["MBT_03_base_F", [[-2.2,-5.8,-2.2],[2.2,5.2,1.1]]]
  108. ]
  109. ],
  110. [
  111. "Car_F",
  112. [
  113. ["Kart_01_Base_F", [[-0.6,-0.9,-1.1],[0.7,1.2,-0.4]]],
  114. ["Quadbike_01_base_F", [[-0.6,-1.2,-1.7],[0.6,1.1,-0.4]]],
  115. ["Hatchback_01_base_F", [[-1,-2.6,-1.5],[0.9,2.3,0.3]]],
  116. ["Offroad_01_armed_base_F", [[-1.1,-2.9,-2.3],[1.1,2.8,0.3]]],
  117. ["CUP_B_BRDM2_ATGM_CDF", [[-1.2,-2.7,-2.1],[1.2,3.1,1.1]]],
  118. ["CUP_B_BRDM2_CDF", [[-1.2,-2.7,-2.4],[1.2,3.1,0.4]]],
  119. ["CUP_B_BRDM2_HQ_CDF", [[-1.2,-2.7,-2.5],[1.2,3.1,0.3]]],
  120. ["CUP_B_Dingo_Des", [[-1.2,-3.2,-2.7],[1.2,3.2,0.8]]],
  121. ["CUP_B_Dingo_GL_Des", [[-1.2,-3.2,-2.8],[1.3,3.2,0.7]]],
  122. ["CUP_B_Dingo_GL_Wdl", [[-1.2,-3.2,-2.8],[1.3,3.2,0.7]]],
  123. ["CUP_B_Dingo_Wdl", [[-1.2,-3.2,-2.7],[1.2,3.2,0.8]]],
  124. ["CUP_B_HMMWV_AGS_GPK_ACR", [[-1.2,-2.6,-2.4],[1.2,2.3,0.2]]],
  125. ["CUP_B_HMMWV_Ambulance_ACR", [[-1.2,-2.5,-2.3],[1.2,2.9,0.5]]],
  126. ["CUP_B_HMMWV_Ambulance_USA", [[-1.2,-2.5,-2.3],[1.2,2.9,0.5]]],
  127. ["CUP_B_HMMWV_Ambulance_USMC", [[-1.2,-2.5,-2.3],[1.2,2.9,0.5]]],
  128. ["CUP_B_HMMWV_Avenger_USA", [[-1.5,-2.7,-3.1],[1,2.2,0]]],
  129. ["CUP_B_HMMWV_Avenger_USMC", [[-1.5,-2.7,-3.1],[1,2.2,0]]],
  130. ["CUP_B_HMMWV_Crows_M2_USA", [[-1.2,-2.9,-2.6],[1.2,2.2,-0.6]]],
  131. ["CUP_B_HMMWV_Crows_MK19_USA", [[-1.2,-2.9,-2.6],[1.2,2.2,-0.6]]],
  132. ["CUP_B_HMMWV_DSHKM_GPK_ACR", [[-1.2,-2.6,-2.4],[1.2,2.3,0.2]]],
  133. ["CUP_B_HMMWV_M1114_USMC", [[-1.2,-2.5,-2.6],[1.2,2.3,0.2]]],
  134. ["CUP_B_HMMWV_M2_GPK_ACR", [[-1.2,-2.6,-2.4],[1.2,2.3,0.2]]],
  135. ["CUP_B_HMMWV_M2_GPK_USA", [[-1.2,-2.6,-2.4],[1.2,2.3,0.2]]],
  136. ["CUP_B_HMMWV_M2_USA", [[-1.2,-2.5,-2.6],[1.1,2.2,0.2]]],
  137. ["CUP_B_HMMWV_M2_USMC", [[-1.2,-2.5,-2.6],[1.1,2.2,0.2]]],
  138. ["CUP_B_HMMWV_MK19_USA", [[-1.2,-2.5,-2.6],[1.1,2.2,0.2]]],
  139. ["CUP_B_HMMWV_MK19_USMC", [[-1.2,-2.5,-2.6],[1.1,2.2,0.2]]],
  140. ["CUP_B_HMMWV_SOV_USA", [[-1.2,-2.5,-1.9],[1.2,2.2,0.7]]],
  141. ["CUP_B_HMMWV_TOW_USA", [[-1.2,-2.5,-2.6],[1.1,2.2,0.1]]],
  142. ["CUP_B_HMMWV_TOW_USMC", [[-1.2,-2.5,-2.6],[1.1,2.2,0.1]]],
  143. ["CUP_B_HMMWV_Terminal_USA", [[-1.2,-2.8,-2.3],[1.2,2.5,0.5]]],
  144. ["CUP_B_HMMWV_Transport_USA", [[-1.2,-2.5,-1.5],[1.1,2.2,0.4]]],
  145. ["CUP_B_HMMWV_Unarmed_USA", [[-1.2,-2.5,-2.6],[1.1,2.2,-0.6]]],
  146. ["CUP_B_HMMWV_Unarmed_USMC", [[-1.2,-2.5,-2.6],[1.1,2.2,-0.6]]],
  147. ["CUP_B_LAV25M240_USMC", [[-1.4,-2.9,-4.1],[1.4,3.6,0.3]]],
  148. ["CUP_B_LAV25_HQ_USMC", [[-1.2,-3.1,-3],[1.5,3.6,-0.3]]],
  149. ["CUP_B_LAV25_USMC", [[-1.4,-2.9,-2.6],[1.4,3.6,0.4]]],
  150. ["CUP_B_LR_Ambulance_CZ_D", [[-1.2,-3,-1.8],[1.2,3.3,1.3]]],
  151. ["CUP_B_LR_Ambulance_CZ_W", [[-1.2,-3,-1.8],[1.2,3.3,1.3]]],
  152. ["CUP_B_LR_Ambulance_GB_D", [[-1.2,-3,-1.8],[1.2,3.3,1.3]]],
  153. ["CUP_B_LR_Ambulance_GB_W", [[-1.2,-3,-1.8],[1.2,3.3,1.3]]],
  154. ["CUP_B_LR_MG_CZ_W", [[-1.3,-2.5,-2.3],[1.2,2.9,0.4]]],
  155. ["CUP_B_LR_MG_GB_W", [[-1.3,-2.5,-2.3],[1.2,2.9,0.4]]],
  156. ["CUP_B_LR_Special_CZ_W", [[-1.3,-2.9,-1.9],[1.3,3,1]]],
  157. ["CUP_B_LR_Special_Des_CZ_D", [[-1.3,-2.9,-1.9],[1.3,3,1]]],
  158. ["CUP_B_LR_Transport_CZ_D", [[-1.2,-2.5,-1.9],[1.2,2.9,0.7]]],
  159. ["CUP_B_LR_Transport_CZ_W", [[-1.2,-2.5,-1.9],[1.2,2.9,0.7]]],
  160. ["CUP_B_LR_Transport_GB_D", [[-1.2,-2.5,-1.9],[1.2,2.9,0.7]]],
  161. ["CUP_B_LR_Transport_GB_W", [[-1.2,-2.5,-1.9],[1.2,2.9,0.7]]],
  162. ["CUP_B_UAZ_AGS30_ACR", [[-0.9,-2,-0.1],[1,2,2.5]]],
  163. ["CUP_B_UAZ_AGS30_CDF", [[-0.9,-2,-0.1],[1,2,2.5]]],
  164. ["CUP_B_UAZ_MG_ACR", [[-0.9,-2,-0.1],[1,2,2.5]]],
  165. ["CUP_B_UAZ_MG_CDF", [[-0.9,-2,-0.1],[1,2,2.5]]],
  166. ["CUP_B_UAZ_Open_ACR", [[-0.9,-2.1,-0.1],[1,1.9,2]]],
  167. ["CUP_B_UAZ_Open_CDF", [[-0.9,-2.1,-0.1],[1,1.9,2]]],
  168. ["CUP_B_UAZ_SPG9_ACR", [[-0.9,-2,-0.1],[1,2,2]]],
  169. ["CUP_B_UAZ_SPG9_CDF", [[-0.9,-2,-0.1],[1,2,2]]],
  170. ["CUP_B_UAZ_Unarmed_ACR", [[-0.9,-2.1,-0.1],[1,1.9,2]]],
  171. ["CUP_B_UAZ_Unarmed_CDF", [[-0.9,-2.1,-0.1],[1,1.9,2]]]]],
  172. ["Offroad_01_repair_base_F", [[-1.1,-3,-1.6],[1.1,2.7,0.5]]],
  173. ["Offroad_01_base_F", [[-1.1,-3,-1.7],[1.1,2.7,0.5]]],
  174. ["SUV_01_base_F", [[-1.1,-3.1,-1.7],[1.1,2.4,0.4]]],
  175. ["MRAP_01_gmg_base_F", [[-1.3,-4.7,-2.9],[1.3,1.7,0.9]]],
  176. ["MRAP_01_base_F", [[-1.3,-4.8,-2.2],[1.3,1.7,0.7]]],
  177. ["MRAP_02_hmg_base_F", [[-1.6,-4.9,-2.9],[1.6,1.7,0.8]]],
  178. ["MRAP_02_base_F", [[-1.6,-4.9,-2.4],[1.6,1.7,0.8]]],
  179. ["MRAP_03_hmg_base_F", [[-1.4,-3.3,-2.4],[1.4,2.6,0.5]]],
  180. ["MRAP_03_base_F", [[-1.4,-3.3,-1.9],[1.4,2.6,1]]],
  181. ["APC_Wheeled_01_base_F", [[-1.5,-4.8,-2.6],[1.5,2.8,1]]],
  182. ["APC_Wheeled_02_base_F", [[-1.2,-4.6,-2.6],[1.8,1.9,0.7]]],
  183. ["APC_Wheeled_03_base_F", [[-0.9,-5.1,-2.6],[1.9,2.9,1.2]]],
  184. ["UGV_01_rcws_base_F", [[-0.8,-2.1,-2.1],[1.7,2.1,0.1]]],
  185. ["UGV_01_base_F", [[-0.8,-2.1,-2.1],[1.7,2.1,-0.3]]]
  186. ]
  187. ],
  188. [
  189. "Ship_F",
  190. [
  191. ["SDV_01_base_F", [[-1,-4.1,-1.8],[1,2,1.1]]],
  192. ["Rubber_duck_base_F", [[-1.1,-2.5,-1.5],[1.1,2.4,0]]],
  193. ["CUP_B_RHIB2Turret_USMC", [[-1.7,-3.9,-3.4],[1.7,5.4,0.7]]],
  194. ["CUP_B_RHIB_USMC", [[-1.7,-4,-3.4],[1.7,4.9,0.7]]],
  195. ["CUP_B_Seafox_USMC", [[-1.6,-4.1,-3.7],[1.6,4.8,-1.6]]],
  196. ["C_Boat_Civil_01_police_F", [[-1,-3.4,-1.6],[1,3.6,0.3]]],
  197. ["Boat_Civil_01_base_F", [[-1,-3.4,-1.5],[1,3.6,0.3]]],
  198. ["Boat_Armed_01_base_F", [[-1.9,-5.5,-3.4],[2,6.4,1.3]]],
  199. ["CUP_B_Seafox_USV_USMC", [[-1.6,-4.1,-3.7],[1.6,4.8,-1.6]]]
  200. ]
  201. ],
  202. [
  203. "Air",
  204. [
  205. ["Heli_Light_01_base_F", [[-3.8,-5,-1.4],[3.8,4.3,1.6]]],
  206. ["CUP_CH47F_base", [[-9.3,-14.2,-5.1],[11.5,18,2.9]]],
  207. ["CUP_B_CH53E_USMC", [[-3.8,-20.1,-3.1],[11.9,10.2,8.2]]],
  208. ["CUP_B_MH60S_FFV_USMC", [[-8,-9.9,-3.1],[10,9.7,4.1]]],
  209. ["CUP_B_MH60S_USMC", [[-8,-9.9,-3.1],[10,9.7,4.1]]],
  210. ["CUP_B_MV22_USMC", [[-11.9,-10.6,-5.1],[11.9,13,5.1]]],
  211. ["CUP_B_Mi171Sh_ACR", [[-10.4,-12.6,-5.1],[11.8,16,3.7]]],
  212. ["CUP_B_Mi171Sh_Unarmed_ACR", [[-10.4,-12.6,-5.1],[11.8,16,3.7]]],
  213. ["CUP_B_Mi17_CDF", [[-10.4,-12.6,-4.1],[11.9,12.6,2.7]]],
  214. ["CUP_B_Mi17_medevac_CDF", [[-10.4,-12.6,-4.1],[11.9,12.6,2.7]]],
  215. ["CUP_B_Mi24_D_CDF", [[-10.1,-11.4,-5.1],[10,12,3.7]]],
  216. ["CUP_B_Mi35_CZ", [[-10.1,-11.4,-5.1],[10,12,3.7]]],
  217. ["CUP_C_C47_CIV", [[-14.4,-11.6,-5],[14.4,12,4.8]]],
  218. ["Heli_Transport_01_base_F", [[-7.2,-8.2,-2.3],[7.3,9.4,1.8]]],
  219. ["Heli_Attack_01_base_F", [[-5.7,-8,-1.9],[5.7,6.5,2.1]]],
  220. ["Heli_Light_02_base_F", [[-6.8,-7.8,-2.6],[6.8,8.1,2.5]]],
  221. ["Heli_Attack_02_base_F", [[-6.6,-8.4,-3.2],[6.6,8.5,3.2]]],
  222. ["I_Heli_light_03_unarmed_base_F",[[-5.9,-6.9,-1.6],[5.8,7.7,2.3]]],
  223. ["I_Heli_light_03_base_F", [[-5.9,-6.9,-1.5],[5.8,7.7,2.5]]],
  224. ["Heli_Transport_02_base_F", [[-9.3,-11.2,-3.6],[9.3,11.2,3.6]]],
  225. ["Plane_CAS_01_base_F", [[-8.8,-7.8,-2.3],[8.8,7.7,2.2]]],
  226. ["Plane_CAS_02_base_F", [[-6.5,-8.1,-3],[6.5,7,3]]],
  227. ["Plane_Fighter_03_base_F", [[-5,-6.4,-2.6],[5.1,6.5,2.5]]],
  228. ["UAV_02_base_F", [[-5.1,-3.4,-1.6],[5.1,3.2,0.9]]]
  229. ]
  230. ]
  231. ];
  232.  
  233. {
  234. if (_vehClass isKindOf (_x select 0)) exitWith
  235. {
  236. {
  237. if (_vehClass isKindOf (_x select 0)) exitWith
  238. {
  239. _boundingBoxReal = _x select 1;
  240. };
  241. } forEach (_x select 1);
  242. };
  243. } forEach _realBoundingBoxes;
  244.  
  245. if (isNil "_boundingBoxReal") then { boundingBoxReal _vehicle } else { _boundingBoxReal }
  246.  
  247.  
  248. // Here is the intersect scanner, which is used in the editor. The resulting array is copied into the clipboard.
  249. // Some helicopters (B_Heli_Light_01_armed_F, I_Heli_light_03_F, I_Heli_light_03_unarmed_F, and B_Heli_Transport_01_F) may need to have their minX, maxX, and maxY done manually afterwards,
  250. // since the blades need to be rotated under different angles to calculate the full rotor span, although it isn't necessary in most cases.
  251. // I've done it anyway for the values above.
  252.  
  253. /*
  254. [] spawn
  255. {
  256. _precision = 0.1; comment "change this for higher/lower precision";
  257. _lineColor1 = [0,1,0,1];
  258. _lineColor2 = [1,0,0,1];
  259.  
  260. _parentClasses =
  261. [
  262. "ReammoBox_F",
  263. "Truck_F",
  264. "Tank_F",
  265. "Car_F",
  266. "Ship_F",
  267. "Air",
  268. "All"
  269. ];
  270.  
  271. _vehClasses =
  272. [
  273. ["Box_NATO_Wps_F", "Box_NATO_Wps_F"],
  274. ["Box_NATO_WpsSpecial_F", "Box_NATO_WpsSpecial_F"],
  275. ["Box_NATO_Ammo_F", "Box_NATO_Ammo_F"],
  276. ["Box_NATO_AmmoOrd_F", "Box_NATO_AmmoOrd_F"],
  277. ["Box_NATO_Grenades_F", "Box_NATO_Grenades_F"],
  278. ["Box_NATO_Support_F", "Box_NATO_Support_F"],
  279. ["Box_NATO_WpsLaunch_F", "Box_NATO_WpsLaunch_F"],
  280. ["Box_NATO_AmmoVeh_F", "Box_NATO_AmmoVeh_F"],
  281. ["Box_East_Wps_F", "Box_East_Wps_F"],
  282. ["Box_East_WpsSpecial_F", "Box_East_WpsSpecial_F"],
  283. ["Box_East_Ammo_F", "Box_East_Ammo_F"],
  284. ["Box_East_AmmoOrd_F", "Box_East_AmmoOrd_F"],
  285. ["Box_East_Grenades_F", "Box_East_Grenades_F"],
  286. ["Box_East_Support_F", "Box_East_Support_F"],
  287. ["Box_East_WpsLaunch_F", "Box_East_WpsLaunch_F"],
  288. ["Box_East_AmmoVeh_F", "Box_East_AmmoVeh_F"],
  289. ["Box_IND_Wps_F", "Box_IND_Wps_F"],
  290. ["Box_IND_WpsSpecial_F", "Box_IND_WpsSpecial_F"],
  291. ["Box_IND_Ammo_F", "Box_IND_Ammo_F"],
  292. ["Box_IND_AmmoOrd_F", "Box_IND_AmmoOrd_F"],
  293. ["Box_IND_Grenades_F", "Box_IND_Grenades_F"],
  294. ["Box_IND_Support_F", "Box_IND_Support_F"],
  295. ["Box_IND_WpsLaunch_F", "Box_IND_WpsLaunch_F"],
  296. ["Box_IND_AmmoVeh_F", "Box_IND_AmmoVeh_F"],
  297. ["B_supplyCrate_F", "B_supplyCrate_F"],
  298. ["C_supplyCrate_F", "C_supplyCrate_F"],
  299.  
  300. ["C_Van_01_box_F", "C_Van_01_box_F"],
  301. ["C_Van_01_fuel_F", "C_Van_01_fuel_F"],
  302. ["I_G_Van_01_fuel_F", "I_G_Van_01_fuel_F"],
  303. ["C_Van_01_transport_F", "Van_01_base_F"],
  304. ["B_Truck_01_ammo_F", "B_Truck_01_ammo_F"],
  305. ["B_Truck_01_box_F", "B_Truck_01_box_F"],
  306. ["B_Truck_01_fuel_F", "B_Truck_01_fuel_F"],
  307. ["B_Truck_01_medical_F", "B_Truck_01_medical_F"],
  308. ["B_Truck_01_Repair_F", "B_Truck_01_Repair_F"],
  309. ["B_Truck_01_mover_F", "B_Truck_01_mover_F"],
  310. ["B_Truck_01_covered_F", "Truck_01_base_F"],
  311. ["O_Truck_02_ammo_F", "O_Truck_02_ammo_F"],
  312. ["O_Truck_02_medical_F", "O_Truck_02_medical_F"],
  313. ["O_Truck_02_box_F", "O_Truck_02_box_F"],
  314. ["O_Truck_02_fuel_F", "O_Truck_02_fuel_F"],
  315. ["I_Truck_02_ammo_F", "I_Truck_02_ammo_F"],
  316. ["I_Truck_02_medical_F", "I_Truck_02_medical_F"],
  317. ["I_Truck_02_box_F", "I_Truck_02_box_F"],
  318. ["I_Truck_02_fuel_F", "I_Truck_02_fuel_F"],
  319. ["I_Truck_02_covered_F", "Truck_02_base_F"],
  320. ["O_Truck_03_ammo_F", "O_Truck_03_ammo_F"],
  321. ["O_Truck_03_device_F", "O_Truck_03_device_F"],
  322. ["O_Truck_03_fuel_F", "O_Truck_03_fuel_F"],
  323. ["O_Truck_03_medical_F", "O_Truck_03_medical_F"],
  324. ["O_Truck_03_repair_F", "O_Truck_03_repair_F"],
  325. ["O_Truck_03_covered_F", "Truck_03_base_F"],
  326.  
  327. ["B_APC_Tracked_01_AA_F", "B_APC_Tracked_01_AA_F"],
  328. ["B_APC_Tracked_01_CRV_F", "B_APC_Tracked_01_CRV_F"],
  329. ["B_APC_Tracked_01_rcws_F", "APC_Tracked_01_base_F"],
  330. ["O_APC_Tracked_02_AA_F", "O_APC_Tracked_02_AA_F"],
  331. ["O_APC_Tracked_02_cannon_F", "APC_Tracked_02_base_F"],
  332. ["I_APC_tracked_03_cannon_F", "APC_Tracked_03_base_F"],
  333. ["B_MBT_01_arty_F", "MBT_01_arty_base_F"],
  334. ["B_MBT_01_mlrs_F", "MBT_01_mlrs_base_F"],
  335. ["B_MBT_01_TUSK_F", "B_MBT_01_TUSK_F"],
  336. ["B_MBT_01_cannon_F", "MBT_01_base_F"],
  337. ["O_MBT_02_arty_F", "MBT_02_arty_base_F"],
  338. ["O_MBT_02_cannon_F", "MBT_02_base_F"],
  339. ["I_MBT_03_cannon_F", "MBT_03_base_F"],
  340.  
  341. ["C_Kart_01_F", "Kart_01_Base_F"],
  342. ["C_Quadbike_01_F", "Quadbike_01_base_F"],
  343. ["C_Hatchback_01_F", "Hatchback_01_base_F"],
  344. ["B_G_Offroad_01_armed_F", "Offroad_01_armed_base_F"],
  345. ["C_Offroad_01_repair_F", "Offroad_01_repair_base_F"],
  346. ["C_Offroad_01_F", "Offroad_01_base_F"],
  347. ["C_SUV_01_F", "SUV_01_base_F"],
  348. ["B_MRAP_01_gmg_F", "MRAP_01_gmg_base_F"],
  349. ["B_MRAP_01_F", "MRAP_01_base_F"],
  350. ["O_MRAP_02_hmg_F", "MRAP_02_hmg_base_F"],
  351. ["O_MRAP_02_F", "MRAP_02_base_F"],
  352. ["I_MRAP_03_hmg_F", "MRAP_03_hmg_base_F"],
  353. ["I_MRAP_03_F", "MRAP_03_base_F"],
  354. ["B_APC_Wheeled_01_cannon_F", "APC_Wheeled_01_base_F"],
  355. ["O_APC_Wheeled_02_rcws_F", "APC_Wheeled_02_base_F"],
  356. ["I_APC_Wheeled_03_cannon_F", "APC_Wheeled_03_base_F"],
  357. ["B_UGV_01_rcws_F", "UGV_01_rcws_base_F"],
  358. ["B_UGV_01_F", "UGV_01_base_F"],
  359.  
  360. ["B_SDV_01_F", "SDV_01_base_F"],
  361. ["C_Rubberboat", "Rubber_duck_base_F"],
  362. ["C_Boat_Civil_01_police_F", "C_Boat_Civil_01_police_F"],
  363. ["C_Boat_Civil_01_F", "Boat_Civil_01_base_F"],
  364. ["B_Boat_Armed_01_minigun_F", "Boat_Armed_01_base_F"],
  365.  
  366. ["B_Heli_Light_01_armed_F", "Heli_Light_01_base_F"],
  367. ["B_Heli_Transport_01_F", "Heli_Transport_01_base_F"],
  368. ["B_Heli_Attack_01_F", "Heli_Attack_01_base_F"],
  369. ["O_Heli_Light_02_F", "Heli_Light_02_base_F"],
  370. ["O_Heli_Attack_02_F", "Heli_Attack_02_base_F"],
  371. ["I_Heli_light_03_F", "I_Heli_light_03_base_F"],
  372. ["I_Heli_Transport_02_F", "Heli_Transport_02_base_F"],
  373. ["B_Plane_CAS_01_F", "Plane_CAS_01_base_F"],
  374. ["O_Plane_CAS_02_F", "Plane_CAS_02_base_F"],
  375. ["I_Plane_Fighter_03_CAS_F", "Plane_Fighter_03_base_F"],
  376. ["B_UAV_02_CAS_F", "UAV_02_base_F"]
  377. ];
  378.  
  379. _classesBBox = [];
  380. { _classesBBox pushBack [_x, []] } forEach _parentClasses;
  381.  
  382. _pos = getPosATL player;
  383. _pos set [1, (_pos select 1) + 15];
  384. _pos set [2, (_pos select 2) + 5];
  385.  
  386. _dir = getDir player;
  387. _dir = _dir + 270;
  388.  
  389. {
  390. _class = _x select 0;
  391. _kind = _x select 1;
  392.  
  393. _vehicle = createVehicle [_class, _pos, [], 0, "None"];
  394. _vehicle setDir _dir;
  395. _vehicle enableSimulation false;
  396.  
  397. _minBBox = (boundingBox _vehicle) select 0;
  398. _maxBBox = (boundingBox _vehicle) select 1;
  399.  
  400. _minX = floor (_minBBox select 0);
  401. _minY = floor (_minBBox select 1);
  402. _minZ = floor (_minBBox select 2);
  403.  
  404. _maxX = ceil (_maxBBox select 0);
  405. _maxY = ceil (_maxBBox select 1);
  406. _maxZ = ceil (_maxBBox select 2);
  407.  
  408. _minXreal = _maxX;
  409. _minYreal = _maxY;
  410. _minZreal = _maxZ;
  411.  
  412. _maxXreal = _minX;
  413. _maxYreal = _minY;
  414. _maxZreal = _minZ;
  415.  
  416. comment "intersect is used as a backup because lineIntersects doesn't detect some heli blades, 'GEOM' option is the most accurate for those";
  417. _found = { lineIntersects [ATLtoASL _pos1, ATLtoASL _pos2] || {count ([_vehicle, "GEOM"] intersect [_pos1, _pos2]) > 0} };
  418.  
  419. for "_X" from _minX to _maxX step _precision do
  420. {
  421. for "_Y" from _minY to _maxY step _precision do
  422. {
  423. _pos1 = _vehicle modelToWorld [_X, _Y, _minZ];
  424. _pos2 = _vehicle modelToWorld [_X, _Y, _maxZ];
  425.  
  426. if (call _found) then
  427. {
  428. if (_X < _minXreal) then { _minXreal = _X - _precision };
  429. if (_X >= _maxXreal) then { _maxXreal = _X + _precision };
  430.  
  431. if (_Y < _minYreal) then { _minYreal = _Y - _precision };
  432. if (_Y >= _maxYreal) then { _maxYreal = _Y + _precision };
  433.  
  434. drawLine3D [_pos1, _pos2, _lineColor2];
  435. }
  436. else
  437. {
  438. drawLine3D [_pos1, _pos2, _lineColor1];
  439. };
  440. };
  441. };
  442.  
  443. for "_Y" from _minY to _maxY step _precision do
  444. {
  445. for "_Z" from _minZ to _maxZ step _precision do
  446. {
  447. _pos1 = _vehicle modelToWorld [_minX, _Y, _Z];
  448. _pos2 = _vehicle modelToWorld [_maxX, _Y, _Z];
  449.  
  450. if (call _found) then
  451. {
  452. if (_Y < _minYreal) then { _minYreal = _Y - _precision };
  453. if (_Y >= _maxYreal) then { _maxYreal = _Y + _precision };
  454.  
  455. if (_Z < _minZreal) then { _minZreal = _Z - _precision };
  456. if (_Z >= _maxZreal) then { _maxZreal = _Z + _precision };
  457.  
  458. drawLine3D [_pos1, _pos2, _lineColor2];
  459. }
  460. else
  461. {
  462. drawLine3D [_pos1, _pos2, _lineColor1];
  463. };
  464. };
  465. };
  466.  
  467. for "_Z" from _minZ to _maxZ step _precision do
  468. {
  469. for "_X" from _minX to _maxX step _precision do
  470. {
  471. _pos1 = _vehicle modelToWorld [_X, _minY, _Z];
  472. _pos2 = _vehicle modelToWorld [_X, _maxY, _Z];
  473.  
  474. if (call _found) then
  475. {
  476. if (_X < _minXreal) then { _minXreal = _X - _precision };
  477. if (_X >= _maxXreal) then { _maxXreal = _X + _precision };
  478.  
  479. if (_Z < _minZreal) then { _minZreal = _Z - _precision };
  480. if (_Z >= _maxZreal) then { _maxZreal = _Z + _precision };
  481.  
  482. drawLine3D [_pos1, _pos2, _lineColor2];
  483. }
  484. else
  485. {
  486. drawLine3D [_pos1, _pos2, _lineColor1];
  487. };
  488. };
  489. };
  490.  
  491. _minXreal = (round (_minXreal / _precision)) * _precision;
  492. _minYreal = (round (_minYreal / _precision)) * _precision;
  493. _minZreal = (round (_minZreal / _precision)) * _precision;
  494.  
  495. _maxXreal = (round (_maxXreal / _precision)) * _precision;
  496. _maxYreal = (round (_maxYreal / _precision)) * _precision;
  497. _maxZreal = (round (_maxZreal / _precision)) * _precision;
  498.  
  499. _minReal = [_minXreal, _minYreal, _minZreal];
  500. _maxReal = [_maxXreal, _maxYreal, _maxZreal];
  501.  
  502. {
  503. if (_vehicle isKindOf (_x select 0)) exitWith
  504. {
  505. (_x select 1) pushBack [_kind, [_minReal,_maxReal]];
  506. };
  507. } forEach _classesBBox;
  508.  
  509. deleteVehicle _vehicle;
  510.  
  511. sleep 0.1;
  512.  
  513. } forEach _vehClasses;
  514.  
  515. _validBBoxes = [];
  516.  
  517. {
  518. if (count (_x select 1) > 0) then
  519. {
  520. _validBBoxes pushBack _x;
  521. };
  522. } forEach _classesBBox;
  523.  
  524. copyToClipboard str _validBBoxes;
  525. };
  526. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement