domPhysics_scene.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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 __domPhysics_scene_h__
  14. #define __domPhysics_scene_h__
  15. #include <dae/daeDocument.h>
  16. #include <dom/domTypes.h>
  17. #include <dom/domElements.h>
  18. #include <dom/domAsset.h>
  19. #include <dom/domInstance_force_field.h>
  20. #include <dom/domInstance_physics_model.h>
  21. #include <dom/domTechnique.h>
  22. #include <dom/domExtra.h>
  23. #include <dom/domTargetableFloat3.h>
  24. #include <dom/domTargetableFloat.h>
  25. class DAE;
  26. class domPhysics_scene : public daeElement
  27. {
  28. public:
  29. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PHYSICS_SCENE; }
  30. static daeInt ID() { return 793; }
  31. virtual daeInt typeID() const { return ID(); }
  32. public:
  33. class domTechnique_common;
  34. typedef daeSmartRef<domTechnique_common> domTechnique_commonRef;
  35. typedef daeTArray<domTechnique_commonRef> domTechnique_common_Array;
  36. /**
  37. * The technique_common element specifies the physics_scene information for
  38. * the common profile which all COLLADA implementations need to support.
  39. */
  40. class domTechnique_common : public daeElement
  41. {
  42. public:
  43. virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::TECHNIQUE_COMMON; }
  44. static daeInt ID() { return 794; }
  45. virtual daeInt typeID() const { return ID(); }
  46. protected: // Elements
  47. /**
  48. * The gravity vector to use for the physics_scene. @see domGravity
  49. */
  50. domTargetableFloat3Ref elemGravity;
  51. /**
  52. * The time_step for the physics_scene. @see domTime_step
  53. */
  54. domTargetableFloatRef elemTime_step;
  55. public: //Accessors and Mutators
  56. /**
  57. * Gets the gravity element.
  58. * @return a daeSmartRef to the gravity element.
  59. */
  60. const domTargetableFloat3Ref getGravity() const { return elemGravity; }
  61. /**
  62. * Gets the time_step element.
  63. * @return a daeSmartRef to the time_step element.
  64. */
  65. const domTargetableFloatRef getTime_step() const { return elemTime_step; }
  66. protected:
  67. /**
  68. * Constructor
  69. */
  70. domTechnique_common(DAE& dae) : daeElement(dae), elemGravity(), elemTime_step() {}
  71. /**
  72. * Destructor
  73. */
  74. virtual ~domTechnique_common() {}
  75. /**
  76. * Overloaded assignment operator
  77. */
  78. virtual domTechnique_common &operator=( const domTechnique_common &cpy ) { (void)cpy; return *this; }
  79. public: // STATIC METHODS
  80. /**
  81. * Creates an instance of this class and returns a daeElementRef referencing it.
  82. * @return a daeElementRef referencing an instance of this object.
  83. */
  84. static DLLSPEC daeElementRef create(DAE& dae);
  85. /**
  86. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  87. * If a daeMetaElement already exists it will return that instead of creating a new one.
  88. * @return A daeMetaElement describing this COLLADA element.
  89. */
  90. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  91. };
  92. protected: // Attributes
  93. /**
  94. * The id attribute is a text string containing the unique identifier of
  95. * this element. This value must be unique within the instance document.
  96. * Optional attribute.
  97. */
  98. xsID attrId;
  99. /**
  100. * The name attribute is the text string name of this element. Optional attribute.
  101. */
  102. xsNCName attrName;
  103. protected: // Elements
  104. /**
  105. * The physics_scene element may contain an asset element. @see domAsset
  106. */
  107. domAssetRef elemAsset;
  108. /**
  109. * There may be any number of instance_force_field elements. @see domInstance_force_field
  110. */
  111. domInstance_force_field_Array elemInstance_force_field_array;
  112. /**
  113. * There may be any number of instance_physics_model elements. @see domInstance_physics_model
  114. */
  115. domInstance_physics_model_Array elemInstance_physics_model_array;
  116. /**
  117. * The technique_common element specifies the physics_scene information for
  118. * the common profile which all COLLADA implementations need to support.
  119. * @see domTechnique_common
  120. */
  121. domTechnique_commonRef elemTechnique_common;
  122. /**
  123. * This element may contain any number of non-common profile techniques.
  124. * @see domTechnique
  125. */
  126. domTechnique_Array elemTechnique_array;
  127. /**
  128. * The extra element may appear any number of times. @see domExtra
  129. */
  130. domExtra_Array elemExtra_array;
  131. public: //Accessors and Mutators
  132. /**
  133. * Gets the id attribute.
  134. * @return Returns a xsID of the id attribute.
  135. */
  136. xsID getId() const { return attrId; }
  137. /**
  138. * Sets the id attribute.
  139. * @param atId The new value for the id attribute.
  140. */
  141. void setId( xsID atId ) { *(daeStringRef*)&attrId = atId; _validAttributeArray[0] = true;
  142. if( _document != NULL ) _document->changeElementID( this, attrId );
  143. }
  144. /**
  145. * Gets the name attribute.
  146. * @return Returns a xsNCName of the name attribute.
  147. */
  148. xsNCName getName() const { return attrName; }
  149. /**
  150. * Sets the name attribute.
  151. * @param atName The new value for the name attribute.
  152. */
  153. void setName( xsNCName atName ) { *(daeStringRef*)&attrName = atName; _validAttributeArray[1] = true; }
  154. /**
  155. * Gets the asset element.
  156. * @return a daeSmartRef to the asset element.
  157. */
  158. const domAssetRef getAsset() const { return elemAsset; }
  159. /**
  160. * Gets the instance_force_field element array.
  161. * @return Returns a reference to the array of instance_force_field elements.
  162. */
  163. domInstance_force_field_Array &getInstance_force_field_array() { return elemInstance_force_field_array; }
  164. /**
  165. * Gets the instance_force_field element array.
  166. * @return Returns a constant reference to the array of instance_force_field elements.
  167. */
  168. const domInstance_force_field_Array &getInstance_force_field_array() const { return elemInstance_force_field_array; }
  169. /**
  170. * Gets the instance_physics_model element array.
  171. * @return Returns a reference to the array of instance_physics_model elements.
  172. */
  173. domInstance_physics_model_Array &getInstance_physics_model_array() { return elemInstance_physics_model_array; }
  174. /**
  175. * Gets the instance_physics_model element array.
  176. * @return Returns a constant reference to the array of instance_physics_model elements.
  177. */
  178. const domInstance_physics_model_Array &getInstance_physics_model_array() const { return elemInstance_physics_model_array; }
  179. /**
  180. * Gets the technique_common element.
  181. * @return a daeSmartRef to the technique_common element.
  182. */
  183. const domTechnique_commonRef getTechnique_common() const { return elemTechnique_common; }
  184. /**
  185. * Gets the technique element array.
  186. * @return Returns a reference to the array of technique elements.
  187. */
  188. domTechnique_Array &getTechnique_array() { return elemTechnique_array; }
  189. /**
  190. * Gets the technique element array.
  191. * @return Returns a constant reference to the array of technique elements.
  192. */
  193. const domTechnique_Array &getTechnique_array() const { return elemTechnique_array; }
  194. /**
  195. * Gets the extra element array.
  196. * @return Returns a reference to the array of extra elements.
  197. */
  198. domExtra_Array &getExtra_array() { return elemExtra_array; }
  199. /**
  200. * Gets the extra element array.
  201. * @return Returns a constant reference to the array of extra elements.
  202. */
  203. const domExtra_Array &getExtra_array() const { return elemExtra_array; }
  204. protected:
  205. /**
  206. * Constructor
  207. */
  208. domPhysics_scene(DAE& dae) : daeElement(dae), attrId(), attrName(), elemAsset(), elemInstance_force_field_array(), elemInstance_physics_model_array(), elemTechnique_common(), elemTechnique_array(), elemExtra_array() {}
  209. /**
  210. * Destructor
  211. */
  212. virtual ~domPhysics_scene() {}
  213. /**
  214. * Overloaded assignment operator
  215. */
  216. virtual domPhysics_scene &operator=( const domPhysics_scene &cpy ) { (void)cpy; return *this; }
  217. public: // STATIC METHODS
  218. /**
  219. * Creates an instance of this class and returns a daeElementRef referencing it.
  220. * @return a daeElementRef referencing an instance of this object.
  221. */
  222. static DLLSPEC daeElementRef create(DAE& dae);
  223. /**
  224. * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
  225. * If a daeMetaElement already exists it will return that instead of creating a new one.
  226. * @return A daeMetaElement describing this COLLADA element.
  227. */
  228. static DLLSPEC daeMetaElement* registerElement(DAE& dae);
  229. };
  230. #endif