2023-10-03 20:37:00 +02:00
|
|
|
// Copyright (C) 2009-2012 Christian Stehno
|
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
2024-02-25 22:01:20 +01:00
|
|
|
#pragma once
|
2023-10-03 20:37:00 +02:00
|
|
|
|
|
|
|
#include "matrix4.h"
|
|
|
|
#include "S3DVertex.h"
|
|
|
|
#include "SColor.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
class IMesh;
|
|
|
|
class IMeshBuffer;
|
|
|
|
struct SMesh;
|
|
|
|
|
|
|
|
//! Interface for vertex manipulators.
|
|
|
|
/** You should derive your manipulator from this class if it shall be called for every vertex, getting as parameter just the vertex.
|
|
|
|
*/
|
|
|
|
struct IVertexManipulator
|
|
|
|
{
|
|
|
|
};
|
2023-10-03 20:37:00 +02:00
|
|
|
|
2024-03-20 19:35:52 +01:00
|
|
|
//! Vertex manipulator which scales the position of the vertex
|
|
|
|
class SVertexPositionScaleManipulator : public IVertexManipulator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SVertexPositionScaleManipulator(const core::vector3df &factor) :
|
|
|
|
Factor(factor) {}
|
|
|
|
template <typename VType>
|
|
|
|
void operator()(VType &vertex) const
|
2023-10-03 20:37:00 +02:00
|
|
|
{
|
2024-03-20 19:35:52 +01:00
|
|
|
vertex.Pos *= Factor;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
core::vector3df Factor;
|
|
|
|
};
|
2023-10-03 20:37:00 +02:00
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|