Add ScaleAlongNormals manipulator.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2858 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2009-11-13 14:58:37 +00:00
parent 372161fa0c
commit 02b5e40616
1 changed files with 17 additions and 0 deletions

View File

@ -231,6 +231,23 @@ namespace scene
core::vector3df Factor;
};
//! Vertex manipulator which scales the position of the vertex along the normals
/** This can look more pleasing than the usual Scale operator, but
depends on the mesh geometry.
*/
class SVertexPositionScaleAlongNormalsManipulator : public IVertexManipulator
{
public:
SVertexPositionScaleAlongNormalsManipulator(const core::vector3df& factor) : Factor(factor) {}
template <typename VType>
void operator()(VType& vertex) const
{
vertex.Pos += vertex.Normal*Factor;
}
private:
core::vector3df Factor;
};
//! Vertex manipulator which transforms the position of the vertex
class SVertexPositionTransformManipulator : public IVertexManipulator
{