PeriDyno 1.0.0
Loading...
Searching...
No Matches
PJSoftConstraintSolver.h
Go to the documentation of this file.
1
17
18#pragma once
21
22#include "Topology/DiscreteElements.h"
23
24#include "Collision/Attribute.h"
26
27namespace dyno
28{
29 template<typename TDataType>
31 {
33 public:
34 typedef typename TDataType::Real Real;
35 typedef typename TDataType::Coord Coord;
36 typedef typename TDataType::Matrix Matrix;
37
38 typedef typename ::dyno::Quat<Real> TQuat;
39 typedef typename ::dyno::TContactPair<Real> ContactPair;
40 typedef typename ::dyno::TConstraintPair<Real> Constraint;
41
42 typedef typename ::dyno::BallAndSocketJoint<Real> BallAndSocketJoint;
43 typedef typename ::dyno::SliderJoint<Real> SliderJoint;
44 typedef typename ::dyno::HingeJoint<Real> HingeJoint;
45 typedef typename ::dyno::FixedJoint<Real> FixedJoint;
46 typedef typename ::dyno::PointJoint<Real> PointJoint;
47
50
51 public:
52 DEF_VAR(bool, FrictionEnabled, true, "");
53
54 DEF_VAR(bool, GravityEnabled, true, "");
55
56 DEF_VAR(Real, GravityValue, 9.8, "");
57
58 DEF_VAR(Real, FrictionCoefficient, 100, "");
59
60 DEF_VAR(Real, Slop, 0, "");
61
62 DEF_VAR(uint, IterationNumberForVelocitySolver, 300, "");
63
65
66 DEF_VAR(Real, AngularDamping, 0.1, "");
67
68 DEF_VAR(Real, DampingRatio, 1.0, "");
69
70 DEF_VAR(Real, Hertz, 300, "");
71
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 protected:
101 void constrain() override;
102
103 private:
105
106 private:
109
112
115
117
119
121
125 };
126}
#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.
DEF_ARRAY_IN(Coord, Center, DeviceType::GPU, "Center of rigid bodies")
::dyno::TContactPair< Real > ContactPair
DEF_VAR(uint, IterationNumberForVelocitySolver, 300, "")
DArray< Constraint > mVelocityConstraints
DArray< ContactPair > mContactsInLocalFrame
void initializeJacobian(Real dt)
DEF_ARRAY_IN(ContactPair, Contacts, DeviceType::GPU, "")
::dyno::FixedJoint< Real > FixedJoint
::dyno::PointJoint< Real > PointJoint
DEF_VAR(Real, FrictionCoefficient, 100, "")
DEF_VAR(Real, AngularDamping, 0.1, "")
DEF_ARRAY_IN(Matrix, Inertia, DeviceType::GPU, "Interial matrix")
DEF_VAR(bool, GravityEnabled, true, "")
::dyno::SliderJoint< Real > SliderJoint
DEF_VAR(Real, GravityValue, 9.8, "")
DEF_ARRAY_IN(Real, FrictionCoefficients, DeviceType::GPU, "FrictionCoefficients of rigid bodies")
DEF_VAR(Real, DampingRatio, 1.0, "")
DEF_ARRAY_IN(TQuat, Quaternion, DeviceType::GPU, "Quaternion")
DEF_VAR_IN(Real, TimeStep, "Time step size")
DEF_VAR(Real, Slop, 0, "")
DEF_VAR(Real, LinearDamping, 0.1, "")
DEF_INSTANCE_IN(DiscreteElements< TDataType >, DiscreteElements, "")
DEF_ARRAY_IN(Matrix, InitialInertia, DeviceType::GPU, "Interial matrix")
::dyno::BallAndSocketJoint< Real > BallAndSocketJoint
DEF_ARRAY_IN(Real, Mass, DeviceType::GPU, "Mass of rigid bodies")
DEF_ARRAY_IN(Coord, AngularVelocity, DeviceType::GPU, "Angular velocity of rigid bodies")
::dyno::HingeJoint< Real > HingeJoint
DEF_ARRAY_IN(Coord, Velocity, DeviceType::GPU, "Velocity of rigid bodies")
DEF_VAR(bool, FrictionEnabled, true, "")
::dyno::TConstraintPair< Real > Constraint
DEF_ARRAY_IN(Attribute, Attribute, DeviceType::GPU, "Rigid body attributes")
DEF_VAR(Real, Hertz, 300, "")
DEF_ARRAY_IN(Matrix, RotationMatrix, DeviceType::GPU, "Rotation matrix of rigid bodies")
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