domRigid_body.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. /*
  2. * Copyright 2006 Sony Computer Entertainment Inc.
  3. *
  4. * Licensed under the SCEA Shared Source License, Version 1.0 (the "License"); you may not use this
  5. * file except in compliance with the License. You may obtain a copy of the License at:
  6. * http://research.scea.com/scea_shared_source_license.html
  7. *
  8. * Unless required by applicable law or agreed to in writing, software distributed under the License
  9. * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  10. * implied. See the License for the specific language governing permissions and limitations under the
  11. * License.
  12. */
  13. #ifndef __domRigid_body_h__
  14. #define __domRigid_body_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domTechnique.h>
  19. #include <dom/domExtra.h>
  20. #include <dom/domInstance_physics_material.h>
  21. #include <dom/domPhysics_material.h>
  22. #include <dom/domTargetableFloat.h>
  23. #include <dom/domTranslate.h>
  24. #include <dom/domRotate.h>
  25. #include <dom/domTargetableFloat3.h>
  26. #include <dom/domInstance_geometry.h>
  27. #include <dom/domPlane.h>
  28. #include <dom/domBox.h>
  29. #include <dom/domSphere.h>
  30. #include <dom/domCylinder.h>
  31. #include <dom/domTapered_cylinder.h>
  32. #include <dom/domCapsule.h>
  33. #include <dom/domTapered_capsule.h>
  34. class DAE;
  35. /**
  36. * This element allows for describing simulated bodies that do not deform.
  37. * These bodies may or may not be connected by constraints (hinge, ball-joint
  38. * etc.). Rigid-bodies, constraints etc. are encapsulated in physics_model
  39. * elements to allow for instantiating complex models.
  40. */
  41. class domRigid_body : public daeElement
  42. {
  43. public:
  44. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::RIGID_BODY; }
  45. static daeInt ID() { return 795; }
  46. virtual daeInt typeID() const { return ID(); }
  47. public:
  48. class domTechnique_common;
  49. typedef daeSmartRef<domTechnique_common> domTechnique_commonRef;
  50. typedef daeTArray<domTechnique_commonRef> domTechnique_common_Array;
  51. /**
  52. * The technique_common element specifies the rigid_body information for the
  53. * common profile which all COLLADA implementations need to support.
  54. */
  55. class domTechnique_common : public daeElement
  56. {
  57. public:
  58. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE_COMMON; }
  59. static daeInt ID() { return 796; }
  60. virtual daeInt typeID() const { return ID(); }
  61. public:
  62. class domDynamic;
  63. typedef daeSmartRef<domDynamic> domDynamicRef;
  64. typedef daeTArray<domDynamicRef> domDynamic_Array;
  65. /**
  66. * If false, the rigid_body is not moveable
  67. */
  68. class domDynamic : public daeElement
  69. {
  70. public:
  71. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::DYNAMIC; }
  72. static daeInt ID() { return 797; }
  73. virtual daeInt typeID() const { return ID(); }
  74. protected: // Attribute
  75. /**
  76. * The sid attribute is a text string value containing the sub-identifier
  77. * of this element. This value must be unique within the scope of the parent
  78. * element. Optional attribute.
  79. */
  80. xsNCName attrSid;
  81. protected: // Value
  82. /**
  83. * The domBool value of the text data of this element.
  84. */
  85. domBool _value;
  86. public: //Accessors and Mutators
  87. /**
  88. * Gets the sid attribute.
  89. * @return Returns a xsNCName of the sid attribute.
  90. */
  91. xsNCName getSid() const { return attrSid; }
  92. /**
  93. * Sets the sid attribute.
  94. * @param atSid The new value for the sid attribute.
  95. */
  96. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
  97. /**
  98. * Gets the value of this element.
  99. * @return a domBool of the value.
  100. */
  101. domBool getValue() const { return _value; }
  102. /**
  103. * Sets the _value of this element.
  104. * @param val The new value for this element.
  105. */
  106. void setValue( domBool val ) { _value = val; }
  107. protected:
  108. /**
  109. * Constructor
  110. */
  111. domDynamic(DAE& dae) : daeElement(dae), attrSid(), _value() {}
  112. /**
  113. * Destructor
  114. */
  115. virtual ~domDynamic() {}
  116. /**
  117. * Overloaded assignment operator
  118. */
  119. virtual domDynamic &operator=( const domDynamic &cpy ) { (void)cpy; return *this; }
  120. public: // STATIC METHODS
  121. /**
  122. * Creates an instance of this class and returns a daeElementRef referencing it.
  123. * @return a daeElementRef referencing an instance of this object.
  124. */
  125. static DLLSPEC daeElementRef create(DAE& dae);
  126. /**
  127. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  128. * If a daeMetaElement already exists it will return that instead of creating a new one.
  129. * @return A daeMetaElement describing this COLLADA element.
  130. */
  131. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  132. };
  133. class domMass_frame;
  134. typedef daeSmartRef<domMass_frame> domMass_frameRef;
  135. typedef daeTArray<domMass_frameRef> domMass_frame_Array;
  136. /**
  137. * Defines the center and orientation of mass of the rigid-body relative to
  138. * the local origin of the “root” shape.This makes the off-diagonal elements
  139. * of the inertia tensor (products of inertia) all 0 and allows us to just
  140. * store the diagonal elements (moments of inertia).
  141. */
  142. class domMass_frame : public daeElement
  143. {
  144. public:
  145. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::MASS_FRAME; }
  146. static daeInt ID() { return 798; }
  147. virtual daeInt typeID() const { return ID(); }
  148. protected: // Elements
  149. domTranslate_Array elemTranslate_array;
  150. domRotate_Array elemRotate_array;
  151. /**
  152. * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
  153. */
  154. daeElementRefArray _contents;
  155. /**
  156. * Used to preserve order in elements that have a complex content model.
  157. */
  158. daeUIntArray _contentsOrder;
  159. /**
  160. * Used to store information needed for some content model objects.
  161. */
  162. daeTArray< daeCharArray * > _CMData;
  163. public: //Accessors and Mutators
  164. /**
  165. * Gets the translate element array.
  166. * @return Returns a reference to the array of translate elements.
  167. */
  168. domTranslate_Array &getTranslate_array() { return elemTranslate_array; }
  169. /**
  170. * Gets the translate element array.
  171. * @return Returns a constant reference to the array of translate elements.
  172. */
  173. const domTranslate_Array &getTranslate_array() const { return elemTranslate_array; }
  174. /**
  175. * Gets the rotate element array.
  176. * @return Returns a reference to the array of rotate elements.
  177. */
  178. domRotate_Array &getRotate_array() { return elemRotate_array; }
  179. /**
  180. * Gets the rotate element array.
  181. * @return Returns a constant reference to the array of rotate elements.
  182. */
  183. const domRotate_Array &getRotate_array() const { return elemRotate_array; }
  184. /**
  185. * Gets the _contents array.
  186. * @return Returns a reference to the _contents element array.
  187. */
  188. daeElementRefArray &getContents() { return _contents; }
  189. /**
  190. * Gets the _contents array.
  191. * @return Returns a constant reference to the _contents element array.
  192. */
  193. const daeElementRefArray &getContents() const { return _contents; }
  194. protected:
  195. /**
  196. * Constructor
  197. */
  198. domMass_frame(DAE& dae) : daeElement(dae), elemTranslate_array(), elemRotate_array() {}
  199. /**
  200. * Destructor
  201. */
  202. virtual ~domMass_frame() { daeElement::deleteCMDataArray(_CMData); }
  203. /**
  204. * Overloaded assignment operator
  205. */
  206. virtual domMass_frame &operator=( const domMass_frame &cpy ) { (void)cpy; return *this; }
  207. public: // STATIC METHODS
  208. /**
  209. * Creates an instance of this class and returns a daeElementRef referencing it.
  210. * @return a daeElementRef referencing an instance of this object.
  211. */
  212. static DLLSPEC daeElementRef create(DAE& dae);
  213. /**
  214. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  215. * If a daeMetaElement already exists it will return that instead of creating a new one.
  216. * @return A daeMetaElement describing this COLLADA element.
  217. */
  218. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  219. };
  220. class domShape;
  221. typedef daeSmartRef<domShape> domShapeRef;
  222. typedef daeTArray<domShapeRef> domShape_Array;
  223. /**
  224. * This element allows for describing components of a rigid_body.
  225. */
  226. class domShape : public daeElement
  227. {
  228. public:
  229. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::SHAPE; }
  230. static daeInt ID() { return 799; }
  231. virtual daeInt typeID() const { return ID(); }
  232. public:
  233. class domHollow;
  234. typedef daeSmartRef<domHollow> domHollowRef;
  235. typedef daeTArray<domHollowRef> domHollow_Array;
  236. /**
  237. * If true, the mass is distributed along the surface of the shape
  238. */
  239. class domHollow : public daeElement
  240. {
  241. public:
  242. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::HOLLOW; }
  243. static daeInt ID() { return 800; }
  244. virtual daeInt typeID() const { return ID(); }
  245. protected: // Attribute
  246. /**
  247. * The sid attribute is a text string value containing the sub-identifier
  248. * of this element. This value must be unique within the scope of the parent
  249. * element. Optional attribute.
  250. */
  251. xsNCName attrSid;
  252. protected: // Value
  253. /**
  254. * The domBool value of the text data of this element.
  255. */
  256. domBool _value;
  257. public: //Accessors and Mutators
  258. /**
  259. * Gets the sid attribute.
  260. * @return Returns a xsNCName of the sid attribute.
  261. */
  262. xsNCName getSid() const { return attrSid; }
  263. /**
  264. * Sets the sid attribute.
  265. * @param atSid The new value for the sid attribute.
  266. */
  267. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
  268. /**
  269. * Gets the value of this element.
  270. * @return a domBool of the value.
  271. */
  272. domBool getValue() const { return _value; }
  273. /**
  274. * Sets the _value of this element.
  275. * @param val The new value for this element.
  276. */
  277. void setValue( domBool val ) { _value = val; }
  278. protected:
  279. /**
  280. * Constructor
  281. */
  282. domHollow(DAE& dae) : daeElement(dae), attrSid(), _value() {}
  283. /**
  284. * Destructor
  285. */
  286. virtual ~domHollow() {}
  287. /**
  288. * Overloaded assignment operator
  289. */
  290. virtual domHollow &operator=( const domHollow &cpy ) { (void)cpy; return *this; }
  291. public: // STATIC METHODS
  292. /**
  293. * Creates an instance of this class and returns a daeElementRef referencing it.
  294. * @return a daeElementRef referencing an instance of this object.
  295. */
  296. static DLLSPEC daeElementRef create(DAE& dae);
  297. /**
  298. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  299. * If a daeMetaElement already exists it will return that instead of creating a new one.
  300. * @return A daeMetaElement describing this COLLADA element.
  301. */
  302. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  303. };
  304. protected: // Elements
  305. /**
  306. * If true, the mass is distributed along the surface of the shape @see domHollow
  307. */
  308. domHollowRef elemHollow;
  309. /**
  310. * The mass of the shape. @see domMass
  311. */
  312. domTargetableFloatRef elemMass;
  313. /**
  314. * The density of the shape. @see domDensity
  315. */
  316. domTargetableFloatRef elemDensity;
  317. /**
  318. * References a physics_material for the shape. @see domInstance_physics_material
  319. */
  320. domInstance_physics_materialRef elemInstance_physics_material;
  321. /**
  322. * Defines a physics_material for the shape. @see domPhysics_material
  323. */
  324. domPhysics_materialRef elemPhysics_material;
  325. /**
  326. * Instances a geometry to use to define this shape. @see domInstance_geometry
  327. */
  328. domInstance_geometryRef elemInstance_geometry;
  329. /**
  330. * Defines a plane to use for this shape. @see domPlane
  331. */
  332. domPlaneRef elemPlane;
  333. /**
  334. * Defines a box to use for this shape. @see domBox
  335. */
  336. domBoxRef elemBox;
  337. /**
  338. * Defines a sphere to use for this shape. @see domSphere
  339. */
  340. domSphereRef elemSphere;
  341. /**
  342. * Defines a cyliner to use for this shape. @see domCylinder
  343. */
  344. domCylinderRef elemCylinder;
  345. /**
  346. * Defines a tapered_cylinder to use for this shape. @see domTapered_cylinder
  347. */
  348. domTapered_cylinderRef elemTapered_cylinder;
  349. /**
  350. * Defines a capsule to use for this shape. @see domCapsule
  351. */
  352. domCapsuleRef elemCapsule;
  353. /**
  354. * Defines a tapered_capsule to use for this shape. @see domTapered_capsule
  355. */
  356. domTapered_capsuleRef elemTapered_capsule;
  357. /**
  358. * Allows a tranformation for the shape. @see domTranslate
  359. */
  360. domTranslate_Array elemTranslate_array;
  361. /**
  362. * Allows a tranformation for the shape. @see domRotate
  363. */
  364. domRotate_Array elemRotate_array;
  365. /**
  366. * The extra element may appear any number of times. @see domExtra
  367. */
  368. domExtra_Array elemExtra_array;
  369. /**
  370. * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
  371. */
  372. daeElementRefArray _contents;
  373. /**
  374. * Used to preserve order in elements that have a complex content model.
  375. */
  376. daeUIntArray _contentsOrder;
  377. /**
  378. * Used to store information needed for some content model objects.
  379. */
  380. daeTArray< daeCharArray * > _CMData;
  381. public: //Accessors and Mutators
  382. /**
  383. * Gets the hollow element.
  384. * @return a daeSmartRef to the hollow element.
  385. */
  386. const domHollowRef getHollow() const { return elemHollow; }
  387. /**
  388. * Gets the mass element.
  389. * @return a daeSmartRef to the mass element.
  390. */
  391. const domTargetableFloatRef getMass() const { return elemMass; }
  392. /**
  393. * Gets the density element.
  394. * @return a daeSmartRef to the density element.
  395. */
  396. const domTargetableFloatRef getDensity() const { return elemDensity; }
  397. /**
  398. * Gets the instance_physics_material element.
  399. * @return a daeSmartRef to the instance_physics_material element.
  400. */
  401. const domInstance_physics_materialRef getInstance_physics_material() const { return elemInstance_physics_material; }
  402. /**
  403. * Gets the physics_material element.
  404. * @return a daeSmartRef to the physics_material element.
  405. */
  406. const domPhysics_materialRef getPhysics_material() const { return elemPhysics_material; }
  407. /**
  408. * Gets the instance_geometry element.
  409. * @return a daeSmartRef to the instance_geometry element.
  410. */
  411. const domInstance_geometryRef getInstance_geometry() const { return elemInstance_geometry; }
  412. /**
  413. * Gets the plane element.
  414. * @return a daeSmartRef to the plane element.
  415. */
  416. const domPlaneRef getPlane() const { return elemPlane; }
  417. /**
  418. * Gets the box element.
  419. * @return a daeSmartRef to the box element.
  420. */
  421. const domBoxRef getBox() const { return elemBox; }
  422. /**
  423. * Gets the sphere element.
  424. * @return a daeSmartRef to the sphere element.
  425. */
  426. const domSphereRef getSphere() const { return elemSphere; }
  427. /**
  428. * Gets the cylinder element.
  429. * @return a daeSmartRef to the cylinder element.
  430. */
  431. const domCylinderRef getCylinder() const { return elemCylinder; }
  432. /**
  433. * Gets the tapered_cylinder element.
  434. * @return a daeSmartRef to the tapered_cylinder element.
  435. */
  436. const domTapered_cylinderRef getTapered_cylinder() const { return elemTapered_cylinder; }
  437. /**
  438. * Gets the capsule element.
  439. * @return a daeSmartRef to the capsule element.
  440. */
  441. const domCapsuleRef getCapsule() const { return elemCapsule; }
  442. /**
  443. * Gets the tapered_capsule element.
  444. * @return a daeSmartRef to the tapered_capsule element.
  445. */
  446. const domTapered_capsuleRef getTapered_capsule() const { return elemTapered_capsule; }
  447. /**
  448. * Gets the translate element array.
  449. * @return Returns a reference to the array of translate elements.
  450. */
  451. domTranslate_Array &getTranslate_array() { return elemTranslate_array; }
  452. /**
  453. * Gets the translate element array.
  454. * @return Returns a constant reference to the array of translate elements.
  455. */
  456. const domTranslate_Array &getTranslate_array() const { return elemTranslate_array; }
  457. /**
  458. * Gets the rotate element array.
  459. * @return Returns a reference to the array of rotate elements.
  460. */
  461. domRotate_Array &getRotate_array() { return elemRotate_array; }
  462. /**
  463. * Gets the rotate element array.
  464. * @return Returns a constant reference to the array of rotate elements.
  465. */
  466. const domRotate_Array &getRotate_array() const { return elemRotate_array; }
  467. /**
  468. * Gets the extra element array.
  469. * @return Returns a reference to the array of extra elements.
  470. */
  471. domExtra_Array &getExtra_array() { return elemExtra_array; }
  472. /**
  473. * Gets the extra element array.
  474. * @return Returns a constant reference to the array of extra elements.
  475. */
  476. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  477. /**
  478. * Gets the _contents array.
  479. * @return Returns a reference to the _contents element array.
  480. */
  481. daeElementRefArray &getContents() { return _contents; }
  482. /**
  483. * Gets the _contents array.
  484. * @return Returns a constant reference to the _contents element array.
  485. */
  486. const daeElementRefArray &getContents() const { return _contents; }
  487. protected:
  488. /**
  489. * Constructor
  490. */
  491. domShape(DAE& dae) : daeElement(dae), elemHollow(), elemMass(), elemDensity(), elemInstance_physics_material(), elemPhysics_material(), elemInstance_geometry(), elemPlane(), elemBox(), elemSphere(), elemCylinder(), elemTapered_cylinder(), elemCapsule(), elemTapered_capsule(), elemTranslate_array(), elemRotate_array(), elemExtra_array() {}
  492. /**
  493. * Destructor
  494. */
  495. virtual ~domShape() { daeElement::deleteCMDataArray(_CMData); }
  496. /**
  497. * Overloaded assignment operator
  498. */
  499. virtual domShape &operator=( const domShape &cpy ) { (void)cpy; return *this; }
  500. public: // STATIC METHODS
  501. /**
  502. * Creates an instance of this class and returns a daeElementRef referencing it.
  503. * @return a daeElementRef referencing an instance of this object.
  504. */
  505. static DLLSPEC daeElementRef create(DAE& dae);
  506. /**
  507. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  508. * If a daeMetaElement already exists it will return that instead of creating a new one.
  509. * @return A daeMetaElement describing this COLLADA element.
  510. */
  511. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  512. };
  513. protected: // Elements
  514. /**
  515. * If false, the rigid_body is not moveable @see domDynamic
  516. */
  517. domDynamicRef elemDynamic;
  518. /**
  519. * The total mass of the rigid-body @see domMass
  520. */
  521. domTargetableFloatRef elemMass;
  522. /**
  523. * Defines the center and orientation of mass of the rigid-body relative to
  524. * the local origin of the “root” shape.This makes the off-diagonal elements
  525. * of the inertia tensor (products of inertia) all 0 and allows us to just
  526. * store the diagonal elements (moments of inertia). @see domMass_frame
  527. */
  528. domMass_frameRef elemMass_frame;
  529. /**
  530. * float3 – The diagonal elements of the inertia tensor (moments of inertia),
  531. * which is represented in the local frame of the center of mass. See above.
  532. * @see domInertia
  533. */
  534. domTargetableFloat3Ref elemInertia;
  535. /**
  536. * References a physics_material for the rigid_body. @see domInstance_physics_material
  537. */
  538. domInstance_physics_materialRef elemInstance_physics_material;
  539. /**
  540. * Defines a physics_material for the rigid_body. @see domPhysics_material
  541. */
  542. domPhysics_materialRef elemPhysics_material;
  543. /**
  544. * This element allows for describing components of a rigid_body. @see domShape
  545. */
  546. domShape_Array elemShape_array;
  547. /**
  548. * Used to preserve order in elements that do not specify strict sequencing of sub-elements.
  549. */
  550. daeElementRefArray _contents;
  551. /**
  552. * Used to preserve order in elements that have a complex content model.
  553. */
  554. daeUIntArray _contentsOrder;
  555. /**
  556. * Used to store information needed for some content model objects.
  557. */
  558. daeTArray< daeCharArray * > _CMData;
  559. public: //Accessors and Mutators
  560. /**
  561. * Gets the dynamic element.
  562. * @return a daeSmartRef to the dynamic element.
  563. */
  564. const domDynamicRef getDynamic() const { return elemDynamic; }
  565. /**
  566. * Gets the mass element.
  567. * @return a daeSmartRef to the mass element.
  568. */
  569. const domTargetableFloatRef getMass() const { return elemMass; }
  570. /**
  571. * Gets the mass_frame element.
  572. * @return a daeSmartRef to the mass_frame element.
  573. */
  574. const domMass_frameRef getMass_frame() const { return elemMass_frame; }
  575. /**
  576. * Gets the inertia element.
  577. * @return a daeSmartRef to the inertia element.
  578. */
  579. const domTargetableFloat3Ref getInertia() const { return elemInertia; }
  580. /**
  581. * Gets the instance_physics_material element.
  582. * @return a daeSmartRef to the instance_physics_material element.
  583. */
  584. const domInstance_physics_materialRef getInstance_physics_material() const { return elemInstance_physics_material; }
  585. /**
  586. * Gets the physics_material element.
  587. * @return a daeSmartRef to the physics_material element.
  588. */
  589. const domPhysics_materialRef getPhysics_material() const { return elemPhysics_material; }
  590. /**
  591. * Gets the shape element array.
  592. * @return Returns a reference to the array of shape elements.
  593. */
  594. domShape_Array &getShape_array() { return elemShape_array; }
  595. /**
  596. * Gets the shape element array.
  597. * @return Returns a constant reference to the array of shape elements.
  598. */
  599. const domShape_Array &getShape_array() const { return elemShape_array; }
  600. /**
  601. * Gets the _contents array.
  602. * @return Returns a reference to the _contents element array.
  603. */
  604. daeElementRefArray &getContents() { return _contents; }
  605. /**
  606. * Gets the _contents array.
  607. * @return Returns a constant reference to the _contents element array.
  608. */
  609. const daeElementRefArray &getContents() const { return _contents; }
  610. protected:
  611. /**
  612. * Constructor
  613. */
  614. domTechnique_common(DAE& dae) : daeElement(dae), elemDynamic(), elemMass(), elemMass_frame(), elemInertia(), elemInstance_physics_material(), elemPhysics_material(), elemShape_array() {}
  615. /**
  616. * Destructor
  617. */
  618. virtual ~domTechnique_common() { daeElement::deleteCMDataArray(_CMData); }
  619. /**
  620. * Overloaded assignment operator
  621. */
  622. virtual domTechnique_common &operator=( const domTechnique_common &cpy ) { (void)cpy; return *this; }
  623. public: // STATIC METHODS
  624. /**
  625. * Creates an instance of this class and returns a daeElementRef referencing it.
  626. * @return a daeElementRef referencing an instance of this object.
  627. */
  628. static DLLSPEC daeElementRef create(DAE& dae);
  629. /**
  630. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  631. * If a daeMetaElement already exists it will return that instead of creating a new one.
  632. * @return A daeMetaElement describing this COLLADA element.
  633. */
  634. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  635. };
  636. protected: // Attributes
  637. /**
  638. * The sid attribute is a text string value containing the sub-identifier
  639. * of this element. This value must be unique within the scope of the parent
  640. * element. Optional attribute.
  641. */
  642. xsNCName attrSid;
  643. /**
  644. * The name attribute is the text string name of this element. Optional attribute.
  645. */
  646. xsNCName attrName;
  647. protected: // Elements
  648. /**
  649. * The technique_common element specifies the rigid_body information for the
  650. * common profile which all COLLADA implementations need to support. @see
  651. * domTechnique_common
  652. */
  653. domTechnique_commonRef elemTechnique_common;
  654. /**
  655. * This element may contain any number of non-common profile techniques.
  656. * @see domTechnique
  657. */
  658. domTechnique_Array elemTechnique_array;
  659. /**
  660. * The extra element may appear any number of times. @see domExtra
  661. */
  662. domExtra_Array elemExtra_array;
  663. public: //Accessors and Mutators
  664. /**
  665. * Gets the sid attribute.
  666. * @return Returns a xsNCName of the sid attribute.
  667. */
  668. xsNCName getSid() const { return attrSid; }
  669. /**
  670. * Sets the sid attribute.
  671. * @param atSid The new value for the sid attribute.
  672. */
  673. void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
  674. /**
  675. * Gets the name attribute.
  676. * @return Returns a xsNCName of the name attribute.
  677. */
  678. xsNCName getName() const { return attrName; }
  679. /**
  680. * Sets the name attribute.
  681. * @param atName The new value for the name attribute.
  682. */
  683. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; }
  684. /**
  685. * Gets the technique_common element.
  686. * @return a daeSmartRef to the technique_common element.
  687. */
  688. const domTechnique_commonRef getTechnique_common() const { return elemTechnique_common; }
  689. /**
  690. * Gets the technique element array.
  691. * @return Returns a reference to the array of technique elements.
  692. */
  693. domTechnique_Array &getTechnique_array() { return elemTechnique_array; }
  694. /**
  695. * Gets the technique element array.
  696. * @return Returns a constant reference to the array of technique elements.
  697. */
  698. const domTechnique_Array &getTechnique_array() const { return elemTechnique_array; }
  699. /**
  700. * Gets the extra element array.
  701. * @return Returns a reference to the array of extra elements.
  702. */
  703. domExtra_Array &getExtra_array() { return elemExtra_array; }
  704. /**
  705. * Gets the extra element array.
  706. * @return Returns a constant reference to the array of extra elements.
  707. */
  708. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  709. protected:
  710. /**
  711. * Constructor
  712. */
  713. domRigid_body(DAE& dae) : daeElement(dae), attrSid(), attrName(), elemTechnique_common(), elemTechnique_array(), elemExtra_array() {}
  714. /**
  715. * Destructor
  716. */
  717. virtual ~domRigid_body() {}
  718. /**
  719. * Overloaded assignment operator
  720. */
  721. virtual domRigid_body &operator=( const domRigid_body &cpy ) { (void)cpy; return *this; }
  722. public: // STATIC METHODS
  723. /**
  724. * Creates an instance of this class and returns a daeElementRef referencing it.
  725. * @return a daeElementRef referencing an instance of this object.
  726. */
  727. static DLLSPEC daeElementRef create(DAE& dae);
  728. /**
  729. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  730. * If a daeMetaElement already exists it will return that instead of creating a new one.
  731. * @return A daeMetaElement describing this COLLADA element.
  732. */
  733. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  734. };
  735. #endif