PeriDyno 1.0.0
Loading...
Searching...
No Matches
Vessel.h
Go to the documentation of this file.
1
16#pragma once
17#include "RigidBody/RigidBody.h"
18
19#include "Topology/TriangleSet.h"
20
21#include "FilePath.h"
23
24namespace dyno
25{
26 template<typename TDataType>
27 class Vessel : virtual public RigidBody<TDataType>
28 {
29 DECLARE_TCLASS(Vessel, TDataType)
30 public:
31 typedef typename TDataType::Real Real;
32 typedef typename TDataType::Coord Coord;
33 typedef typename TDataType::Matrix Matrix;
34
35 Vessel();
36 ~Vessel() override;
37
38 NBoundingBox boundingBox() override;
39
40 std::string getNodeType() override { return "Rigid Bodies"; }
41 public:
42 DEF_VAR(Coord, BarycenterOffset, Coord(0), "The center offset defined in vessel's local frame");
43
44 DEF_VAR(FilePath, EnvelopeName, "", "");
45
46 DEF_VAR(FilePath, TextureMeshName, "", "");
47
48 DEF_VAR(Real, Density, Real(1000), "Density");
49
50 DEF_VAR_STATE(Coord, Barycenter, Coord(0), "A vessel's barycenter, note it can be different from the Center");
51
52 DEF_INSTANCE_STATE(TriangleSet<TDataType>, Envelope, "Envelope for the vessel");
53
54 DEF_INSTANCE_STATE(TextureMesh, TextureMesh, "Texture mesh of the Vessel");
55
56 DEF_ARRAYLIST_STATE(Transform3f, InstanceTransform, DeviceType::GPU, "Instance transforms");
57
58 protected:
59 void resetStates() override;
60
61 void updateStates() override;
62
63 private:
64 void transform();
65
67
69 };
70
71 IMPLEMENT_TCLASS(Vessel, TDataType)
72}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
DEF_VAR(Coord, BarycenterOffset, Coord(0), "The center offset defined in vessel's local frame")
TDataType::Matrix Matrix
Definition Vessel.h:33
NBoundingBox boundingBox() override
Definition Vessel.cpp:80
~Vessel() override
Definition Vessel.cpp:74
DEF_INSTANCE_STATE(TextureMesh, TextureMesh, "Texture mesh of the Vessel")
DEF_ARRAYLIST_STATE(Transform3f, InstanceTransform, DeviceType::GPU, "Instance transforms")
DEF_VAR(FilePath, EnvelopeName, "", "")
DEF_VAR_STATE(Coord, Barycenter, Coord(0), "A vessel's barycenter, note it can be different from the Center")
void resetStates() override
Definition Vessel.cpp:90
DEF_INSTANCE_STATE(TriangleSet< TDataType >, Envelope, "Envelope for the vessel")
void transform()
Definition Vessel.cpp:205
void updateStates() override
Definition Vessel.cpp:158
DEF_VAR(Real, Density, Real(1000), "Density")
TDataType::Coord Coord
Definition Vessel.h:32
TriangleSet< TDataType > mInitialEnvelope
Definition Vessel.h:66
std::string getNodeType() override
Definition Vessel.h:40
DEF_VAR(FilePath, TextureMeshName, "", "")
TDataType::Real Real
Definition Vessel.h:31
Coord mShapeCenter
Definition Vessel.h:68
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Transform< float, 3 > Transform3f