PeriDyno 1.0.0
Loading...
Searching...
No Matches
ParticleEmitter.cpp
Go to the documentation of this file.
1#include "ParticleEmitter.h"
2
3namespace dyno
4{
5 template<typename TDataType>
7 : ParametricModel<TDataType>()
8 {
9 this->setForceUpdate(true);
10 this->setAutoHidden(false);
11
12 this->varVelocityMagnitude()->setRange(Real(0), Real(10));
13 this->varSamplingDistance()->setRange(Real(0.001), Real(1.0));
14 this->varSpacing()->setRange(Real(0), Real(2));
15 }
16
17 template<typename TDataType>
23
24 template<typename TDataType>
29
30 template<typename TDataType>
37
38 template<typename TDataType>
40 {
41 mPosition.clear();
42 mVelocity.clear();
43
44 Real d = (this->stateElapsedTime()->getValue() - mTimeInterval) * this->varVelocityMagnitude()->getValue();
45
46 if (d > this->varSamplingDistance()->getValue() * this->varSpacing()->getValue())
47 {
48 this->generateParticles();
49
50 mTimeInterval = this->stateElapsedTime()->getValue();
51 }
52 }
53
54 template<typename TDataType>
56 {
57 return "Particle Emitters";
58 }
59
61}
#define DEFINE_CLASS(name)
Definition Object.h:140
virtual void resetStates()
Definition Node.cpp:214
void setForceUpdate(bool b)
Definition Node.cpp:544
void setAutoHidden(bool con)
Definition Node.cpp:68
void resetStates() override
DArray< Coord > mVelocity
std::string getNodeType() override
virtual void generateParticles()
DArray< Coord > mPosition
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25