Add ScaleAlongNormals manipulator.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2858 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
372161fa0c
commit
02b5e40616
|
@ -231,6 +231,23 @@ namespace scene
|
||||||
core::vector3df Factor;
|
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
|
//! Vertex manipulator which transforms the position of the vertex
|
||||||
class SVertexPositionTransformManipulator : public IVertexManipulator
|
class SVertexPositionTransformManipulator : public IVertexManipulator
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue