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 __domLookat_h__
     10 #define __domLookat_h__
     11 
     12 #include <dae/daeDocument.h>
     13 #include <dom/domTypes.h>
     14 #include <dom/domElements.h>
     15 
     16 class DAE;
     17 
     18 /**
     19  * The lookat element contains a position and orientation transformation suitable
     20  * for aiming a camera. The lookat element contains three mathematical vectors
     21  * within it that describe:  1.The position of the object; 2.The position
     22  * of the interest point; 3.The direction that points up.
     23  */
     24 class domLookat : public daeElement
     25 {
     26 public:
     27 	virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::LOOKAT; }
     28 	static daeInt ID() { return 629; }
     29 	virtual daeInt typeID() const { return ID(); }
     30 protected:  // Attribute
     31 /**
     32  *  The sid attribute is a text string value containing the sub-identifier
     33  * of this element.  This value must be unique within the scope of the parent
     34  * element. Optional attribute.
     35  */
     36 	xsNCName attrSid;
     37 
     38 protected:  // Value
     39 	/**
     40 	 * The domFloat3x3 value of the text data of this element.
     41 	 */
     42 	domFloat3x3 _value;
     43 
     44 public:	//Accessors and Mutators
     45 	/**
     46 	 * Gets the sid attribute.
     47 	 * @return Returns a xsNCName of the sid attribute.
     48 	 */
     49 	xsNCName getSid() const { return attrSid; }
     50 	/**
     51 	 * Sets the sid attribute.
     52 	 * @param atSid The new value for the sid attribute.
     53 	 */
     54 	void setSid( xsNCName atSid ) { *(daeStringRef*)&attrSid = atSid; _validAttributeArray[0] = true; }
     55 
     56 	/**
     57 	 * Gets the _value array.
     58 	 * @return Returns a domFloat3x3 reference of the _value array.
     59 	 */
     60 	domFloat3x3 &getValue() { return _value; }
     61 	/**
     62 	 * Gets the _value array.
     63 	 * @return Returns a constant domFloat3x3 reference of the _value array.
     64 	 */
     65 	const domFloat3x3 &getValue() const { return _value; }
     66 	/**
     67 	 * Sets the _value array.
     68 	 * @param val The new value for the _value array.
     69 	 */
     70 	void setValue( const domFloat3x3 &val ) { _value = val; }
     71 
     72 protected:
     73 	/**
     74 	 * Constructor
     75 	 */
     76 	domLookat(DAE& dae) : daeElement(dae), attrSid(), _value() {}
     77 	/**
     78 	 * Destructor
     79 	 */
     80 	virtual ~domLookat() {}
     81 	/**
     82 	 * Overloaded assignment operator
     83 	 */
     84 	virtual domLookat &operator=( const domLookat &cpy ) { (void)cpy; return *this; }
     85 
     86 public: // STATIC METHODS
     87 	/**
     88 	 * Creates an instance of this class and returns a daeElementRef referencing it.
     89 	 * @return a daeElementRef referencing an instance of this object.
     90 	 */
     91 	static DLLSPEC daeElementRef create(DAE& dae);
     92 	/**
     93 	 * Creates a daeMetaElement object that describes this element in the meta object reflection framework.
     94 	 * If a daeMetaElement already exists it will return that instead of creating a new one.
     95 	 * @return A daeMetaElement describing this COLLADA element.
     96 	 */
     97 	static DLLSPEC daeMetaElement* registerElement(DAE& dae);
     98 };
     99 
    100 
    101 #endif
    102