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