2
0

domLookat.h 3.2 KB

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