From 48c3f3b8471d1e5f172eb1d990d832abe11051d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 16 Jun 2026 18:34:22 +0200 Subject: [PATCH] Primitives: doc++ I also apparently completely forgot to add a changelog entry for the new cube texture coordinates in 0f7598220dab1094747d19cb7497e75dddc28b3b a year ago. --- doc/changelog.dox | 5 +++++ src/Magnum/Primitives/Axis.h | 6 ++++-- src/Magnum/Primitives/Crosshair.h | 6 ++++-- src/Magnum/Primitives/Cube.h | 9 +++++---- src/Magnum/Primitives/Line.h | 5 +++-- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index dd1ddd268..fdb6c7ce1 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -413,6 +413,11 @@ See also: @relativeref{Platform::Sdl2Application,setClipboardText()} to @ref Platform::Sdl2Application and @ref Platform::GlfwApplication +@subsubsection changelog-latest-new-primitives Primitives library + +- Added an option to generate texture coordinates in various layouts to + @ref Primitives::cubeSolid() + @subsubsection changelog-latest-new-scenegraph SceneGraph library - Added @ref SceneGraph::Object::move() diff --git a/src/Magnum/Primitives/Axis.h b/src/Magnum/Primitives/Axis.h index 0452b7ca6..cd13251c1 100644 --- a/src/Magnum/Primitives/Axis.h +++ b/src/Magnum/Primitives/Axis.h @@ -47,7 +47,8 @@ mesh through @ref MeshTools::copy() to get a mutable copy, if needed. @image html primitives-axis2d.png width=256px -@see @ref axis3D(), @ref crosshair2D(), @ref line2D() +@see @ref axis3D(), @ref crosshair2D(), + @ref line2D(const Vector2&, const Vector2&) */ MAGNUM_PRIMITIVES_EXPORT Trade::MeshData axis2D(); @@ -63,7 +64,8 @@ pass the mesh through @ref MeshTools::copy() to get a mutable copy, if needed. @image html primitives-axis3d.png width=256px -@see @ref axis2D(), @ref crosshair3D(), @ref line3D() +@see @ref axis2D(), @ref crosshair3D(), + @ref line3D(const Vector3&, const Vector3&) */ MAGNUM_PRIMITIVES_EXPORT Trade::MeshData axis3D(); diff --git a/src/Magnum/Primitives/Crosshair.h b/src/Magnum/Primitives/Crosshair.h index e381d32e5..fb810088b 100644 --- a/src/Magnum/Primitives/Crosshair.h +++ b/src/Magnum/Primitives/Crosshair.h @@ -45,7 +45,8 @@ mesh through @ref MeshTools::copy() to get a mutable copy, if needed. @image html primitives-crosshair2d.png width=256px -@see @ref crosshair3D(), @ref axis2D(), @ref line2D() +@see @ref crosshair3D(), @ref axis2D(), + @ref line2D(const Vector2&, const Vector2&) */ MAGNUM_PRIMITIVES_EXPORT Trade::MeshData crosshair2D(); @@ -59,7 +60,8 @@ mesh through @ref MeshTools::copy() to get a mutable copy, if needed. @image html primitives-crosshair3d.png width=256px -@see @ref crosshair2D(), @ref axis2D(), @ref line3D() +@see @ref crosshair2D(), @ref axis2D(), + @ref line3D(const Vector3&, const Vector3&) */ MAGNUM_PRIMITIVES_EXPORT Trade::MeshData crosshair3D(); diff --git a/src/Magnum/Primitives/Cube.h b/src/Magnum/Primitives/Cube.h index 4d848220e..cfda4ce9c 100644 --- a/src/Magnum/Primitives/Cube.h +++ b/src/Magnum/Primitives/Cube.h @@ -134,11 +134,12 @@ typedef Containers::EnumSet CubeFlags; CORRADE_ENUMSET_OPERATORS(CubeFlags) /** -@brief Solid 3D cube +@brief Solid cube 2x2x2 cube, centered at origin. @ref MeshPrimitive::Triangles with @ref MeshIndexType::UnsignedShort indices, interleaved -@ref VertexFormat::Vector3 positions, flat @ref VertexFormat::Vector3 normals, optional @ref VertexFormat::Vector4 tangents and optional +@ref VertexFormat::Vector3 positions, flat @ref VertexFormat::Vector3 normals, +optional @ref VertexFormat::Vector4 tangents and optional @ref VertexFormat::Vector2 texture coordinates. If no @p flags are passed, the returned instance references @ref Trade::DataFlag::Global data --- pass the mesh through @ref MeshTools::copy() to get a mutable copy, if needed. @@ -162,7 +163,7 @@ MAGNUM_PRIMITIVES_EXPORT Trade::MeshData cubeSolid(CubeFlags flags); #endif /** -@brief Solid 3D cube as a single strip +@brief Solid cube as a single strip 2x2x2 cube, centered at origin. Non-indexed @ref MeshPrimitive::TriangleStrip with @ref VertexFormat::Vector3 positions. No normals or anything else, use @@ -181,7 +182,7 @@ adapted to exactly match the output of this function): MAGNUM_PRIMITIVES_EXPORT Trade::MeshData cubeSolidStrip(); /** -@brief Wireframe 3D cube +@brief Wireframe cube 2x2x2 cube, centered at origin. @ref MeshPrimitive::Lines with @ref MeshIndexType::UnsignedShort indices and @ref VertexFormat::Vector3 diff --git a/src/Magnum/Primitives/Line.h b/src/Magnum/Primitives/Line.h index b88cbf4bc..3812819dd 100644 --- a/src/Magnum/Primitives/Line.h +++ b/src/Magnum/Primitives/Line.h @@ -44,7 +44,7 @@ going from @p a to @p b. @image html primitives-line2d.png width=256px -@see @ref line3D(), @ref line3D(const Vector3&, const Vector3&), @ref axis2D(), +@see @ref line2D(), @ref line3D(const Vector3&, const Vector3&), @ref axis2D(), @ref crosshair2D() */ MAGNUM_PRIMITIVES_EXPORT Trade::MeshData line2D(const Vector2& a, const Vector2& b); @@ -52,7 +52,8 @@ MAGNUM_PRIMITIVES_EXPORT Trade::MeshData line2D(const Vector2& a, const Vector2& /** @brief 2D line in an identity transformation -Equivalent to calling @ref line2D(const Vector2&, const Vector2&) as +Unit-size line in direction of positive X axis. Equivalent to calling +@ref line2D(const Vector2&, const Vector2&) as @snippet Primitives.cpp line2D-identity */