PeriDyno 0.9.2
Loading...
Searching...
No Matches
StaticBoundary.h
Go to the documentation of this file.
1#pragma once
2#include "Node.h"
4
5#include "ParticleSystem.h"
6#include "FilePath.h"
7
8
9namespace dyno {
10 template <typename TDataType> class DistanceField3D;
11 template <typename TDataType> class BoundaryConstraint;
12
13 template<typename TDataType>
14 class StaticBoundary : public Node
15 {
17 public:
18 typedef typename TDataType::Real Real;
19 typedef typename TDataType::Coord Coord;
20
22 ~StaticBoundary() override;
23
24 void loadSDF(std::string filename, bool bOutBoundary = false);
25 std::shared_ptr<Node> loadCube(Coord lo, Coord hi, Real distance = 0.005f, bool bOutBoundary = false);
26 void loadShpere(Coord center, Real r, Real distance = 0.005f, bool bOutBoundary = false, bool bVisible = false);
27
28 void translate(Coord t);
29 void scale(Real s);
30
31 void resetStates();
32 protected:
33 void updateStates() override;
34
35 public:
36 DEF_VAR(Real, TangentialFriction, 0.0, "Tangential friction");
37 DEF_VAR(Real, NormalFriction, 1.0, "Normal friction");
38
39 DEF_VAR(Vec3f, CubeVertex_lo, Vec3f(0.0f), "Cube");
40 DEF_VAR(Vec3f, CubeVertex_hi, Vec3f(1.0f), "Cube");
41
43
44 std::vector<std::shared_ptr<BoundaryConstraint<TDataType>>> m_obstacles;
45
46 std::vector<std::shared_ptr<RigidBody<TDataType>>> m_rigids;
47 std::vector<std::shared_ptr<ParticleSystem<TDataType>>> m_particleSystems;
48
51 };
52}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
This class represents the base class for more advanced particle-based nodes.
TDataType::Coord Coord
void loadShpere(Coord center, Real r, Real distance=0.005f, bool bOutBoundary=false, bool bVisible=false)
void loadSDF(std::string filename, bool bOutBoundary=false)
std::vector< std::shared_ptr< BoundaryConstraint< TDataType > > > m_obstacles
std::vector< std::shared_ptr< RigidBody< TDataType > > > m_rigids
TDataType::Real Real
void updateStates() override
std::vector< std::shared_ptr< ParticleSystem< TDataType > > > m_particleSystems
DEF_VAR(Real, TangentialFriction, 0.0, "Tangential friction")
DEF_NODE_PORTS(RigidBody< TDataType >, RigidBody, "A rigid body")
DEF_VAR(Real, NormalFriction, 1.0, "Normal friction")
DEF_VAR(FilePath, FileName, "", "")
DEF_NODE_PORTS(ParticleSystem< TDataType >, ParticleSystem, "Particle Systems")
std::shared_ptr< Node > loadCube(Coord lo, Coord hi, Real distance=0.005f, bool bOutBoundary=false)
DEF_VAR(Vec3f, CubeVertex_hi, Vec3f(1.0f), "Cube")
DEF_VAR(Vec3f, CubeVertex_lo, Vec3f(0.0f), "Cube")
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:24
Vector< float, 3 > Vec3f
Definition Vector3D.h:93