PeriDyno 1.0.0
Loading...
Searching...
No Matches
ParticleSystem.cpp
Go to the documentation of this file.
1#include "ParticleSystem.h"
2
3namespace dyno
4{
6
8 : Node()
9 {
10 auto ptSet = std::make_shared<PointSet>();
11 this->statePointSet()->setDataPtr(ptSet);
12 }
13
14 ParticleSystem::~ParticleSystem()
15 {
16 }
17
18 std::string ParticleSystem::getNodeType()
19 {
20 return "ParticleSystem";
21 }
22
23 void ParticleSystem::resetStates()
24 {
25 auto ptSet = this->statePointSet()->getDataPtr();
26 if (ptSet == nullptr) return;
27
28 auto pts = ptSet->getPoints();
29
30 if (pts.size() > 0)
31 {
32 this->statePosition()->resize(pts.size());
33 this->stateVelocity()->resize(pts.size());
34 this->stateForce()->resize(pts.size());
35
36 this->statePosition()->getData().assign(pts);
37 this->stateVelocity()->getDataPtr()->reset();
38 }
39
41 }
42}
#define IMPLEMENT_CLASS(name)
Definition Object.h:79
virtual void resetStates()
Definition Node.cpp:214
This class represents the base class for more advanced particle-based nodes.
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25