2019-12-12 17:32:41 +01:00
|
|
|
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
2021-08-27 17:55:04 +02:00
|
|
|
#ifndef IRR_C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED
|
|
|
|
#define IRR_C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
#include "IrrCompileConfig.h"
|
|
|
|
#ifdef _IRR_COMPILE_WITH_PARTICLES_
|
|
|
|
|
|
|
|
#include "IParticleRotationAffector.h"
|
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace scene
|
|
|
|
{
|
|
|
|
|
|
|
|
//! Particle Affector for rotating particles about a point
|
|
|
|
class CParticleRotationAffector : public IParticleRotationAffector
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
CParticleRotationAffector( const core::vector3df& speed = core::vector3df(5.0f, 5.0f, 5.0f),
|
|
|
|
const core::vector3df& point = core::vector3df() );
|
|
|
|
|
|
|
|
//! Affects a particle.
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void affect(u32 now, SParticle* particlearray, u32 count) IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! Set the point that particles will attract to
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void setPivotPoint( const core::vector3df& point ) IRR_OVERRIDE { PivotPoint = point; }
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! Set the speed in degrees per second
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void setSpeed( const core::vector3df& speed ) IRR_OVERRIDE { Speed = speed; }
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! Get the point that particles are attracted to
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual const core::vector3df& getPivotPoint() const IRR_OVERRIDE { return PivotPoint; }
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! Get the speed in degrees per second
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual const core::vector3df& getSpeed() const IRR_OVERRIDE { return Speed; }
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! Writes attributes of the object.
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
//! Reads attributes of the object.
|
2021-08-27 14:55:10 +02:00
|
|
|
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) IRR_OVERRIDE;
|
2019-12-12 17:32:41 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
core::vector3df PivotPoint;
|
|
|
|
core::vector3df Speed;
|
|
|
|
u32 LastTime;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace scene
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif // _IRR_COMPILE_WITH_PARTICLES_
|
|
|
|
|
2021-08-27 17:55:04 +02:00
|
|
|
#endif // IRR_C_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED
|