PeriDyno 1.0.0
Loading...
Searching...
No Matches
TJSoftConstraintSolver.h
Go to the documentation of this file.
1
17
18#pragma once
21
22#include "Topology/DiscreteElements.h"
23#include "Collision/Attribute.h"
25
26namespace dyno
27{
28 template<typename TDataType>
30 {
32 public:
33 typedef typename TDataType::Real Real;
34 typedef typename TDataType::Coord Coord;
35 typedef typename TDataType::Matrix Matrix;
36
37 typedef typename ::dyno::Quat<Real> TQuat;
38 typedef typename ::dyno::TContactPair<Real> ContactPair;
39 typedef typename ::dyno::TConstraintPair<Real> Constraint;
40
41 typedef typename ::dyno::BallAndSocketJoint<Real> BallAndSocketJoint;
42 typedef typename ::dyno::SliderJoint<Real> SliderJoint;
43 typedef typename ::dyno::HingeJoint<Real> HingeJoint;
44 typedef typename ::dyno::FixedJoint<Real> FixedJoint;
45 typedef typename ::dyno::PointJoint<Real> PointJoint;
46
49
50 public:
51 DEF_VAR(bool, FrictionEnabled, true, "");
52
53 DEF_VAR(bool, GravityEnabled, true, "");
54
55 DEF_VAR(Real, GravityValue, 9.8, "");
56
57 DEF_VAR(Real, FrictionCoefficient, 100, "");
58
59 DEF_VAR(Real, Slop, 0, "");
60
61 DEF_VAR(uint, IterationNumberForVelocitySolver, 30, "");
62
63 DEF_VAR(uint, SubStepping, 10, "");
64
66
67 DEF_VAR(Real, AngularDamping, 0.1, "");
68
69 DEF_VAR(Real, DampingRatio, 1.0, "");
70
71 DEF_VAR(Real, Hertz, 300, "");
72
73 public:
74 DEF_VAR_IN(Real, TimeStep, "Time step size");
75
76 DEF_ARRAY_IN(Real, Mass, DeviceType::GPU, "Mass of rigid bodies");
77
78 DEF_ARRAY_IN(Coord, Center, DeviceType::GPU, "Center of rigid bodies");
79
80 DEF_ARRAY_IN(Coord, Velocity, DeviceType::GPU, "Velocity of rigid bodies");
81
82 DEF_ARRAY_IN(Coord, AngularVelocity, DeviceType::GPU, "Angular velocity of rigid bodies");
83
84 DEF_ARRAY_IN(Matrix, RotationMatrix, DeviceType::GPU, "Rotation matrix of rigid bodies");
85
86 DEF_ARRAY_IN(Matrix, Inertia, DeviceType::GPU, "Interial matrix");
87
88 DEF_ARRAY_IN(Matrix, InitialInertia, DeviceType::GPU, "Interial matrix");
89
90 DEF_ARRAY_IN(TQuat, Quaternion, DeviceType::GPU, "Quaternion");
91
92 DEF_ARRAY_IN(ContactPair, Contacts, DeviceType::GPU, "");
93
95
96 DEF_ARRAY_IN(Attribute, Attribute, DeviceType::GPU, "Rigid body attributes");
97
98 DEF_ARRAY_IN(Real, FrictionCoefficients, DeviceType::GPU, "FrictionCoefficients of rigid bodies");
99
100
101 protected:
102 void constrain() override;
103
104 private:
106
107 private:
110
113
116
118
120
122
126 };
127}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
particle attribute 0x00000000: [31-30]material; [29]motion; [28]Dynamic; [27-8]undefined yet,...
Definition Attribute.h:26
A linear damping model.
::dyno::BallAndSocketJoint< Real > BallAndSocketJoint
DEF_VAR(Real, AngularDamping, 0.1, "")
DEF_ARRAY_IN(ContactPair, Contacts, DeviceType::GPU, "")
void initializeJacobian(Real dt)
DEF_ARRAY_IN(Matrix, InitialInertia, DeviceType::GPU, "Interial matrix")
DEF_ARRAY_IN(Attribute, Attribute, DeviceType::GPU, "Rigid body attributes")
::dyno::PointJoint< Real > PointJoint
DEF_VAR(uint, SubStepping, 10, "")
DEF_VAR(Real, LinearDamping, 0.1, "")
::dyno::FixedJoint< Real > FixedJoint
DEF_ARRAY_IN(Real, FrictionCoefficients, DeviceType::GPU, "FrictionCoefficients of rigid bodies")
DEF_ARRAY_IN(Matrix, RotationMatrix, DeviceType::GPU, "Rotation matrix of rigid bodies")
DEF_VAR(Real, GravityValue, 9.8, "")
DArray< ContactPair > mContactsInLocalFrame
DEF_VAR(uint, IterationNumberForVelocitySolver, 30, "")
DEF_VAR(Real, DampingRatio, 1.0, "")
::dyno::TConstraintPair< Real > Constraint
DEF_VAR(Real, Slop, 0, "")
DEF_INSTANCE_IN(DiscreteElements< TDataType >, DiscreteElements, "")
::dyno::HingeJoint< Real > HingeJoint
DEF_ARRAY_IN(Real, Mass, DeviceType::GPU, "Mass of rigid bodies")
DArray< Constraint > mVelocityConstraints
::dyno::TContactPair< Real > ContactPair
DEF_VAR(bool, GravityEnabled, true, "")
DEF_ARRAY_IN(Coord, Velocity, DeviceType::GPU, "Velocity of rigid bodies")
::dyno::SliderJoint< Real > SliderJoint
DEF_ARRAY_IN(TQuat, Quaternion, DeviceType::GPU, "Quaternion")
DEF_VAR_IN(Real, TimeStep, "Time step size")
DEF_ARRAY_IN(Coord, Center, DeviceType::GPU, "Center of rigid bodies")
DEF_ARRAY_IN(Matrix, Inertia, DeviceType::GPU, "Interial matrix")
DEF_ARRAY_IN(Coord, AngularVelocity, DeviceType::GPU, "Angular velocity of rigid bodies")
DEF_VAR(Real, FrictionCoefficient, 100, "")
DEF_VAR(Real, Hertz, 300, "")
DEF_VAR(bool, FrictionEnabled, true, "")
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89
unsigned int uint
Definition VkProgram.h:14