Browse Source

DebugTools: deprecate ForceRendererOptions::scale() in favor of size().

Who named it like that?!
pull/317/head
Vladimír Vondruš 7 years ago
parent
commit
b31f886fe2
  1. 6
      doc/changelog.dox
  2. 2
      src/Magnum/DebugTools/ForceRenderer.cpp
  3. 12
      src/Magnum/DebugTools/ForceRenderer.h

6
doc/changelog.dox

@ -100,6 +100,12 @@ See also:
@ref platforms-android-apps-cmake "Gradle-less Android builds" now properly @ref platforms-android-apps-cmake "Gradle-less Android builds" now properly
creates the library output directory beforehand creates the library output directory beforehand
@subsection changelog-latest-deprecated Deprecated APIs
- @cpp DebugTools::ForceRendererOptions::scale() @ce is deprecated in favor
of @ref DebugTools::ForceRendererOptions::size(), as that's more consistent
with the documentation and the corresponding setter.
@section changelog-2019-01 2019.01 @section changelog-2019-01 2019.01
Released 2019-02-04, tagged as Released 2019-02-04, tagged as

2
src/Magnum/DebugTools/ForceRenderer.cpp

@ -81,7 +81,7 @@ template<UnsignedInt dimensions> ForceRenderer<dimensions>::ForceRenderer(SceneG
template<UnsignedInt dimensions> ForceRenderer<dimensions>::~ForceRenderer() = default; template<UnsignedInt dimensions> ForceRenderer<dimensions>::~ForceRenderer() = default;
template<UnsignedInt dimensions> void ForceRenderer<dimensions>::draw(const MatrixTypeFor<dimensions, Float>& transformationMatrix, SceneGraph::Camera<dimensions, Float>& camera) { template<UnsignedInt dimensions> void ForceRenderer<dimensions>::draw(const MatrixTypeFor<dimensions, Float>& transformationMatrix, SceneGraph::Camera<dimensions, Float>& camera) {
_shader->setTransformationProjectionMatrix(camera.projectionMatrix()*Implementation::forceRendererTransformation<dimensions>(transformationMatrix.transformPoint(_forcePosition), _force)*MatrixTypeFor<dimensions, Float>::scaling(VectorTypeFor<dimensions, Float>{_options->scale()})) _shader->setTransformationProjectionMatrix(camera.projectionMatrix()*Implementation::forceRendererTransformation<dimensions>(transformationMatrix.transformPoint(_forcePosition), _force)*MatrixTypeFor<dimensions, Float>::scaling(VectorTypeFor<dimensions, Float>{_options->size()}))
.setColor(_options->color()); .setColor(_options->color());
_mesh->draw(*_shader); _mesh->draw(*_shader);
} }

12
src/Magnum/DebugTools/ForceRenderer.h

@ -68,8 +68,16 @@ class ForceRendererOptions {
return *this; return *this;
} }
/** @brief Scale of rendered arrow */ /** @brief Size of rendered arrow */
constexpr Float scale() const { return _size; } constexpr Float size() const { return _size; }
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief size()
* @deprecated Use @ref size() instead.
*/
constexpr CORRADE_DEPRECATED("use size() instead") Float scale() const { return _size; }
#endif
/** /**
* @brief Set scale of rendered arrow * @brief Set scale of rendered arrow

Loading…
Cancel
Save