PeriDyno 1.0.0
Loading...
Searching...
No Matches
DragSurfaceInteraction.h
Go to the documentation of this file.
1#pragma once
4#include "Topology/TriangleSet.h"
5
7
17
18namespace dyno
19{
20 template<typename TDataType>
22 {
24 public:
25 typedef typename TDataType::Real Real;
26 typedef typename TDataType::Coord Coord;
27 typedef typename TopologyModule::Edge Edge;
29
32
39
40 DEF_INSTANCE_IN(TriangleSet<TDataType>, InitialTriangleSet, "");
41
42 DEF_ARRAY_IN(Attribute, Attribute, DeviceType::GPU, "Particle attribute");
43
44 DEF_ARRAY_IN(Coord, Position, DeviceType::GPU, "");
45
46 DEF_ARRAY_IN(Coord, Velocity, DeviceType::GPU, "");
47
48 DEF_VAR(Real, InterationRadius, 0.005, "The radius of interaction");
49
50 DEF_VAR_IN(Real, TimeStep, "Time step");
51
52
53 protected:
54
55 void onEvent(PMouseEvent event) override;
56
57 private:
58 bool needInit = true;
59 std::shared_ptr<Camera> camera;
67
68 DArray<int> triIntersectedIndex; //reference for all triangles, int: 0,1
69 DArray<int> intersected_triangles; // reference for intersected list, int: tId
71 int intersectionCenterIndex; //intersected triangle (with out radius expanded).
72 DArray<Coord> intersectionCenter; //current pos of intersected triangle[intersectionCenterIndex]
73 };
74
76}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
particle attribute 0x00000000: [31-30]material; [29]motion; [28]Dynamic; [27-8]undefined yet,...
Definition Attribute.h:26
DEF_ARRAY_IN(Coord, Velocity, DeviceType::GPU, "")
void onEvent(PMouseEvent event) override
DEF_ARRAY_IN(Attribute, Attribute, DeviceType::GPU, "Particle attribute")
TopologyModule::Triangle Triangle
DEF_INSTANCE_IN(TriangleSet< TDataType >, InitialTriangleSet, "")
std::shared_ptr< Camera > camera
DEF_ARRAY_IN(Coord, Position, DeviceType::GPU, "")
DEF_VAR(Real, InterationRadius, 0.005, "The radius of interaction")
DEF_VAR_IN(Real, TimeStep, "Time step")
VectorND< PointType, 2 > Edge
Vector< PointType, 3 > Triangle
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89