From c13c61e17d6e4788cf05a3f4b63e79f93b225e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 17 Jul 2021 11:55:33 +0200 Subject: [PATCH] Trade: hint on related APIs in mutable MeshData access. --- src/Magnum/Trade/MeshData.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Trade/MeshData.h b/src/Magnum/Trade/MeshData.h index 6a19f91e1..0a2912549 100644 --- a/src/Magnum/Trade/MeshData.h +++ b/src/Magnum/Trade/MeshData.h @@ -646,10 +646,15 @@ cases when it's desirable to modify the data in-place, there's the @ref mutableIndexData(), @ref mutableVertexData(), @ref mutableIndices() and @ref mutableAttribute() set of functions. To use these, you need to check that the data are mutable using @ref indexDataFlags() or @ref vertexDataFlags() -first. The following snippet applies a transformation to the mesh data: +first, and if not then you may want to make a mutable copy first using +@ref MeshTools::owned(). The following snippet applies a transformation to the +mesh positions: @snippet MagnumTrade.cpp MeshData-usage-mutable +If the transformation includes a rotation or non-uniform scaling, you may want +to do a similar operation with normals and tangents as well. + @section Trade-MeshData-populating Populating an instance A @ref MeshData instance by default takes over the ownership of an