Commit 02b5e406 authored by hybrid's avatar hybrid

Add ScaleAlongNormals manipulator.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2858 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 372161fa
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment