From 29806b94158c45d78d59b48822c74235a0d5bfd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 25 Jan 2013 18:02:35 +0100 Subject: [PATCH] Doc++ --- src/Mesh.h | 19 ++++++++++--------- src/Physics/ObjectShape.h | 27 +++++++++++++++++++++++++-- src/Physics/ObjectShapeGroup.h | 17 ++++++++++++++--- src/SceneGraph/Animable.h | 7 ++++++- src/SceneGraph/Drawable.h | 2 +- src/SceneGraph/Object.h | 2 +- 6 files changed, 57 insertions(+), 17 deletions(-) diff --git a/src/Mesh.h b/src/Mesh.h index 81c06e13f..40a6658a3 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -250,9 +250,9 @@ class MAGNUM_EXPORT Mesh { * @see setProvokingVertex() * @requires_gl32 %Extension @extension{ARB,provoking_vertex}. Older * versions behave always like - * ProvokingMode::%LastVertexConvention. + * @ref Magnum::Mesh::ProvokingVertex "ProvokingVertex::LastVertexConvention". * @requires_gl OpenGL ES behaves always like - * ProvokingMode::%LastVertexConvention. + * @ref Magnum::Mesh::ProvokingVertex "ProvokingVertex::LastVertexConvention". */ enum class ProvokingVertex: GLenum { /** @brief Use first vertex of each polygon. */ @@ -265,7 +265,7 @@ class MAGNUM_EXPORT Mesh { /** * @brief Set provoking vertex * - * Initial value is ProvokingMode::%LastVertexConvention. + * Initial value is @ref ProvokingVertex "ProvokingVertex::LastVertexConvention". * @see @fn_gl{ProvokingVertex} * @requires_gl32 %Extension @extension{ARB,provoking_vertex}. Older * versions behave always like the default. @@ -281,9 +281,8 @@ class MAGNUM_EXPORT Mesh { * @brief Polygon mode * * @see setPolygonMode() - * @requires_gl OpenGL ES behaves always like - * PolygonMode::%Fill. See setPrimitive() for possible - * workaround. + * @requires_gl OpenGL ES behaves always like @ref Magnum::Mesh::PolygonMode "PolygonMode::Fill". + * See setPrimitive() for possible workaround. */ enum class PolygonMode: GLenum { /** @@ -308,7 +307,7 @@ class MAGNUM_EXPORT Mesh { /** * @brief Set polygon drawing mode * - * Initial value is `PolygonMode::%Fill`. + * Initial value is @ref PolygonMode "PolygonMode::Fill". * @see @fn_gl{PolygonMode} * @requires_gl OpenGL ES behaves always like the default. See * setPrimitive() for possible workaround. @@ -332,13 +331,15 @@ class MAGNUM_EXPORT Mesh { /** * Offset lines. - * @requires_gl Only PolygonOffset::%Fill is supported. + * @requires_gl Only @ref Magnum::Mesh::PolygonOffsetMode "PolygonOffsetMode::Fill" + * is available in OpenGL ES. */ Line = GL_POLYGON_OFFSET_LINE, /** * Offset points. - * @requires_gl Only PolygonOffset::%Fill is supported. + * @requires_gl Only @ref Magnum::Mesh::PolygonOffsetMode "PolygonOffsetMode::Fill" + * is available in OpenGL ES. */ Point = GL_POLYGON_OFFSET_POINT #endif diff --git a/src/Physics/ObjectShape.h b/src/Physics/ObjectShape.h index 23e0d69a3..6bba9209e 100644 --- a/src/Physics/ObjectShape.h +++ b/src/Physics/ObjectShape.h @@ -29,8 +29,25 @@ namespace Magnum { namespace Physics { /** @brief Object shape -Adds shape for collision detection to object. -@see ObjectShape2D, ObjectShape3D +Adds shape for collision detection to object. Each %ObjectShape is part of +some ObjectShapeGroup, which essentially maintains a set of objects which can +collide with each other. + +@section ObjectShape-usage Usage + +Add the feature to the object and some shape group (you can also use +ObjectShapeGroup::add() and ObjectShapeGroup::remove() later) and then set +desired object shape using setShape(). +@code +Physics::ObjectShapeGroup3D shapes; + +Object3D* object; +auto shape = new Physics::ObjectShape3D(object, &shapes); +shape->setShape(Physics::Sphere3D({}, 0.75f) || Physics::AxisAlignedBox3D({}, {3.0f, 1.5f, 2.0f})); +@endcode + +@see @ref scenegraph, ObjectShape2D, ObjectShape3D, ObjectShapeGroup2D, + ObjectShapeGroup3D, DebugTools::ShapeRenderer */ template class MAGNUM_PHYSICS_EXPORT ObjectShape: public SceneGraph::AbstractGroupedFeature> { public: @@ -84,10 +101,16 @@ template class MAGNUM_PHYSICS_EXPORT ObjectShape: publi return setShape(new T(std::move(shape))); } + /** + * @brief Object shape group containing this shape + * + * If the shape doesn't belong to any group, returns `nullptr`. + */ inline ObjectShapeGroup* group() { return static_cast*>(SceneGraph::AbstractGroupedFeature>::group()); } + /** @overload */ inline const ObjectShapeGroup* group() const { return static_cast*>(SceneGraph::AbstractGroupedFeature>::group()); } diff --git a/src/Physics/ObjectShapeGroup.h b/src/Physics/ObjectShapeGroup.h index 6747704e0..0553263da 100644 --- a/src/Physics/ObjectShapeGroup.h +++ b/src/Physics/ObjectShapeGroup.h @@ -32,7 +32,8 @@ namespace Magnum { namespace Physics { /** @brief Group of object shapes -@see ObjectShapeGroup2D, ObjectShapeGroup3D +See ObjectShape for more information. +@see @ref scenegraph, ObjectShapeGroup2D, ObjectShapeGroup3D */ template class MAGNUM_PHYSICS_EXPORT ObjectShapeGroup: public SceneGraph::FeatureGroup> { friend class ObjectShape; @@ -74,10 +75,20 @@ template class MAGNUM_PHYSICS_EXPORT ObjectShapeGroup: bool dirty; }; -/** @brief Group of two-dimensional shaped objects */ +/** +@brief Group of two-dimensional shaped objects + +See ObjectShape for more information. +@see ObjectShapeGroup3D +*/ typedef ObjectShapeGroup<2> ObjectShapeGroup2D; -/** @brief Group of three-dimensional shaped objects */ +/** +@brief Group of three-dimensional shaped objects + +See ObjectShape for more information. +@see ObjectShapeGroup2D +*/ typedef ObjectShapeGroup<3> ObjectShapeGroup3D; }} diff --git a/src/SceneGraph/Animable.h b/src/SceneGraph/Animable.h index a0e51de2e..5b4a74edc 100644 --- a/src/SceneGraph/Animable.h +++ b/src/SceneGraph/Animable.h @@ -208,8 +208,13 @@ class MAGNUM_SCENEGRAPH_EXPORT Animable: public AbstractGroupedFeature* group(); - const AnimableGroup* group() const; + const AnimableGroup* group() const; /**< @overload */ protected: /** diff --git a/src/SceneGraph/Drawable.h b/src/SceneGraph/Drawable.h index 9a1e1cbcf..416efd140 100644 --- a/src/SceneGraph/Drawable.h +++ b/src/SceneGraph/Drawable.h @@ -26,7 +26,7 @@ namespace Magnum { namespace SceneGraph { /** @brief %Drawable -Adds drawing feature to object. Each %Drawable is part of some DrawableGroup +Adds drawing function to the object. Each %Drawable is part of some DrawableGroup and the whole group is drawn with particular camera using AbstractCamera::draw(). @section Drawable-usage Usage diff --git a/src/SceneGraph/Object.h b/src/SceneGraph/Object.h index 9a8346d49..64f77332b 100644 --- a/src/SceneGraph/Object.h +++ b/src/SceneGraph/Object.h @@ -77,7 +77,7 @@ See @ref compilation-speedup-hpp for more information. - @ref EuclideanMatrixTransformation2D "Object>" - @ref EuclideanMatrixTransformation3D "Object>" -@see Scene, AbstractFeature, AbstractTransformation +@see Scene, AbstractFeature, AbstractTransformation, DebugTools::ObjectRenderer */ template class Object: public AbstractObject, public Transformation #ifndef DOXYGEN_GENERATING_OUTPUT