SVertexManipulator.h 905 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (C) 2009-2012 Christian Stehno
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #pragma once
  5. #include "vector3d.h"
  6. namespace irr
  7. {
  8. namespace scene
  9. {
  10. class IMesh;
  11. class IMeshBuffer;
  12. struct SMesh;
  13. //! Interface for vertex manipulators.
  14. /** You should derive your manipulator from this class if it shall be called for every vertex, getting as parameter just the vertex.
  15. */
  16. struct IVertexManipulator
  17. {
  18. };
  19. //! Vertex manipulator which scales the position of the vertex
  20. class SVertexPositionScaleManipulator : public IVertexManipulator
  21. {
  22. public:
  23. SVertexPositionScaleManipulator(const core::vector3df &factor) :
  24. Factor(factor) {}
  25. template <typename VType>
  26. void operator()(VType &vertex) const
  27. {
  28. vertex.Pos *= Factor;
  29. }
  30. private:
  31. core::vector3df Factor;
  32. };
  33. } // end namespace scene
  34. } // end namespace irr