w3dappdata.cpp 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Max2W3d *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/max2w3d/w3dappdata.cpp $*
  25. * *
  26. * Original Author:: Greg Hjelstrom *
  27. * *
  28. * $Author:: Greg_h $*
  29. * *
  30. * $Modtime:: 8/21/01 9:45a $*
  31. * *
  32. * $Revision:: 9 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * Is_Bone -- check if a node is a "bone" *
  37. * Is_Geometry -- Check if an INode is marked for "geometry" export *
  38. * Is_Normal_Mesh -- check if a node is a mesh *
  39. * Is_Camera_Aligned_Mesh -- check if a node is to be a camera aligned mesh *
  40. * Is_Camera_Oriented_Mesh -- check if a node is to be a camera oriented mesh *
  41. * Is_Collision_AABox -- check if a node is a collision box mesh *
  42. * Is_Collision_OBBox -- check if a node is a collision box mesh *
  43. * Is_Skin -- check if a node is a skin *
  44. * Is_Shadow -- check if a node marked to cast shadows *
  45. * Is_Damage -- check if a node is a damage version of a mesh *
  46. * Is_Damage_For_Mesh -- check if a node is a damage version of a particular mesh *
  47. * Is_Physical_Collision -- Is node categorized as "physical collision geometry" *
  48. * Is_Projectile_Collision -- Is node categorized as "projectile collision geometry"? *
  49. * Is_Vis_Collision -- Is node categorized as "vis collision geometry"? *
  50. * Is_Camera_Collision -- Is node categorized as "camera collision geometry"? *
  51. * Is_Hidden -- checks whether the node should be hidden *
  52. * Is_Two_Sided -- Checks whether the node should be two sided *
  53. * Is_ZNormals -- checks if the node should be exported with 0,0,1 vert normals *
  54. * Is_Dazzle -- check if a node is a dazzle object *
  55. * Is_Aggregate -- check if a node is an aggregate object *
  56. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  57. #include "w3dappdata.h"
  58. #include "w3dutil.h"
  59. #include "util.h"
  60. #include "modstack.h"
  61. /***********************************************************************************************
  62. **
  63. ** W3DAppData2Struct Implementation
  64. **
  65. ***********************************************************************************************/
  66. /*
  67. ** Current version of the W3dAppData2 structure
  68. ** History:
  69. ** version 0 - initial implementation.
  70. ** version 1 - added camera collision option, initialize to match physical collision settting
  71. ** when converting from version 0.
  72. */
  73. const int W3DAPPDATA2_CURRENT_VERSION = 1;
  74. W3DAppData2Struct::W3DAppData2Struct(void) :
  75. ExportFlags(0),
  76. GeometryType(0),
  77. GeometryFlags(0),
  78. CollisionFlags(0)
  79. {
  80. memset(UnUsed,0,sizeof(UnUsed));
  81. Init_With_Other_Defaults();
  82. }
  83. W3DAppData2Struct::W3DAppData2Struct(W3DAppData0Struct & olddata) :
  84. ExportFlags(0),
  85. GeometryType(0),
  86. GeometryFlags(0),
  87. CollisionFlags(0)
  88. {
  89. memset(UnUsed,0,sizeof(UnUsed));
  90. Init_From_AppData0(olddata);
  91. }
  92. void W3DAppData2Struct::Init_With_Mesh_Defaults(void)
  93. {
  94. ExportFlags = (EXPORT_TRANSFORM|EXPORT_GEOMETRY);
  95. GeometryType = GEO_TYPE_NORMAL_MESH;
  96. GeometryFlags = 0;
  97. CollisionFlags = 0;
  98. memset(UnUsed,0,sizeof(UnUsed));
  99. Set_Version(W3DAPPDATA2_CURRENT_VERSION);
  100. }
  101. void W3DAppData2Struct::Init_With_Other_Defaults(void)
  102. {
  103. ExportFlags = 0;
  104. GeometryType = 0;
  105. GeometryFlags = 0;
  106. CollisionFlags = 0;
  107. memset(UnUsed,0,sizeof(UnUsed));
  108. Set_Version(W3DAPPDATA2_CURRENT_VERSION);
  109. }
  110. void W3DAppData2Struct::Init_From_AppData0(W3DAppData0Struct & olddata)
  111. {
  112. Init_With_Other_Defaults();
  113. Enable_Export_Transform(olddata.Is_Bone());
  114. Enable_Export_Geometry(olddata.Is_Geometry());
  115. if (olddata.Is_Camera_Aligned_Mesh()) {
  116. Set_Geometry_Type(GEO_TYPE_CAMERA_ALIGNED);
  117. }
  118. if (olddata.Is_Camera_Oriented_Mesh()) {
  119. Set_Geometry_Type(GEO_TYPE_CAMERA_ORIENTED);
  120. }
  121. if (olddata.Is_Collision_AABox()) {
  122. Set_Geometry_Type(GEO_TYPE_AABOX);
  123. }
  124. if (olddata.Is_Collision_OBBox()) {
  125. Set_Geometry_Type(GEO_TYPE_OBBOX);
  126. }
  127. if (olddata.Is_Normal_Mesh()) {
  128. Set_Geometry_Type(GEO_TYPE_NORMAL_MESH);
  129. }
  130. if (olddata.Is_Null()) {
  131. Set_Geometry_Type(GEO_TYPE_NULL);
  132. }
  133. Enable_Hidden(olddata.Is_Hidden());
  134. Enable_Two_Sided(olddata.Is_Two_Sided());
  135. Enable_Shadow(olddata.Is_Shadow());
  136. Enable_Vertex_Alpha(olddata.Is_Vertex_Alpha());
  137. Enable_ZNormals(olddata.Is_ZNormals());
  138. Enable_Physical_Collision(olddata.Is_Physical_Collision());
  139. Enable_Projectile_Collision(olddata.Is_Projectile_Collision());
  140. Enable_Vis_Collision(olddata.Is_Vis_Collision());
  141. Enable_Camera_Collision(olddata.Is_Physical_Collision()); // make camera setting match physical
  142. Set_Version(W3DAPPDATA2_CURRENT_VERSION);
  143. }
  144. void W3DAppData2Struct::Update_Version(void)
  145. {
  146. /*
  147. ** If this is a version 0 struct, We need to initialize the camera collision
  148. ** setting to be equal to the physical collision setting and convert to version 1
  149. */
  150. if (Get_Version() == 0) {
  151. Enable_Camera_Collision(Is_Physical_Collision_Enabled());
  152. Set_Version(1);
  153. }
  154. /*
  155. ** Add future version conversion code here!
  156. */
  157. }
  158. bool W3DAppData2Struct::operator == (const W3DAppData2Struct & that)
  159. {
  160. /*
  161. ** Export flags have to match
  162. */
  163. if (ExportFlags != that.ExportFlags) return false;
  164. /*
  165. ** If geometry is enabled, verify the geometry type and options
  166. */
  167. if (Is_Geometry()) {
  168. if (Get_Geometry_Type() != that.Get_Geometry_Type()) return false;
  169. if (GeometryFlags != that.GeometryFlags) return false;
  170. if (CollisionFlags != that.CollisionFlags) return false;
  171. }
  172. return true;
  173. }
  174. bool W3DAppData2Struct::Geometry_Options_Match(const W3DAppData2Struct & that)
  175. {
  176. if (Get_Geometry_Type() != that.Get_Geometry_Type()) return false;
  177. if (GeometryFlags != that.GeometryFlags) return false;
  178. if (CollisionFlags != that.CollisionFlags) return false;
  179. return true;
  180. }
  181. W3DAppData2Struct * W3DAppData2Struct::Get_App_Data
  182. (
  183. INode * node,
  184. bool create_if_missing
  185. )
  186. {
  187. /*
  188. ** Try to get our AppData which has the export flags
  189. */
  190. W3DAppData2Struct * wdata = NULL;
  191. AppDataChunk * appdata = node->GetAppDataChunk(W3DUtilityClassID,UTILITY_CLASS_ID,W3D_APPDATA_2);
  192. /*
  193. ** If there wasn't one, look for an AppData0 chunk and convert that.
  194. ** If there was one, get the data from it
  195. */
  196. if (appdata) {
  197. wdata = (W3DAppData2Struct *)(appdata->data);
  198. wdata->Update_Version();
  199. } else {
  200. /*
  201. ** Create a new W3DAppData2Struct for this node
  202. */
  203. wdata = (W3DAppData2Struct *)malloc(sizeof(W3DAppData2Struct));
  204. /*
  205. ** If we have the old AppData0 then initialize from it otherwise
  206. ** just initialize to the defaults
  207. */
  208. AppDataChunk * oldappdata = node->GetAppDataChunk(W3DUtilityClassID,UTILITY_CLASS_ID,W3D_APPDATA_0);
  209. if (oldappdata) {
  210. /*
  211. ** initializing from the old app data 0 chunk;
  212. */
  213. wdata->Init_From_AppData0(*(W3DAppData0Struct*)(oldappdata->data));
  214. /*
  215. ** Destroy the old obsolete App Data 0 chunk
  216. */
  217. node->RemoveAppDataChunk(W3DUtilityClassID, UTILITY_CLASS_ID, W3D_APPDATA_0);
  218. } else {
  219. /*
  220. ** If this object looks like it is going to be a mesh, then default
  221. ** it to have the mesh export flags (export its transform and the
  222. ** triangle mesh). Otherwise use the default of completely ignoring it!
  223. */
  224. if (Is_Max_Tri_Mesh(node)) {
  225. wdata->Init_With_Mesh_Defaults();
  226. } else {
  227. wdata->Init_With_Other_Defaults();
  228. }
  229. }
  230. node->AddAppDataChunk(W3DUtilityClassID,UTILITY_CLASS_ID,2,sizeof(W3DAppData2Struct),wdata);
  231. appdata = node->GetAppDataChunk(W3DUtilityClassID,UTILITY_CLASS_ID,2);
  232. assert(appdata);
  233. }
  234. return wdata;
  235. }
  236. /***********************************************************************************************
  237. **
  238. ** W3DDazzleAppDataStruct Implementation
  239. **
  240. ***********************************************************************************************/
  241. W3DDazzleAppDataStruct::W3DDazzleAppDataStruct(void)
  242. {
  243. UnUsed[0] = 0;
  244. UnUsed[1] = 0;
  245. UnUsed[2] = 0;
  246. UnUsed[3] = 0;
  247. memset(DazzleType,0,sizeof(DazzleType));
  248. strcpy(DazzleType,"DEFAULT");
  249. }
  250. W3DDazzleAppDataStruct * W3DDazzleAppDataStruct::Get_App_Data(INode * node,bool create_if_missing)
  251. {
  252. /*
  253. ** Try to get the existing AppData chunk
  254. */
  255. W3DDazzleAppDataStruct * dazzledata = NULL;
  256. AppDataChunk * appdata = node->GetAppDataChunk(W3DUtilityClassID,UTILITY_CLASS_ID,W3D_DAZZLE_APPDATA);
  257. if (appdata) {
  258. /*
  259. ** Found it, get the pointer to the dazzle data
  260. */
  261. dazzledata = (W3DDazzleAppDataStruct *)(appdata->data);
  262. } else if (create_if_missing) {
  263. /*
  264. ** Create a new W3DDazzleAppDataStruct for this node
  265. */
  266. dazzledata = new W3DDazzleAppDataStruct;
  267. node->AddAppDataChunk(W3DUtilityClassID,UTILITY_CLASS_ID,W3D_DAZZLE_APPDATA,sizeof(W3DDazzleAppDataStruct),dazzledata);
  268. appdata = node->GetAppDataChunk(W3DUtilityClassID,UTILITY_CLASS_ID,W3D_DAZZLE_APPDATA);
  269. assert(appdata);
  270. }
  271. return dazzledata;
  272. }
  273. /***********************************************************************************************
  274. **
  275. ** Utility functions for reading the W3D options that are set for a given INode
  276. **
  277. ***********************************************************************************************/
  278. static int get_geometry_type(INode * node)
  279. {
  280. assert(node != NULL);
  281. return W3DAppData2Struct::Get_App_Data(node)->Get_Geometry_Type();
  282. }
  283. /***********************************************************************************************
  284. * Is_Bone -- check if a node is a "bone" *
  285. * *
  286. * INPUT: *
  287. * *
  288. * OUTPUT: *
  289. * *
  290. * WARNINGS: *
  291. * *
  292. * HISTORY: *
  293. * 10/26/1997 GH : Created. *
  294. *=============================================================================================*/
  295. bool Is_Bone(INode * node)
  296. {
  297. /*
  298. ** regardless of the bits, skins should not have their transform exported.
  299. */
  300. if (Is_Skin(node)) return false;
  301. if (Is_Origin(node)) return false;
  302. //if (Is_Proxy(*node)) return false;
  303. else return (W3DAppData2Struct::Get_App_Data(node)->Is_Bone());
  304. }
  305. /***********************************************************************************************
  306. * Is_Geometry -- Check if an INode is marked for "geometry" export *
  307. * *
  308. * INPUT: *
  309. * *
  310. * OUTPUT: *
  311. * *
  312. * WARNINGS: *
  313. * *
  314. * HISTORY: *
  315. * 1/13/98 GTH : Created. *
  316. *=============================================================================================*/
  317. bool Is_Geometry(INode * node)
  318. {
  319. return (W3DAppData2Struct::Get_App_Data(node)->Is_Geometry());
  320. }
  321. /***********************************************************************************************
  322. * Is_Mesh -- check if a node is a mesh *
  323. * *
  324. * INPUT: *
  325. * *
  326. * OUTPUT: *
  327. * *
  328. * WARNINGS: *
  329. * *
  330. * HISTORY: *
  331. * 10/26/1997 GH : Created. *
  332. *=============================================================================================*/
  333. bool Is_Normal_Mesh(INode * node)
  334. {
  335. if (!Is_Geometry(node)) return false;
  336. if (Is_Skin(node)) return false;
  337. if (Is_Proxy(*node)) return false;
  338. return (get_geometry_type(node) == W3DAppData2Struct::GEO_TYPE_NORMAL_MESH);
  339. }
  340. /***********************************************************************************************
  341. * Is_Camera_Aligned_Mesh -- check if a node is to be a camera aligned mesh *
  342. * *
  343. * INPUT: *
  344. * *
  345. * OUTPUT: *
  346. * *
  347. * WARNINGS: *
  348. * *
  349. * HISTORY: *
  350. * 5/5/98 GTH : Created. *
  351. *=============================================================================================*/
  352. bool Is_Camera_Aligned_Mesh(INode * node)
  353. {
  354. if (!Is_Geometry(node)) return false;
  355. return (get_geometry_type(node) == W3DAppData2Struct::GEO_TYPE_CAMERA_ALIGNED);
  356. }
  357. /***********************************************************************************************
  358. * Is_Camera_Oriented_Mesh -- check if a node is to be a camera oriented mesh *
  359. * *
  360. * INPUT: *
  361. * *
  362. * OUTPUT: *
  363. * *
  364. * WARNINGS: *
  365. * *
  366. * HISTORY: *
  367. * 3/2/99 NH : Created. *
  368. *=============================================================================================*/
  369. bool Is_Camera_Oriented_Mesh(INode * node)
  370. {
  371. if (!Is_Geometry(node)) return false;
  372. return (get_geometry_type(node) == W3DAppData2Struct::GEO_TYPE_CAMERA_ORIENTED);
  373. }
  374. /***********************************************************************************************
  375. * Is_Collision_AABox -- check if a node is a collision box *
  376. * *
  377. * INPUT: *
  378. * *
  379. * OUTPUT: *
  380. * *
  381. * WARNINGS: *
  382. * *
  383. * HISTORY: *
  384. * 10/26/1997 GH : Created. *
  385. *=============================================================================================*/
  386. bool Is_Collision_AABox(INode * node)
  387. {
  388. if (!Is_Geometry(node)) return false;
  389. return (get_geometry_type(node) == W3DAppData2Struct::GEO_TYPE_AABOX);
  390. }
  391. /***********************************************************************************************
  392. * Is_Collision_OBBox -- check if a node is a collision box *
  393. * *
  394. * INPUT: *
  395. * *
  396. * OUTPUT: *
  397. * *
  398. * WARNINGS: *
  399. * *
  400. * HISTORY: *
  401. * 11/17/1998 GH : Created. *
  402. *=============================================================================================*/
  403. bool Is_Collision_OBBox(INode * node)
  404. {
  405. if (!Is_Geometry(node)) return false;
  406. return (get_geometry_type(node) == W3DAppData2Struct::GEO_TYPE_OBBOX);
  407. }
  408. /***********************************************************************************************
  409. * Is_Skin -- check if a node is a skin *
  410. * *
  411. * INPUT: *
  412. * *
  413. * OUTPUT: *
  414. * *
  415. * WARNINGS: *
  416. * *
  417. * HISTORY: *
  418. * 10/26/1997 GH : Created. *
  419. *=============================================================================================*/
  420. bool Is_Skin(INode * node)
  421. {
  422. if (!Is_Geometry(node)) return false;
  423. if (get_geometry_type(node) != W3DAppData2Struct::GEO_TYPE_NORMAL_MESH) return false;
  424. for (int i = 0; i < node->NumRefs(); i++) {
  425. ReferenceTarget *refTarg = node->GetReference(i);
  426. if (refTarg != NULL && refTarg->ClassID() == Class_ID(WSM_DERIVOB_CLASS_ID,0)) {
  427. IDerivedObject * wsm_der_obj = (IDerivedObject *)refTarg;
  428. //MessageBox(NULL, "WSM found", _T("WSM"), MB_OK);
  429. for (int j = 0; j < wsm_der_obj->NumModifiers(); j++) {
  430. Modifier * mod = wsm_der_obj->GetModifier(j);
  431. if (mod->ClassID() == SKIN_MOD_CLASS_ID) {
  432. return true;
  433. }
  434. }
  435. }
  436. }
  437. return false;
  438. }
  439. /***********************************************************************************************
  440. * Is_Shadow -- check if a node marked to cast shadows *
  441. * *
  442. * INPUT: *
  443. * *
  444. * OUTPUT: *
  445. * *
  446. * WARNINGS: *
  447. * *
  448. * HISTORY: *
  449. * 10/26/1997 GH : Created. *
  450. *=============================================================================================*/
  451. bool Is_Shadow(INode * node)
  452. {
  453. if (!Is_Geometry(node)) return false;
  454. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  455. return (wdata->Is_Shadow_Enabled());
  456. }
  457. /***********************************************************************************************
  458. * Is_Null_Object -- check if a node is a null object *
  459. * *
  460. * INPUT: *
  461. * *
  462. * OUTPUT: *
  463. * *
  464. * WARNINGS: *
  465. * *
  466. * HISTORY: *
  467. * 10/26/1997 GH : Created. *
  468. *=============================================================================================*/
  469. bool Is_Null_Object(INode * node)
  470. {
  471. if (!Is_Geometry(node)) return false;
  472. return (get_geometry_type(node) == W3DAppData2Struct::GEO_TYPE_NULL);
  473. }
  474. /***********************************************************************************************
  475. * Is_Dazzle -- check if a node is a dazzle object *
  476. * *
  477. * INPUT: *
  478. * *
  479. * OUTPUT: *
  480. * *
  481. * WARNINGS: *
  482. * *
  483. * HISTORY: *
  484. * 8/5/2000 gth : Created. *
  485. *=============================================================================================*/
  486. bool Is_Dazzle(INode * node)
  487. {
  488. if (!Is_Geometry(node)) return false;
  489. return (get_geometry_type(node) == W3DAppData2Struct::GEO_TYPE_DAZZLE);
  490. }
  491. /***********************************************************************************************
  492. * Is_Aggregate -- check if a node is an aggregate object *
  493. * *
  494. * INPUT: *
  495. * *
  496. * OUTPUT: *
  497. * *
  498. * WARNINGS: *
  499. * *
  500. * HISTORY: *
  501. * 10/24/2000 gth : Created. *
  502. *=============================================================================================*/
  503. bool Is_Aggregate(INode * node)
  504. {
  505. if (!Is_Geometry(node)) return false;
  506. return (get_geometry_type(node) == W3DAppData2Struct::GEO_TYPE_AGGREGATE);
  507. }
  508. /***********************************************************************************************
  509. * Is_Physical_Collision -- Is node categorized as "physical collision geometry" *
  510. * *
  511. * INPUT: *
  512. * *
  513. * OUTPUT: *
  514. * *
  515. * WARNINGS: *
  516. * *
  517. * HISTORY: *
  518. * 1/23/98 GTH : Created. *
  519. *=============================================================================================*/
  520. bool Is_Physical_Collision(INode * node)
  521. {
  522. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  523. return (wdata->Is_Physical_Collision_Enabled());
  524. }
  525. /***********************************************************************************************
  526. * Is_Projectile_Collision -- Is node categorized as "projectile collision geometry"? *
  527. * *
  528. * INPUT: *
  529. * *
  530. * OUTPUT: *
  531. * *
  532. * WARNINGS: *
  533. * *
  534. * HISTORY: *
  535. * 1/23/98 GTH : Created. *
  536. *=============================================================================================*/
  537. bool Is_Projectile_Collision(INode * node)
  538. {
  539. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  540. return (wdata->Is_Projectile_Collision_Enabled());
  541. }
  542. /***********************************************************************************************
  543. * Is_Projectile_Collision -- Is node categorized as "vis collision geometry"? *
  544. * *
  545. * INPUT: *
  546. * *
  547. * OUTPUT: *
  548. * *
  549. * WARNINGS: *
  550. * *
  551. * HISTORY: *
  552. * 1/23/98 GTH : Created. *
  553. *=============================================================================================*/
  554. bool Is_Vis_Collision(INode * node)
  555. {
  556. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  557. return (wdata->Is_Vis_Collision_Enabled());
  558. }
  559. /***********************************************************************************************
  560. * Is_Camera_Collision -- Is node categorized as "camera collision geometry"? *
  561. * *
  562. * INPUT: *
  563. * *
  564. * OUTPUT: *
  565. * *
  566. * WARNINGS: *
  567. * *
  568. * HISTORY: *
  569. * 8/4/2000 gth : Created. *
  570. *=============================================================================================*/
  571. bool Is_Camera_Collision(INode * node)
  572. {
  573. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  574. return (wdata->Is_Camera_Collision_Enabled());
  575. }
  576. /***********************************************************************************************
  577. * Is_Vehicle_Collision -- Is node categorized as "Vehicle collision geometry"? *
  578. * *
  579. * INPUT: *
  580. * *
  581. * OUTPUT: *
  582. * *
  583. * WARNINGS: *
  584. * *
  585. * HISTORY: *
  586. * 8/4/2000 gth : Created. *
  587. *=============================================================================================*/
  588. bool Is_Vehicle_Collision(INode * node)
  589. {
  590. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  591. return (wdata->Is_Vehicle_Collision_Enabled());
  592. }
  593. /***********************************************************************************************
  594. * Is_Hidden -- checks whether the node should be hidden *
  595. * *
  596. * INPUT: *
  597. * *
  598. * OUTPUT: *
  599. * *
  600. * WARNINGS: *
  601. * This has nothing to do with its hidden status inside of max. Things hidden in max are *
  602. * ignored by the exporter. (artist request way back...wierd huh?) *
  603. * *
  604. * HISTORY: *
  605. * 11/18/98 GTH : Created. *
  606. *=============================================================================================*/
  607. bool Is_Hidden(INode * node)
  608. {
  609. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  610. return (wdata->Is_Hidden_Enabled());
  611. }
  612. /***********************************************************************************************
  613. * Is_Two_Sided -- Checks whether the node should be two sided *
  614. * *
  615. * INPUT: *
  616. * *
  617. * OUTPUT: *
  618. * *
  619. * WARNINGS: *
  620. * *
  621. * HISTORY: *
  622. * 11/18/98 GTH : Created. *
  623. *=============================================================================================*/
  624. bool Is_Two_Sided(INode * node)
  625. {
  626. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  627. return (wdata->Is_Two_Sided_Enabled());
  628. }
  629. /***********************************************************************************************
  630. * Is_ZNormals -- checks if the node should be exported with 0,0,1 vert normals *
  631. * *
  632. * INPUT: *
  633. * *
  634. * OUTPUT: *
  635. * *
  636. * WARNINGS: *
  637. * *
  638. * HISTORY: *
  639. * 2/9/99 GTH : Created. *
  640. *=============================================================================================*/
  641. bool Is_ZNormals(INode * node)
  642. {
  643. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  644. return (wdata->Is_ZNormals_Enabled());
  645. }
  646. bool Is_Vertex_Alpha(INode * node)
  647. {
  648. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  649. return (wdata->Is_Vertex_Alpha_Enabled());
  650. }
  651. bool Is_Shatterable(INode * node)
  652. {
  653. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  654. return (wdata->Is_Shatterable_Enabled());
  655. }
  656. bool Is_NPatchable(INode * node)
  657. {
  658. W3DAppData2Struct * wdata = W3DAppData2Struct::Get_App_Data(node);
  659. return (wdata->Is_NPatchable_Enabled());
  660. }