Browse Source

SceneGraph: documentation updates and fixes.

pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
8acd03778e
  1. 50
      src/Magnum/SceneGraph/AbstractObject.h
  2. 8
      src/Magnum/SceneGraph/AbstractTransformation.h
  3. 7
      src/Magnum/SceneGraph/AbstractTranslation.h
  4. 4
      src/Magnum/SceneGraph/AbstractTranslationRotation2D.h
  5. 33
      src/Magnum/SceneGraph/AbstractTranslationRotation3D.h
  6. 6
      src/Magnum/SceneGraph/AbstractTranslationRotationScaling2D.h
  7. 7
      src/Magnum/SceneGraph/AbstractTranslationRotationScaling3D.h
  8. 21
      src/Magnum/SceneGraph/DualComplexTransformation.h
  9. 21
      src/Magnum/SceneGraph/DualQuaternionTransformation.h
  10. 15
      src/Magnum/SceneGraph/MatrixTransformation2D.h
  11. 18
      src/Magnum/SceneGraph/MatrixTransformation3D.h
  12. 37
      src/Magnum/SceneGraph/Object.h
  13. 30
      src/Magnum/SceneGraph/RigidMatrixTransformation2D.h
  14. 39
      src/Magnum/SceneGraph/RigidMatrixTransformation3D.h
  15. 4
      src/Magnum/SceneGraph/Scene.h
  16. 2
      src/Magnum/SceneGraph/SceneGraph.h
  17. 5
      src/Magnum/SceneGraph/TranslationTransformation.h

50
src/Magnum/SceneGraph/AbstractObject.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::AbstractObject, alias Magnum::SceneGraph::AbstractBasicObject2D, Magnum::SceneGraph::AbstractBasicObject3D, typedef Magnum::SceneGraph::AbstractObject2D, Magnum::SceneGraph::AbstractObject3D * @brief Class @ref Magnum::SceneGraph::AbstractObject, alias @ref Magnum::SceneGraph::AbstractBasicObject2D, @ref Magnum::SceneGraph::AbstractBasicObject3D, typedef @ref Magnum::SceneGraph::AbstractObject2D, @ref Magnum::SceneGraph::AbstractObject3D
*/ */
#include <vector> #include <vector>
@ -129,7 +129,8 @@ template<UnsignedInt dimensions, class T> class AbstractObject
/** /**
* @brief Transformation matrix * @brief Transformation matrix
* *
* @see Object::transformation() * See also `transformation()` function of various transformation
* classes.
*/ */
MatrixType transformationMatrix() const { MatrixType transformationMatrix() const {
return doTransformationMatrix(); return doTransformationMatrix();
@ -138,7 +139,7 @@ template<UnsignedInt dimensions, class T> class AbstractObject
/** /**
* @brief Transformation matrix relative to root object * @brief Transformation matrix relative to root object
* *
* @see Object::absoluteTransformation() * @see @ref Object::absoluteTransformation()
*/ */
MatrixType absoluteTransformationMatrix() const { MatrixType absoluteTransformationMatrix() const {
return doAbsoluteTransformationMatrix(); return doAbsoluteTransformationMatrix();
@ -150,8 +151,8 @@ template<UnsignedInt dimensions, class T> class AbstractObject
* All transformations are premultiplied with @p initialTransformationMatrix, * All transformations are premultiplied with @p initialTransformationMatrix,
* if specified. * if specified.
* @warning This function cannot check if all objects are of the same * @warning This function cannot check if all objects are of the same
* Object type, use typesafe Object::transformationMatrices() when * @ref Object type, use typesafe @ref Object::transformationMatrices()
* possible. * when possible.
*/ */
std::vector<MatrixType> transformationMatrices(const std::vector<AbstractObject<dimensions, T>*>& objects, const MatrixType& initialTransformationMatrix = MatrixType()) const { std::vector<MatrixType> transformationMatrices(const std::vector<AbstractObject<dimensions, T>*>& objects, const MatrixType& initialTransformationMatrix = MatrixType()) const {
return doTransformationMatrices(objects, initialTransformationMatrix); return doTransformationMatrices(objects, initialTransformationMatrix);
@ -170,7 +171,8 @@ template<UnsignedInt dimensions, class T> class AbstractObject
* *
* Only dirty objects in the list are cleaned. * Only dirty objects in the list are cleaned.
* @warning This function cannot check if all objects are of the same * @warning This function cannot check if all objects are of the same
* Object type, use typesafe Object::setClean() when possible. * @ref Object type, use typesafe @ref Object::setClean() when
* possible.
*/ */
static void setClean(const std::vector<AbstractObject<dimensions, T>*>& objects) { static void setClean(const std::vector<AbstractObject<dimensions, T>*>& objects) {
if(objects.empty()) return; if(objects.empty()) return;
@ -181,10 +183,8 @@ template<UnsignedInt dimensions, class T> class AbstractObject
* @brief Whether absolute transformation is dirty * @brief Whether absolute transformation is dirty
* *
* Returns `true` if transformation of the object or any parent has * Returns `true` if transformation of the object or any parent has
* changed since last call to setClean(), `false` otherwise. * changed since last call to @ref setClean(), `false` otherwise. All
* * objects are dirty by default.
* All objects are dirty by default.
*
* @see @ref scenegraph-caching * @see @ref scenegraph-caching
*/ */
bool isDirty() const { return doIsDirty(); } bool isDirty() const { return doIsDirty(); }
@ -192,26 +192,26 @@ template<UnsignedInt dimensions, class T> class AbstractObject
/** /**
* @brief Set object absolute transformation as dirty * @brief Set object absolute transformation as dirty
* *
* Calls AbstractFeature::markDirty() on all object features and * Calls @ref AbstractFeature::markDirty() on all object features and
* recursively calls setDirty() on every child object which is not * recursively calls @ref setDirty() on every child object which is not
* already dirty. If the object is already marked as dirty, the * already dirty. If the object is already marked as dirty, the
* function does nothing. * function does nothing.
* @see @ref scenegraph-caching, setClean(), isDirty() * @see @ref scenegraph-caching, @ref setClean(), @ref isDirty()
*/ */
void setDirty() { doSetDirty(); } void setDirty() { doSetDirty(); }
/** /**
* @brief Clean object absolute transformation * @brief Clean object absolute transformation
* *
* Calls AbstractFeature::clean() and/or AbstractFeature::cleanInverted() * Calls @ref AbstractFeature::clean() and/or @ref AbstractFeature::cleanInverted()
* on all object features which have caching enabled and recursively * on all object features which have caching enabled and recursively
* calls setClean() on every parent which is not already clean. If the * calls @ref setClean() on every parent which is not already clean. If
* object is already clean, the function does nothing. * the object is already clean, the function does nothing.
* *
* See also setClean(const std::vector& objects), which cleans given * See also @ref setClean(const std::vector<AbstractObject<dimensions, T>*>&),
* set of objects more efficiently than when calling setClean() on * which cleans given set of objects more efficiently than when calling
* each object individually. * @ref setClean() on each object individually.
* @see @ref scenegraph-caching, setDirty(), isDirty() * @see @ref scenegraph-caching, @ref setDirty(), @ref isDirty()
*/ */
void setClean() { doSetClean(); } void setClean() { doSetClean(); }
@ -235,8 +235,8 @@ template<UnsignedInt dimensions, class T> class AbstractObject
/** /**
@brief Base object for two-dimensional scenes @brief Base object for two-dimensional scenes
Convenience alternative to <tt>%AbstractObject<2, T></tt>. See AbstractObject Convenience alternative to <tt>%AbstractObject<2, T></tt>. See
for more information. @ref AbstractObject for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractObject<2, T></tt> instead. @note Not available on GCC < 4.7. Use <tt>%AbstractObject<2, T></tt> instead.
@see @ref AbstractObject2D, @ref AbstractBasicObject3D @see @ref AbstractObject2D, @ref AbstractBasicObject3D
*/ */
@ -258,10 +258,10 @@ typedef AbstractObject<2, Float> AbstractObject2D;
/** /**
@brief Base object for three-dimensional scenes @brief Base object for three-dimensional scenes
Convenience alternative to <tt>%AbstractObject<3, T></tt>. See AbstractObject Convenience alternative to <tt>%AbstractObject<3, T></tt>. See
for more information. @ref AbstractObject for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractObject<3, T></tt> instead. @note Not available on GCC < 4.7. Use <tt>%AbstractObject<3, T></tt> instead.
@see AbstractObject2D @see @ref AbstractObject3D, @ref AbstractBasicObject2D
*/ */
template<class T> using AbstractBasicObject3D = AbstractObject<3, T>; template<class T> using AbstractBasicObject3D = AbstractObject<3, T>;
#endif #endif

8
src/Magnum/SceneGraph/AbstractTransformation.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::AbstractTransformation, alias Magnum::SceneGraph::AbstractBasicTransformation2D, Magnum::SceneGraph::AbstractBasicTransformation3D, typedef Magnum::SceneGraph::AbstractTransformation2D, Magnum::SceneGraph::AbstractTransformation3D, enum Magnum::SceneGraph::TransformationType * @brief Class @ref Magnum::SceneGraph::AbstractTransformation, alias @ref Magnum::SceneGraph::AbstractBasicTransformation2D, @ref Magnum::SceneGraph::AbstractBasicTransformation3D, typedef @ref Magnum::SceneGraph::AbstractTransformation2D, @ref Magnum::SceneGraph::AbstractTransformation3D, enum @ref Magnum::SceneGraph::TransformationType
*/ */
#include "Magnum/SceneGraph/SceneGraph.h" #include "Magnum/SceneGraph/SceneGraph.h"
@ -80,7 +80,7 @@ template<UnsignedInt dimensions, class T> class AbstractTransformation {
#else #else
private: private:
#endif #endif
/** @brief Polymorphic implementation for resetTransformation() */ /** @brief Polymorphic implementation for @ref resetTransformation() */
virtual void doResetTransformation() = 0; virtual void doResetTransformation() = 0;
}; };
@ -102,7 +102,7 @@ enum class TransformationType: UnsignedByte {
@brief Base transformation for two-dimensional scenes @brief Base transformation for two-dimensional scenes
Convenience alternative to <tt>%AbstractTransformation<2, T></tt>. See Convenience alternative to <tt>%AbstractTransformation<2, T></tt>. See
AbstractTransformation for more information. @ref AbstractTransformation for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractTransformation<2, T></tt> @note Not available on GCC < 4.7. Use <tt>%AbstractTransformation<2, T></tt>
instead. instead.
@see @ref AbstractTransformation2D, @ref AbstractBasicTransformation3D @see @ref AbstractTransformation2D, @ref AbstractBasicTransformation3D
@ -126,7 +126,7 @@ typedef AbstractTransformation<2, Float> AbstractTransformation2D;
@brief Base transformation for three-dimensional scenes @brief Base transformation for three-dimensional scenes
Convenience alternative to <tt>%AbstractTransformation<3, T></tt>. See Convenience alternative to <tt>%AbstractTransformation<3, T></tt>. See
AbstractTransformation for more information. @ref AbstractTransformation for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractTransformation<3, T></tt> @note Not available on GCC < 4.7. Use <tt>%AbstractTransformation<3, T></tt>
instead. instead.
@see @ref AbstractTransformation3D, @ref AbstractBasicTransformation2D @see @ref AbstractTransformation3D, @ref AbstractBasicTransformation2D

7
src/Magnum/SceneGraph/AbstractTranslation.h

@ -60,8 +60,9 @@ class AbstractTranslation: public AbstractTransformation<dimensions, T> {
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* @see @ref Vector2::xAxis(), @ref Vector2::yAxis(), @ref Vector3::xAxis(), * @see @ref Math::Vector2::xAxis(), @ref Math::Vector2::yAxis(),
* @ref Vector3::yAxis(), @ref Vector3::zAxis() * @ref Math::Vector3::xAxis(), @ref Math::Vector3::yAxis(),
* @ref Math::Vector3::zAxis()
*/ */
AbstractTranslation<dimensions, T, TranslationType>& translate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType type = TransformationType::Global) { AbstractTranslation<dimensions, T, TranslationType>& translate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType type = TransformationType::Global) {
doTranslate(vector, type); doTranslate(vector, type);
@ -76,7 +77,7 @@ class AbstractTranslation: public AbstractTransformation<dimensions, T> {
#else #else
private: private:
#endif #endif
/** @brief Polymorphic implementation for translate() */ /** @brief Polymorphic implementation for @ref translate() */
virtual void doTranslate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType type) = 0; virtual void doTranslate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType type) = 0;
}; };

4
src/Magnum/SceneGraph/AbstractTranslationRotation2D.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::AbstractBasicTranslationRotation2D, typedef Magnum::SceneGraph::AbstractTranslationRotation2D * @brief Class @ref Magnum::SceneGraph::AbstractBasicTranslationRotation2D, typedef @ref Magnum::SceneGraph::AbstractTranslationRotation2D
*/ */
#include "Magnum/SceneGraph/AbstractTranslation.h" #include "Magnum/SceneGraph/AbstractTranslation.h"
@ -70,7 +70,7 @@ template<class T> class AbstractBasicTranslationRotation2D: public AbstractTrans
#else #else
private: private:
#endif #endif
/** @brief Polymorphic implementation for rotate() */ /** @brief Polymorphic implementation for @ref rotate() */
virtual void doRotate(Math::Rad<T> angle, TransformationType type) = 0; virtual void doRotate(Math::Rad<T> angle, TransformationType type) = 0;
}; };

33
src/Magnum/SceneGraph/AbstractTranslationRotation3D.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::AbstractBasicTranslationRotation3D, typedef Magnum::SceneGraph::AbstractTranslationRotation3D * @brief Class @ref Magnum::SceneGraph::AbstractBasicTranslationRotation3D, typedef @ref Magnum::SceneGraph::AbstractTranslationRotation3D
*/ */
#include "Magnum/SceneGraph/AbstractTranslation.h" #include "Magnum/SceneGraph/AbstractTranslation.h"
@ -50,8 +50,9 @@ template<class T> class AbstractBasicTranslationRotation3D: public AbstractTrans
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* @see rotateX(), rotateY(), rotateZ(), Vector3::xAxis(), * @see @ref rotateX(), @ref rotateY(), @ref rotateZ(),
* Vector3::yAxis(), Vector3::zAxis() * @ref Math::Vector3::xAxis(), @ref Math::Vector3::yAxis(),
* @ref Math::Vector3::zAxis()
*/ */
AbstractBasicTranslationRotation3D<T>& rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type = TransformationType::Global) { AbstractBasicTranslationRotation3D<T>& rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type = TransformationType::Global) {
doRotate(angle, normalizedAxis, type); doRotate(angle, normalizedAxis, type);
@ -65,7 +66,8 @@ template<class T> class AbstractBasicTranslationRotation3D: public AbstractTrans
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* In some implementations faster than calling * In some implementations faster than calling
* `rotate(angle, Vector3::xAxis())`. * `rotate(angle, Vector3::xAxis())`, see subclasses for more
* information.
*/ */
AbstractBasicTranslationRotation3D<T>& rotateX(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { AbstractBasicTranslationRotation3D<T>& rotateX(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
doRotateX(angle, type); doRotateX(angle, type);
@ -79,7 +81,8 @@ template<class T> class AbstractBasicTranslationRotation3D: public AbstractTrans
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* In some implementations faster than calling * In some implementations faster than calling
* `rotate(angle, Vector3::yAxis())`. * `rotate(angle, Vector3::yAxis())`, see subclasses for more
* information.
*/ */
AbstractBasicTranslationRotation3D<T>& rotateY(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { AbstractBasicTranslationRotation3D<T>& rotateY(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
doRotateX(angle, type); doRotateX(angle, type);
@ -93,7 +96,8 @@ template<class T> class AbstractBasicTranslationRotation3D: public AbstractTrans
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* In some implementations faster than calling * In some implementations faster than calling
* `rotate(angle, Vector3::zAxis())`. * `rotate(angle, Vector3::zAxis())`, see subclasses for more
* information.
*/ */
AbstractBasicTranslationRotation3D<T>& rotateZ(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { AbstractBasicTranslationRotation3D<T>& rotateZ(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
doRotateZ(angle, type); doRotateZ(angle, type);
@ -116,31 +120,34 @@ template<class T> class AbstractBasicTranslationRotation3D: public AbstractTrans
#else #else
private: private:
#endif #endif
/** @brief Polymorphic implementation for rotate() */ /** @brief Polymorphic implementation for @ref rotate() */
virtual void doRotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type) = 0; virtual void doRotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type) = 0;
/** /**
* @brief Polymorphic implementation for rotateX() * @brief Polymorphic implementation for @ref rotateX()
* *
* Default implementation calls rotate() with Math::Vector3::xAxis(). * Default implementation calls @ref rotate() with
* @ref Math::Vector3::xAxis().
*/ */
virtual void doRotateX(Math::Rad<T> angle, TransformationType type) { virtual void doRotateX(Math::Rad<T> angle, TransformationType type) {
rotate(angle, Math::Vector3<T>::xAxis(), type); rotate(angle, Math::Vector3<T>::xAxis(), type);
} }
/** /**
* @brief Polymorphic implementation for rotateY() * @brief Polymorphic implementation for @ref rotateY()
* *
* Default implementation calls rotate() with Math::Vector3::yAxis(). * Default implementation calls @ref rotate() with
* @ref Math::Vector3::yAxis().
*/ */
virtual void doRotateY(Math::Rad<T> angle, TransformationType type) { virtual void doRotateY(Math::Rad<T> angle, TransformationType type) {
rotate(angle, Math::Vector3<T>::yAxis(), type); rotate(angle, Math::Vector3<T>::yAxis(), type);
} }
/** /**
* @brief Polymorphic implementation for rotateZ() * @brief Polymorphic implementation for @ref rotateZ()
* *
* Default implementation calls rotate() with Math::Vector3::zAxis(). * Default implementation calls @ref rotate() with
* @ref Math::Vector3::zAxis().
*/ */
virtual void doRotateZ(Math::Rad<T> angle, TransformationType type) { virtual void doRotateZ(Math::Rad<T> angle, TransformationType type) {
rotate(angle, Math::Vector3<T>::zAxis(), type); rotate(angle, Math::Vector3<T>::zAxis(), type);

6
src/Magnum/SceneGraph/AbstractTranslationRotationScaling2D.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::AbstractBasicTranslationRotationScaling2D, typedef Magnum::SceneGraph::AbstractTranslationRotationScaling2D * @brief Class @ref Magnum::SceneGraph::AbstractBasicTranslationRotationScaling2D, typedef @ref Magnum::SceneGraph::AbstractTranslationRotationScaling2D
*/ */
#include "Magnum/SceneGraph/AbstractTranslationRotation2D.h" #include "Magnum/SceneGraph/AbstractTranslationRotation2D.h"
@ -48,7 +48,7 @@ template<class T> class AbstractBasicTranslationRotationScaling2D: public Abstra
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* @see Vector2::xScale(), Vector2::yScale() * @see @ref Math::Vector2::xScale(), @ref Math::Vector2::yScale()
*/ */
AbstractBasicTranslationRotationScaling2D<T>& scale(const Math::Vector2<T>& vector, TransformationType type = TransformationType::Global) { AbstractBasicTranslationRotationScaling2D<T>& scale(const Math::Vector2<T>& vector, TransformationType type = TransformationType::Global) {
doScale(vector, type); doScale(vector, type);
@ -79,7 +79,7 @@ template<class T> class AbstractBasicTranslationRotationScaling2D: public Abstra
#else #else
private: private:
#endif #endif
/** @brief Polymorphic implementation for scale() */ /** @brief Polymorphic implementation for @ref scale() */
virtual void doScale(const Math::Vector2<T>& vector, TransformationType type) = 0; virtual void doScale(const Math::Vector2<T>& vector, TransformationType type) = 0;
}; };

7
src/Magnum/SceneGraph/AbstractTranslationRotationScaling3D.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::AbstractBasicTranslationRotationScaling3D, typedef Magnum::SceneGraph::AbstractTranslationRotationScaling3D * @brief Class @ref Magnum::SceneGraph::AbstractBasicTranslationRotationScaling3D, typedef @ref Magnum::SceneGraph::AbstractTranslationRotationScaling3D
*/ */
#include "Magnum/SceneGraph/AbstractTranslationRotation3D.h" #include "Magnum/SceneGraph/AbstractTranslationRotation3D.h"
@ -48,7 +48,8 @@ template<class T> class AbstractBasicTranslationRotationScaling3D: public Abstra
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* @see Vector3::xScale(), Vector3::yScale(), Vector3::zScale() * @see @ref Math::Vector3::xScale(), @ref Math::Vector3::yScale(),
* @ref Math::Vector3::zScale()
*/ */
AbstractBasicTranslationRotationScaling3D<T>& scale(const Math::Vector3<T>& vector, TransformationType type = TransformationType::Global) { AbstractBasicTranslationRotationScaling3D<T>& scale(const Math::Vector3<T>& vector, TransformationType type = TransformationType::Global) {
doScale(vector, type); doScale(vector, type);
@ -91,7 +92,7 @@ template<class T> class AbstractBasicTranslationRotationScaling3D: public Abstra
#else #else
private: private:
#endif #endif
/** @brief Polymorphic implementation for scale() */ /** @brief Polymorphic implementation for @ref scale() */
virtual void doScale(const Math::Vector3<T>& vector, TransformationType type) = 0; virtual void doScale(const Math::Vector3<T>& vector, TransformationType type) = 0;
}; };

21
src/Magnum/SceneGraph/DualComplexTransformation.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::BasicDualComplexTransformation, typedef Magnum::SceneGraph::DualComplexTransformation * @brief Class @ref Magnum::SceneGraph::BasicDualComplexTransformation, typedef @ref Magnum::SceneGraph::DualComplexTransformation
*/ */
#include "Magnum/Math/DualComplex.h" #include "Magnum/Math/DualComplex.h"
@ -39,12 +39,13 @@ namespace Magnum { namespace SceneGraph {
@brief Two-dimensional transformation implemented using dual complex numbers @brief Two-dimensional transformation implemented using dual complex numbers
This class allows only rigid transformation (i.e. only rotation and This class allows only rigid transformation (i.e. only rotation and
translation). translation). Uses @ref Math::DualComplex as underlying transformation type.
@see @ref DualComplexTransformation, @ref scenegraph, Math::DualComplex, @ref BasicDualQuaternionTransformation @see @ref DualComplexTransformation, @ref scenegraph,
@ref BasicDualQuaternionTransformation
*/ */
template<class T> class BasicDualComplexTransformation: public AbstractBasicTranslationRotation2D<T> { template<class T> class BasicDualComplexTransformation: public AbstractBasicTranslationRotation2D<T> {
public: public:
/** @brief Transformation type */ /** @brief Underlying transformation type */
typedef Math::DualComplex<T> DataType; typedef Math::DualComplex<T> DataType;
/** @brief Object transformation */ /** @brief Object transformation */
@ -55,7 +56,7 @@ template<class T> class BasicDualComplexTransformation: public AbstractBasicTran
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Expects that the dual complex number is normalized. * Expects that the dual complex number is normalized.
* @see DualComplex::isNormalized() * @see @ref Math::DualComplex::isNormalized()
*/ */
Object<BasicDualComplexTransformation<T>>& setTransformation(const Math::DualComplex<T>& transformation) { Object<BasicDualComplexTransformation<T>>& setTransformation(const Math::DualComplex<T>& transformation) {
CORRADE_ASSERT(transformation.isNormalized(), CORRADE_ASSERT(transformation.isNormalized(),
@ -75,7 +76,7 @@ template<class T> class BasicDualComplexTransformation: public AbstractBasicTran
* *
* Normalizes the rotation part to prevent rounding errors when rotating * Normalizes the rotation part to prevent rounding errors when rotating
* the object subsequently. * the object subsequently.
* @see DualComplex::normalized() * @see @ref Math::DualComplex::normalized()
*/ */
Object<BasicDualComplexTransformation<T>>& normalizeRotation() { Object<BasicDualComplexTransformation<T>>& normalizeRotation() {
return setTransformationInternal(_transformation.normalized()); return setTransformationInternal(_transformation.normalized());
@ -88,7 +89,7 @@ template<class T> class BasicDualComplexTransformation: public AbstractBasicTran
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Expects that the dual complex number is normalized. * Expects that the dual complex number is normalized.
* @see DualComplex::isNormalized() * @see @ref Math::DualComplex::isNormalized()
*/ */
Object<BasicDualComplexTransformation<T>>& transform(const Math::DualComplex<T>& transformation, TransformationType type = TransformationType::Global) { Object<BasicDualComplexTransformation<T>>& transform(const Math::DualComplex<T>& transformation, TransformationType type = TransformationType::Global) {
CORRADE_ASSERT(transformation.isNormalized(), CORRADE_ASSERT(transformation.isNormalized(),
@ -99,7 +100,7 @@ template<class T> class BasicDualComplexTransformation: public AbstractBasicTran
/** /**
* @copydoc AbstractTranslationRotationScaling2D::translate() * @copydoc AbstractTranslationRotationScaling2D::translate()
* Same as calling transform() with DualComplex::translation(). * Same as calling @ref transform() with @ref Math::DualComplex::translation().
*/ */
Object<BasicDualComplexTransformation<T>>& translate(const Math::Vector2<T>& vector, TransformationType type = TransformationType::Global) { Object<BasicDualComplexTransformation<T>>& translate(const Math::Vector2<T>& vector, TransformationType type = TransformationType::Global) {
return transformInternal(Math::DualComplex<T>::translation(vector), type); return transformInternal(Math::DualComplex<T>::translation(vector), type);
@ -111,8 +112,8 @@ template<class T> class BasicDualComplexTransformation: public AbstractBasicTran
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with DualComplex::rotation(). * Same as calling @ref transform() with @ref Math::DualComplex::rotation().
* @see normalizeRotation() * @see @ref normalizeRotation()
*/ */
Object<BasicDualComplexTransformation<T>>& rotate(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { Object<BasicDualComplexTransformation<T>>& rotate(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
return transformInternal(Math::DualComplex<T>::rotation(angle), type); return transformInternal(Math::DualComplex<T>::rotation(angle), type);

21
src/Magnum/SceneGraph/DualQuaternionTransformation.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::BasicDualQuaternionTransformation, typedef Magnum::SceneGraph::DualQuaternionTransformation * @brief Class @ref Magnum::SceneGraph::BasicDualQuaternionTransformation, typedef @ref Magnum::SceneGraph::DualQuaternionTransformation
*/ */
#include "Magnum/Math/DualQuaternion.h" #include "Magnum/Math/DualQuaternion.h"
@ -39,8 +39,9 @@ namespace Magnum { namespace SceneGraph {
@brief Three-dimensional transformation implemented using dual quaternions @brief Three-dimensional transformation implemented using dual quaternions
This class allows only rigid transformation (i.e. only rotation and This class allows only rigid transformation (i.e. only rotation and
translation). translation). Uses @ref Math::DualQuaternion as underlying transformation type.
@see @ref DualQuaternionTransformation @ref scenegraph, Math::DualQuaternion, @ref BasicDualComplexTransformation @see @ref DualQuaternionTransformation @ref scenegraph,
@ref BasicDualComplexTransformation
*/ */
template<class T> class BasicDualQuaternionTransformation: public AbstractBasicTranslationRotation3D<T> { template<class T> class BasicDualQuaternionTransformation: public AbstractBasicTranslationRotation3D<T> {
public: public:
@ -55,7 +56,7 @@ template<class T> class BasicDualQuaternionTransformation: public AbstractBasicT
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Expects that the dual quaternion is normalized. * Expects that the dual quaternion is normalized.
* @see DualQuaternion::isNormalized() * @see @ref Math::DualQuaternion::isNormalized()
*/ */
Object<BasicDualQuaternionTransformation<T>>& setTransformation(const Math::DualQuaternion<T>& transformation) { Object<BasicDualQuaternionTransformation<T>>& setTransformation(const Math::DualQuaternion<T>& transformation) {
CORRADE_ASSERT(transformation.isNormalized(), CORRADE_ASSERT(transformation.isNormalized(),
@ -75,7 +76,7 @@ template<class T> class BasicDualQuaternionTransformation: public AbstractBasicT
* *
* Normalizes the rotation part to prevent rounding errors when rotating * Normalizes the rotation part to prevent rounding errors when rotating
* the object subsequently. * the object subsequently.
* @see DualQuaternion::normalized() * @see @ref Math::DualQuaternion::normalized()
*/ */
Object<BasicDualQuaternionTransformation<T>>& normalizeRotation() { Object<BasicDualQuaternionTransformation<T>>& normalizeRotation() {
return setTransformationInternal(_transformation.normalized()); return setTransformationInternal(_transformation.normalized());
@ -88,7 +89,7 @@ template<class T> class BasicDualQuaternionTransformation: public AbstractBasicT
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Expects that the dual quaternion is normalized. * Expects that the dual quaternion is normalized.
* @see DualQuaternion::isNormalized() * @see @ref Math::DualQuaternion::isNormalized()
*/ */
Object<BasicDualQuaternionTransformation<T>>& transform(const Math::DualQuaternion<T>& transformation, TransformationType type = TransformationType::Global) { Object<BasicDualQuaternionTransformation<T>>& transform(const Math::DualQuaternion<T>& transformation, TransformationType type = TransformationType::Global) {
CORRADE_ASSERT(transformation.isNormalized(), CORRADE_ASSERT(transformation.isNormalized(),
@ -99,7 +100,7 @@ template<class T> class BasicDualQuaternionTransformation: public AbstractBasicT
/** /**
* @copydoc AbstractTranslationRotationScaling3D::translate() * @copydoc AbstractTranslationRotationScaling3D::translate()
* Same as calling transform() with DualQuaternion::translation(). * Same as calling @ref transform() with @ref Math::DualQuaternion::translation().
*/ */
Object<BasicDualQuaternionTransformation<T>>& translate(const Math::Vector3<T>& vector, TransformationType type = TransformationType::Global) { Object<BasicDualQuaternionTransformation<T>>& translate(const Math::Vector3<T>& vector, TransformationType type = TransformationType::Global) {
return transformInternal(Math::DualQuaternion<T>::translation(vector), type); return transformInternal(Math::DualQuaternion<T>::translation(vector), type);
@ -112,9 +113,9 @@ template<class T> class BasicDualQuaternionTransformation: public AbstractBasicT
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with DualQuaternion::rotation(). * Same as calling @ref transform() with @ref Math::DualQuaternion::rotation().
* @see Vector3::xAxis(), Vector3::yAxis(), Vector3::zAxis(), * @see @ref Math::Vector3::xAxis(), @ref Math::Vector3::yAxis(),
* normalizeRotation() * @ref Math::Vector3::zAxis(), @ref normalizeRotation()
*/ */
Object<BasicDualQuaternionTransformation<T>>& rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type = TransformationType::Global) { Object<BasicDualQuaternionTransformation<T>>& rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type = TransformationType::Global) {
return transformInternal(Math::DualQuaternion<T>::rotation(angle, normalizedAxis), type); return transformInternal(Math::DualQuaternion<T>::rotation(angle, normalizedAxis), type);

15
src/Magnum/SceneGraph/MatrixTransformation2D.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::BasicMatrixTransformation2D, typedef Magnum::SceneGraph::MatrixTransformation2D * @brief Class @ref Magnum::SceneGraph::BasicMatrixTransformation2D, typedef @ref Magnum::SceneGraph::MatrixTransformation2D
*/ */
#include "Magnum/Math/Matrix3.h" #include "Magnum/Math/Matrix3.h"
@ -38,8 +38,9 @@ namespace Magnum { namespace SceneGraph {
/** /**
@brief Two-dimensional transformation implemented using matrices @brief Two-dimensional transformation implemented using matrices
Uses Math::Matrix3 as underlying type. Uses @ref Math::Matrix3 as underlying transformation type.
@see @ref MatrixTransformation2D, @ref scenegraph, @ref BasicRigidMatrixTransformation2D, @ref BasicMatrixTransformation3D @see @ref MatrixTransformation2D, @ref scenegraph,
@ref BasicRigidMatrixTransformation2D, @ref BasicMatrixTransformation3D
*/ */
template<class T> class BasicMatrixTransformation2D: public AbstractBasicTranslationRotationScaling2D<T> { template<class T> class BasicMatrixTransformation2D: public AbstractBasicTranslationRotationScaling2D<T> {
public: public:
@ -83,7 +84,7 @@ template<class T> class BasicMatrixTransformation2D: public AbstractBasicTransla
/** /**
* @copydoc AbstractTranslationRotationScaling2D::translate() * @copydoc AbstractTranslationRotationScaling2D::translate()
* Same as calling transform() with Matrix3::translation(). * Same as calling @ref transform() with @ref Math::Matrix3::translation().
*/ */
Object<BasicMatrixTransformation2D<T>>& translate(const Math::Vector2<T>& vector, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation2D<T>>& translate(const Math::Vector2<T>& vector, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix3<T>::translation(vector), type); return transform(Math::Matrix3<T>::translation(vector), type);
@ -91,7 +92,7 @@ template<class T> class BasicMatrixTransformation2D: public AbstractBasicTransla
/** /**
* @copydoc AbstractTranslationRotationScaling2D::rotate() * @copydoc AbstractTranslationRotationScaling2D::rotate()
* Same as calling transform() with Matrix3::rotation(). * Same as calling @ref transform() with @ref Math::Matrix3::rotation().
*/ */
Object<BasicMatrixTransformation2D<T>>& rotate(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation2D<T>>& rotate(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix3<T>::rotation(angle), type); return transform(Math::Matrix3<T>::rotation(angle), type);
@ -99,7 +100,7 @@ template<class T> class BasicMatrixTransformation2D: public AbstractBasicTransla
/** /**
* @copydoc AbstractTranslationRotationScaling2D::scale() * @copydoc AbstractTranslationRotationScaling2D::scale()
* Same as calling transform() with Matrix3::scaling(). * Same as calling @ref transform() with @ref Math::Matrix3::scaling().
*/ */
Object<BasicMatrixTransformation2D<T>>& scale(const Math::Vector2<T>& vector, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation2D<T>>& scale(const Math::Vector2<T>& vector, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix3<T>::scaling(vector), type); return transform(Math::Matrix3<T>::scaling(vector), type);
@ -112,7 +113,7 @@ template<class T> class BasicMatrixTransformation2D: public AbstractBasicTransla
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix3::reflection(). * Same as calling @ref transform() with @ref Math::Matrix3::reflection().
*/ */
Object<BasicMatrixTransformation2D<T>>& reflect(const Math::Vector2<T>& normal, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation2D<T>>& reflect(const Math::Vector2<T>& normal, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix3<T>::reflection(normal), type); return transform(Math::Matrix3<T>::reflection(normal), type);

18
src/Magnum/SceneGraph/MatrixTransformation3D.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::BasicMatrixTransformation3D, typedef Magnum::SceneGraph::MatrixTransformation3D * @brief Class @ref Magnum::SceneGraph::BasicMatrixTransformation3D, typedef @ref Magnum::SceneGraph::MatrixTransformation3D
*/ */
#include "Magnum/Math/Matrix4.h" #include "Magnum/Math/Matrix4.h"
@ -38,7 +38,7 @@ namespace Magnum { namespace SceneGraph {
/** /**
@brief Three-dimensional transformation implemented using matrices @brief Three-dimensional transformation implemented using matrices
Uses Math::Matrix4 as underlying type. Uses @ref Math::Matrix4 as underlying transformation type.
@see @ref MatrixTransformation3D, @ref scenegraph, @ref BasicRigidMatrixTransformation3D, @ref BasicMatrixTransformation2D @see @ref MatrixTransformation3D, @ref scenegraph, @ref BasicRigidMatrixTransformation3D, @ref BasicMatrixTransformation2D
*/ */
template<class T> class BasicMatrixTransformation3D: public AbstractBasicTranslationRotationScaling3D<T> { template<class T> class BasicMatrixTransformation3D: public AbstractBasicTranslationRotationScaling3D<T> {
@ -83,7 +83,7 @@ template<class T> class BasicMatrixTransformation3D: public AbstractBasicTransla
/** /**
* @copydoc AbstractTranslationRotationScaling3D::translate() * @copydoc AbstractTranslationRotationScaling3D::translate()
* Same as calling transform() with Matrix4::translation(). * Same as calling @ref transform() with @ref Math::Matrix4::translation().
*/ */
Object<BasicMatrixTransformation3D<T>>& translate(const Math::Vector3<T>& vector, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation3D<T>>& translate(const Math::Vector3<T>& vector, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix4<T>::translation(vector), type); return transform(Math::Matrix4<T>::translation(vector), type);
@ -91,7 +91,7 @@ template<class T> class BasicMatrixTransformation3D: public AbstractBasicTransla
/** /**
* @copydoc AbstractTranslationRotationScaling3D::rotate() * @copydoc AbstractTranslationRotationScaling3D::rotate()
* Same as calling transform() with Matrix4::rotation(). * Same as calling @ref transform() with @ref Math::Matrix4::rotation().
*/ */
Object<BasicMatrixTransformation3D<T>>& rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation3D<T>>& rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix4<T>::rotation(angle, normalizedAxis), type); return transform(Math::Matrix4<T>::rotation(angle, normalizedAxis), type);
@ -103,7 +103,7 @@ template<class T> class BasicMatrixTransformation3D: public AbstractBasicTransla
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix4::rotationX(). * Same as calling @ref transform() with @ref Math::Matrix4::rotationX().
*/ */
Object<BasicMatrixTransformation3D<T>>& rotateX(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation3D<T>>& rotateX(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix4<T>::rotationX(angle), type); return transform(Math::Matrix4<T>::rotationX(angle), type);
@ -115,7 +115,7 @@ template<class T> class BasicMatrixTransformation3D: public AbstractBasicTransla
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix4::rotationY(). * Same as calling @ref transform() with @ref Math::Matrix4::rotationY().
*/ */
Object<BasicMatrixTransformation3D<T>>& rotateY(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation3D<T>>& rotateY(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix4<T>::rotationY(angle), type); return transform(Math::Matrix4<T>::rotationY(angle), type);
@ -127,7 +127,7 @@ template<class T> class BasicMatrixTransformation3D: public AbstractBasicTransla
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix4::rotationZ(). * Same as calling @ref transform() with @ref Math::Matrix4::rotationZ().
*/ */
Object<BasicMatrixTransformation3D<T>>& rotateZ(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation3D<T>>& rotateZ(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix4<T>::rotationZ(angle), type); return transform(Math::Matrix4<T>::rotationZ(angle), type);
@ -135,7 +135,7 @@ template<class T> class BasicMatrixTransformation3D: public AbstractBasicTransla
/** /**
* @copydoc AbstractTranslationRotationScaling3D::scale() * @copydoc AbstractTranslationRotationScaling3D::scale()
* Same as calling transform() with Matrix4::scaling(). * Same as calling @ref transform() with @ref Math::Matrix4::scaling().
*/ */
Object<BasicMatrixTransformation3D<T>>& scale(const Math::Vector3<T>& vector, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation3D<T>>& scale(const Math::Vector3<T>& vector, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix4<T>::scaling(vector), type); return transform(Math::Matrix4<T>::scaling(vector), type);
@ -148,7 +148,7 @@ template<class T> class BasicMatrixTransformation3D: public AbstractBasicTransla
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix4::reflection(). * Same as calling @ref transform() with @ref Math::Matrix4::reflection().
*/ */
Object<BasicMatrixTransformation3D<T>>& reflect(const Math::Vector3<T>& normal, TransformationType type = TransformationType::Global) { Object<BasicMatrixTransformation3D<T>>& reflect(const Math::Vector3<T>& normal, TransformationType type = TransformationType::Global) {
return transform(Math::Matrix4<T>::reflection(normal), type); return transform(Math::Matrix4<T>::reflection(normal), type);

37
src/Magnum/SceneGraph/Object.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::Object * @brief Class @ref Magnum::SceneGraph::Object
*/ */
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
@ -196,7 +196,7 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
* @brief Set parent object * @brief Set parent object
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* @see setParentKeepTransformation() * @see @ref setParentKeepTransformation()
*/ */
Object<Transformation>& setParent(Object<Transformation>* parent); Object<Transformation>& setParent(Object<Transformation>* parent);
@ -204,8 +204,9 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
* @brief Set parent object and keep absolute transformation * @brief Set parent object and keep absolute transformation
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* While setParent() preserves only relative transformation of the * While @ref setParent() preserves relative transformation of the
* object, this funcition preserves absolute transformation. * object, this function preserves absolute transformation (i.e., the
* object stays in place after reparenting).
*/ */
Object<Transformation>& setParentKeepTransformation(Object<Transformation>* parent); Object<Transformation>& setParentKeepTransformation(Object<Transformation>* parent);
@ -216,7 +217,8 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
/** /**
* @brief Transformation matrix * @brief Transformation matrix
* *
* @see transformation() * See also `transformation()` function of various transformation
* classes.
*/ */
MatrixType transformationMatrix() const { MatrixType transformationMatrix() const {
return Implementation::Transformation<Transformation>::toMatrix(Transformation::transformation()); return Implementation::Transformation<Transformation>::toMatrix(Transformation::transformation());
@ -225,7 +227,7 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
/** /**
* @brief Transformation matrix relative to root object * @brief Transformation matrix relative to root object
* *
* @see absoluteTransformation() * @see @ref absoluteTransformation()
*/ */
MatrixType absoluteTransformationMatrix() const { MatrixType absoluteTransformationMatrix() const {
return Implementation::Transformation<Transformation>::toMatrix(absoluteTransformation()); return Implementation::Transformation<Transformation>::toMatrix(absoluteTransformation());
@ -234,7 +236,7 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
/** /**
* @brief Transformation relative to root object * @brief Transformation relative to root object
* *
* @see absoluteTransformationMatrix() * @see @ref absoluteTransformationMatrix()
*/ */
typename Transformation::DataType absoluteTransformation() const; typename Transformation::DataType absoluteTransformation() const;
@ -243,7 +245,7 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
* *
* All transformations are premultiplied with @p initialTransformationMatrix, * All transformations are premultiplied with @p initialTransformationMatrix,
* if specified. * if specified.
* @see transformations() * @see @ref transformations()
*/ */
std::vector<MatrixType> transformationMatrices(const std::vector<Object<Transformation>*>& objects, const MatrixType& initialTransformationMatrix = MatrixType()) const; std::vector<MatrixType> transformationMatrices(const std::vector<Object<Transformation>*>& objects, const MatrixType& initialTransformationMatrix = MatrixType()) const;
@ -252,7 +254,7 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
* *
* All transformations can be premultiplied with @p initialTransformation, * All transformations can be premultiplied with @p initialTransformation,
* if specified. * if specified.
* @see transformationMatrices() * @see @ref transformationMatrices()
*/ */
/* `objects` passed by copy intentionally (to allow move from /* `objects` passed by copy intentionally (to allow move from
transformationMatrices() and avoid copy in the function itself) */ transformationMatrices() and avoid copy in the function itself) */
@ -270,7 +272,7 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
* @brief Clean absolute transformations of given set of objects * @brief Clean absolute transformations of given set of objects
* *
* Only dirty objects in the list are cleaned. * Only dirty objects in the list are cleaned.
* @see setClean() * @see @ref setClean()
*/ */
/* `objects` passed by copy intentionally (to avoid copy internally) */ /* `objects` passed by copy intentionally (to avoid copy internally) */
static void setClean(std::vector<Object<Transformation>*> objects); static void setClean(std::vector<Object<Transformation>*> objects);
@ -281,7 +283,20 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
/** @copydoc AbstractObject::setDirty() */ /** @copydoc AbstractObject::setDirty() */
void setDirty(); void setDirty();
/** @copydoc AbstractObject::setClean() */ /**
* @brief Clean object absolute transformation
*
* Calls @ref AbstractFeature::clean() and/or @ref AbstractFeature::cleanInverted()
* on all object features which have caching enabled and recursively
* calls @ref setClean() on every parent which is not already clean. If
* the object is already clean, the function does nothing.
*
* See also @ref setClean(std::vector<Object<Transformation>*>),
* which cleans given set of objects more efficiently than when calling
* @ref setClean() on each object individually.
* @see @ref scenegraph-caching, @ref setDirty(), @ref isDirty()
*/
/* note: doc verbatim copied from AbstractObject::setClean() */
void setClean(); void setClean();
/*@}*/ /*@}*/

30
src/Magnum/SceneGraph/RigidMatrixTransformation2D.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::BasicRigidMatrixTransformation2D, typedef Magnum::SceneGraph::RigidMatrixTransformation2D * @brief Class @ref Magnum::SceneGraph::BasicRigidMatrixTransformation2D, typedef @ref Magnum::SceneGraph::RigidMatrixTransformation2D
*/ */
#include "Magnum/Math/Matrix3.h" #include "Magnum/Math/Matrix3.h"
@ -39,11 +39,12 @@ namespace Magnum { namespace SceneGraph {
/** /**
@brief Two-dimensional rigid transformation implemented using matrices @brief Two-dimensional rigid transformation implemented using matrices
Unlike BasicMatrixTransformation2D this class allows only rotation, reflection Unlike @ref BasicMatrixTransformation2D this class allows only rotation,
and translation (no scaling or setting arbitrary transformations). This allows reflection and translation (no scaling or setting arbitrary transformations).
to use Matrix3::invertedRigid() for faster computation of inverse This allows to use @ref Math::Matrix3::invertedRigid() for faster computation
transformations. of inverse transformations.
@see @ref RigidMatrixTransformation2D, @ref scenegraph, @ref BasicRigidMatrixTransformation3D @see @ref RigidMatrixTransformation2D, @ref scenegraph,
@ref BasicRigidMatrixTransformation3D
*/ */
template<class T> class BasicRigidMatrixTransformation2D: public AbstractBasicTranslationRotation2D<T> { template<class T> class BasicRigidMatrixTransformation2D: public AbstractBasicTranslationRotation2D<T> {
public: public:
@ -58,7 +59,7 @@ template<class T> class BasicRigidMatrixTransformation2D: public AbstractBasicTr
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Expects that the matrix represents rigid transformation. * Expects that the matrix represents rigid transformation.
* @see Matrix3::isRigidTransformation() * @see @ref Math::Matrix3::isRigidTransformation()
*/ */
Object<BasicRigidMatrixTransformation2D<T>>& setTransformation(const Math::Matrix3<T>& transformation) { Object<BasicRigidMatrixTransformation2D<T>>& setTransformation(const Math::Matrix3<T>& transformation) {
CORRADE_ASSERT(transformation.isRigidTransformation(), CORRADE_ASSERT(transformation.isRigidTransformation(),
@ -76,8 +77,9 @@ template<class T> class BasicRigidMatrixTransformation2D: public AbstractBasicTr
* @brief Normalize rotation part * @brief Normalize rotation part
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Normalizes the rotation part using Math::Algorithms::gramSchmidt() * Normalizes the rotation part using
* to prevent rounding errors when rotating the object subsequently. * @ref Math::Algorithms::gramSchmidtOrthonormalize() to prevent
* rounding errors when rotating the object subsequently.
*/ */
Object<BasicRigidMatrixTransformation2D<T>>& normalizeRotation() { Object<BasicRigidMatrixTransformation2D<T>>& normalizeRotation() {
return setTransformationInternal(Math::Matrix3<T>::from( return setTransformationInternal(Math::Matrix3<T>::from(
@ -92,7 +94,7 @@ template<class T> class BasicRigidMatrixTransformation2D: public AbstractBasicTr
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Expects that the matrix represents rigid transformation. * Expects that the matrix represents rigid transformation.
* @see Matrix3::isRigidTransformation() * @see @ref Math::Matrix3::isRigidTransformation()
*/ */
Object<BasicRigidMatrixTransformation2D<T>>& transform(const Math::Matrix3<T>& transformation, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation2D<T>>& transform(const Math::Matrix3<T>& transformation, TransformationType type = TransformationType::Global) {
CORRADE_ASSERT(transformation.isRigidTransformation(), CORRADE_ASSERT(transformation.isRigidTransformation(),
@ -103,7 +105,7 @@ template<class T> class BasicRigidMatrixTransformation2D: public AbstractBasicTr
/** /**
* @copydoc AbstractTranslationRotationScaling2D::translate() * @copydoc AbstractTranslationRotationScaling2D::translate()
* Same as calling transform() with Matrix3::translation(). * Same as calling @ref transform() with @ref Math::Matrix3::translation().
*/ */
Object<BasicRigidMatrixTransformation2D<T>>& translate(const Math::Vector2<T>& vector, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation2D<T>>& translate(const Math::Vector2<T>& vector, TransformationType type = TransformationType::Global) {
return transformInternal(Math::Matrix3<T>::translation(vector), type); return transformInternal(Math::Matrix3<T>::translation(vector), type);
@ -115,8 +117,8 @@ template<class T> class BasicRigidMatrixTransformation2D: public AbstractBasicTr
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix3::rotation(). * Same as calling @ref transform() with @ref Math::Matrix3::rotation().
* @see normalizeRotation() * @see @ref normalizeRotation()
*/ */
Object<BasicRigidMatrixTransformation2D<T>>& rotate(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation2D<T>>& rotate(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
return transformInternal(Math::Matrix3<T>::rotation(angle), type); return transformInternal(Math::Matrix3<T>::rotation(angle), type);
@ -129,7 +131,7 @@ template<class T> class BasicRigidMatrixTransformation2D: public AbstractBasicTr
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix3::reflection(). * Same as calling @ref transform() with @ref Math::Matrix3::reflection().
*/ */
Object<BasicRigidMatrixTransformation2D<T>>& reflect(const Math::Vector2<T>& normal, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation2D<T>>& reflect(const Math::Vector2<T>& normal, TransformationType type = TransformationType::Global) {
return transformInternal(Math::Matrix3<T>::reflection(normal), type); return transformInternal(Math::Matrix3<T>::reflection(normal), type);

39
src/Magnum/SceneGraph/RigidMatrixTransformation3D.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::BasicRigidMatrixTransformation3D, typedef Magnum::SceneGraph::RigidMatrixTransformation3D * @brief Class @ref Magnum::SceneGraph::BasicRigidMatrixTransformation3D, typedef @ref Magnum::SceneGraph::RigidMatrixTransformation3D
*/ */
#include "Magnum/Math/Matrix4.h" #include "Magnum/Math/Matrix4.h"
@ -39,10 +39,10 @@ namespace Magnum { namespace SceneGraph {
/** /**
@brief Three-dimensional rigid transformation implemented using matrices @brief Three-dimensional rigid transformation implemented using matrices
Unlike BasicMatrixTransformation3D this class allows only rotation, reflection Unlike @ref BasicMatrixTransformation3D this class allows only rotation,
and translation (no scaling or setting arbitrary transformations). This allows reflection and translation (no scaling or setting arbitrary transformations).
to use Matrix4::invertedRigid() for faster computation of inverse This allows to use @ref Math::Matrix4::invertedRigid() for faster computation
transformations. of inverse transformations.
@see @ref RigidMatrixTransformation3D, @ref scenegraph, @ref BasicRigidMatrixTransformation2D @see @ref RigidMatrixTransformation3D, @ref scenegraph, @ref BasicRigidMatrixTransformation2D
*/ */
template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTranslationRotation3D<T> { template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTranslationRotation3D<T> {
@ -58,7 +58,7 @@ template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTr
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Expects that the matrix represents rigid transformation. * Expects that the matrix represents rigid transformation.
* @see Matrix4::isRigidTransformation() * @see @ref Matrix4::isRigidTransformation()
*/ */
Object<BasicRigidMatrixTransformation3D<T>>& setTransformation(const Math::Matrix4<T>& transformation) { Object<BasicRigidMatrixTransformation3D<T>>& setTransformation(const Math::Matrix4<T>& transformation) {
CORRADE_ASSERT(transformation.isRigidTransformation(), CORRADE_ASSERT(transformation.isRigidTransformation(),
@ -76,7 +76,7 @@ template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTr
* @brief Normalize rotation part * @brief Normalize rotation part
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Normalizes the rotation part using Math::Algorithms::gramSchmidt() * Normalizes the rotation part using @ref Math::Algorithms::gramSchmidtOrthonormalize()
* to prevent rounding errors when rotating the object subsequently. * to prevent rounding errors when rotating the object subsequently.
*/ */
Object<BasicRigidMatrixTransformation3D<T>>& normalizeRotation() { Object<BasicRigidMatrixTransformation3D<T>>& normalizeRotation() {
@ -92,7 +92,7 @@ template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTr
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Expects that the matrix represents rigid transformation. * Expects that the matrix represents rigid transformation.
* @see Matrix4::isRigidTransformation() * @see @ref Math::Matrix4::isRigidTransformation()
*/ */
Object<BasicRigidMatrixTransformation3D<T>>& transform(const Math::Matrix4<T>& transformation, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation3D<T>>& transform(const Math::Matrix4<T>& transformation, TransformationType type = TransformationType::Global) {
CORRADE_ASSERT(transformation.isRigidTransformation(), CORRADE_ASSERT(transformation.isRigidTransformation(),
@ -103,7 +103,7 @@ template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTr
/** /**
* @copydoc AbstractTranslationRotationScaling3D::translate() * @copydoc AbstractTranslationRotationScaling3D::translate()
* Same as calling transform() with Matrix4::translation(). * Same as calling @ref transform() with @ref Math::Matrix4::translation().
*/ */
Object<BasicRigidMatrixTransformation3D<T>>& translate(const Math::Vector3<T>& vector, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation3D<T>>& translate(const Math::Vector3<T>& vector, TransformationType type = TransformationType::Global) {
return transformInternal(Math::Matrix4<T>::translation(vector), type); return transformInternal(Math::Matrix4<T>::translation(vector), type);
@ -116,9 +116,10 @@ template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTr
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix4::rotation(). * Same as calling @ref transform() with @ref Math::Matrix4::rotation().
* @see rotateX(), rotateY(), rotateZ(), Vector3::xAxis(), * @see @ref rotateX(), @ref rotateY(), @ref rotateZ(),
* Vector3::yAxis(), Vector3::zAxis(), normalizeRotation() * @ref normalizeRotation(), @ref Math::Vector3::xAxis(),
* @ref Math::Vector3::yAxis(), @ref Math::Vector3::zAxis()
*/ */
Object<BasicRigidMatrixTransformation3D<T>>& rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation3D<T>>& rotate(Math::Rad<T> angle, const Math::Vector3<T>& normalizedAxis, TransformationType type = TransformationType::Global) {
return transformInternal(Math::Matrix4<T>::rotation(angle, normalizedAxis), type); return transformInternal(Math::Matrix4<T>::rotation(angle, normalizedAxis), type);
@ -130,8 +131,8 @@ template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTr
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix4::rotationX(). * Same as calling @ref transform() with @ref Math::Matrix4::rotationX().
* @see normalizeRotation() * @see @ref normalizeRotation()
*/ */
Object<BasicRigidMatrixTransformation3D<T>>& rotateX(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation3D<T>>& rotateX(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
return transformInternal(Math::Matrix4<T>::rotationX(angle), type); return transformInternal(Math::Matrix4<T>::rotationX(angle), type);
@ -143,8 +144,8 @@ template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTr
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix4::rotationY(). * Same as calling @ref transform() with @ref Math::Matrix4::rotationY().
* @see normalizeRotation() * @see @ref normalizeRotation()
*/ */
Object<BasicRigidMatrixTransformation3D<T>>& rotateY(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation3D<T>>& rotateY(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
return transformInternal(Math::Matrix4<T>::rotationY(angle), type); return transformInternal(Math::Matrix4<T>::rotationY(angle), type);
@ -156,8 +157,8 @@ template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTr
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix4::rotationZ(). * Same as calling @ref transform() with @ref Math::Matrix4::rotationZ().
* @see normalizeRotation() * @see @ref normalizeRotation()
*/ */
Object<BasicRigidMatrixTransformation3D<T>>& rotateZ(Math::Rad<T> angle, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation3D<T>>& rotateZ(Math::Rad<T> angle, TransformationType type = TransformationType::Global) {
return transformInternal(Math::Matrix4<T>::rotationZ(angle), type); return transformInternal(Math::Matrix4<T>::rotationZ(angle), type);
@ -170,7 +171,7 @@ template<class T> class BasicRigidMatrixTransformation3D: public AbstractBasicTr
* @param type Transformation type * @param type Transformation type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as calling transform() with Matrix4::reflection(). * Same as calling @ref transform() with @ref Math::Matrix4::reflection().
*/ */
Object<BasicRigidMatrixTransformation3D<T>>& reflect(const Math::Vector3<T>& normal, TransformationType type = TransformationType::Global) { Object<BasicRigidMatrixTransformation3D<T>>& reflect(const Math::Vector3<T>& normal, TransformationType type = TransformationType::Global) {
return transformInternal(Math::Matrix4<T>::reflection(normal), type); return transformInternal(Math::Matrix4<T>::reflection(normal), type);

4
src/Magnum/SceneGraph/Scene.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::SceneGraph::Scene * @brief Class @ref Magnum::SceneGraph::Scene
*/ */
#include "Magnum/SceneGraph/Object.h" #include "Magnum/SceneGraph/Object.h"
@ -36,7 +36,7 @@ namespace Magnum { namespace SceneGraph {
/** /**
@brief %Scene @brief %Scene
Basically Object which cannot have parent or non-default transformation. Basically @ref Object which cannot have parent or non-default transformation.
See @ref scenegraph for introduction. See @ref scenegraph for introduction.
*/ */
template<class Transformation> class Scene: public Object<Transformation> { template<class Transformation> class Scene: public Object<Transformation> {

2
src/Magnum/SceneGraph/SceneGraph.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Forward declarations for Magnum::SceneGraph namespace * @brief Forward declarations for @ref Magnum::SceneGraph namespace
*/ */
#include <Corrade/compatibility.h> #include <Corrade/compatibility.h>

5
src/Magnum/SceneGraph/TranslationTransformation.h

@ -103,8 +103,9 @@ class TranslationTransformation: public AbstractTranslation<dimensions, T, Trans
* @param vector Translation vector * @param vector Translation vector
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* @see @ref Vector2::xAxis(), @ref Vector2::yAxis(), @ref Vector3::xAxis(), * @see @ref Math::Vector2::xAxis(), @ref Math::Vector2::yAxis(),
* @ref Vector3::yAxis(), @ref Vector3::zAxis() * @ref Math::Vector3::xAxis(), @ref Math::Vector3::yAxis(),
* @ref Math::Vector3::zAxis()
*/ */
Object<TranslationTransformation<dimensions, T, TranslationType>>& translate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType = TransformationType::Global) { Object<TranslationTransformation<dimensions, T, TranslationType>>& translate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType = TransformationType::Global) {
_transformation += vector; _transformation += vector;

Loading…
Cancel
Save