Browse Source

Primitives: reference a more convenient MeshTools transformation API.

And reference it also from the other, embarrassingly trivial
MeshTools transform APIs.
pull/578/head
Vladimír Vondruš 4 years ago
parent
commit
8eb32b8b97
  1. 14
      src/Magnum/MeshTools/Transform.h
  2. 2
      src/Magnum/Primitives/Capsule.h
  3. 2
      src/Magnum/Primitives/Cone.h
  4. 2
      src/Magnum/Primitives/Cylinder.h

14
src/Magnum/MeshTools/Transform.h

@ -53,9 +53,10 @@ Example usage:
@snippet MagnumMeshTools.cpp transformVectors
@see @ref transformVectors(), @ref Matrix3::transformVector(),
@ref Matrix4::transformVector(), @ref Complex::transformVector(),
@ref Quaternion::transformVectorNormalized()
@see @ref transformVectors(), @ref transform2DInPlace(),
@ref transform3DInPlace(), @ref transformTextureCoordinates2DInPlace(),
@ref Matrix3::transformVector(), @ref Matrix4::transformVector(),
@ref Complex::transformVector(), @ref Quaternion::transformVectorNormalized()
@todo GPU transform feedback implementation (otherwise this is only bad joke)
*/
template<class T, class U> void transformVectorsInPlace(const Math::Matrix4<T>& matrix, U&& vectors) {
@ -82,6 +83,7 @@ template<class T, class U> void transformVectorsInPlace(const Math::Quaternion<T
Returns transformed vectors instead of modifying them in-place. See
@ref transformVectorsInPlace() for more information.
@see @ref transform2D(), @ref transform3D(), @ref transformTextureCoordinates2D()
*/
template<class T, class U> U transformVectors(const T& transformation, U vectors) {
U result(std::move(vectors));
@ -105,8 +107,9 @@ Example usage:
@snippet MagnumMeshTools.cpp transformPoints
@see @ref transformPoints(), @ref Matrix3::transformPoint(),
@ref Matrix4::transformPoint(),
@see @ref transformPoints(), @ref transform2DInPlace(),
@ref transform3DInPlace(), @ref transformTextureCoordinates2DInPlace(),
@ref Matrix3::transformPoint(), @ref Matrix4::transformPoint(),
@ref DualQuaternion::transformPointNormalized()
*/
template<class T, class U> void transformPointsInPlace(const Math::Matrix4<T>& matrix, U&& points) {
@ -133,6 +136,7 @@ template<class T, class U> void transformPointsInPlace(const Math::DualQuaternio
Returns transformed points instead of modifying them in-place. See
@ref transformPointsInPlace() for more information.
@see @ref transform2D(), @ref transform3D(), @ref transformTextureCoordinates2D()
*/
template<class T, class U> U transformPoints(const T& transformation, U vectors) {
U result(std::move(vectors));

2
src/Magnum/Primitives/Capsule.h

@ -110,7 +110,7 @@ segment are duplicated for texture wrapping.
The capsule is by default created with radius set to @f$ 1.0 @f$. In order to
get radius @f$ r @f$, length @f$ l @f$ and preserve correct normals, set
@p halfLength to @f$ 0.5 \frac{l}{r} @f$ and then scale all positions by
@f$ r @f$, for example using @ref MeshTools::transformPointsInPlace().
@f$ r @f$, for example using @ref MeshTools::transform3D().
@see @ref capsule3DWireframe(), @ref capsule2DWireframe(), @ref cylinderSolid()
*/
MAGNUM_PRIMITIVES_EXPORT Trade::MeshData capsule3DSolid(UnsignedInt hemisphereRings, UnsignedInt cylinderRings, UnsignedInt segments, Float halfLength, CapsuleFlags flags = {});

2
src/Magnum/Primitives/Cone.h

@ -101,7 +101,7 @@ properly smooth normals over the whole area, the tip consists of
The cone is by default created with radius set to @f$ 1.0 @f$. In order to get
radius @f$ r @f$, length @f$ l @f$ and preserve correct normals, set
@p halfLength to @f$ 0.5 \frac{l}{r} @f$ and then scale all positions by
@f$ r @f$, for example using @ref MeshTools::transformPointsInPlace().
@f$ r @f$, for example using @ref MeshTools::transform3D().
@see @ref coneWireframe(), @ref cylinderSolid()
*/
MAGNUM_PRIMITIVES_EXPORT Trade::MeshData coneSolid(UnsignedInt rings, UnsignedInt segments, Float halfLength, ConeFlags flags = {});

2
src/Magnum/Primitives/Cylinder.h

@ -100,7 +100,7 @@ texture wrapping.
The cylinder is by default created with radius set to @f$ 1.0 @f$. In order to
get radius @f$ r @f$, length @f$ l @f$ and preserve correct normals, set
@p halfLength to @f$ 0.5 \frac{l}{r} @f$ and then scale all positions by
@f$ r @f$, for example using @ref MeshTools::transformPointsInPlace().
@f$ r @f$, for example using @ref MeshTools::transform3D().
@see @ref cylinderWireframe(), @ref coneSolid()
*/
MAGNUM_PRIMITIVES_EXPORT Trade::MeshData cylinderSolid(UnsignedInt rings, UnsignedInt segments, Float halfLength, CylinderFlags flags = {});

Loading…
Cancel
Save