32 template<
typename TDataType>
36 typedef typename TDataType::Real
Real;
37 typedef typename TDataType::Coord
Coord;
38 typedef typename TDataType::Matrix
Matrix;
83 const std::shared_ptr<PdActor> actor,
88 const std::shared_ptr<PdActor> actor,
93 const std::shared_ptr<PdActor> actor,
98 std::shared_ptr<PdActor> actor1,
99 std::shared_ptr<PdActor> actor2)
108 std::shared_ptr<PdActor> actor1,
109 std::shared_ptr<PdActor> actor2)
118 std::shared_ptr<PdActor> actor1,
119 std::shared_ptr<PdActor> actor2)
128 std::shared_ptr<PdActor> actor1,
129 std::shared_ptr<PdActor> actor2)
138 std::shared_ptr<PdActor> actor1)
147 std::shared_ptr<PdActor> actor1)
167 DEF_VAR(
bool, FrictionEnabled,
true,
"A toggle to control the friction");
169 DEF_VAR(
bool, GravityEnabled,
true,
"A toggle to control the gravity");
particle attribute 0x00000000: [31-30]material; [29]motion; [28]Dynamic; [27-8]undefined yet,...
std::shared_ptr< PdActor > addBox(const BoxInfo &box, const RigidBodyInfo &bodyDef, const Real density=Real(100))
DArray2D< Vec3f > getNormals()
SliderJoint & createSliderJoint(std::shared_ptr< PdActor > actor1, std::shared_ptr< PdActor > actor2)
HingeJoint & createHingeJoint(std::shared_ptr< PdActor > actor1, std::shared_ptr< PdActor > actor2)
DEF_ARRAY_STATE(CollisionMask, CollisionMask, DeviceType::GPU, "Collision mask for each rigid body")
DEF_VAR(bool, FrictionEnabled, true, "A toggle to control the friction")
void resetStates() override
void clearRigidBodySystem()
std::vector< BoxInfo > mHostBoxes
dyno::TSphere3D< Real > Sphere3D
std::shared_ptr< PdActor > createRigidBody(const RigidBodyInfo &bodyDef)
std::string getNodeType() override
DEF_VAR(Real, FrictionCoefficient, 200, "")
std::shared_ptr< PdActor > createRigidBody(const Coord &p, const TQuat &q)
Mat3f pointInertia(Coord v1)
void setupShape2RigidBodyMapping()
::dyno::PointJoint< Real > PointJoint
DArray< TetInfo > mDeviceTets
std::shared_ptr< PdActor > addTet(const TetInfo &tet, const RigidBodyInfo &bodyDef, const Real density=Real(100))
DArray< RigidBodyInfo > mDeviceRigidBodyStates
std::vector< HingeJoint > mHostJointsHinge
DEF_VAR(Real, Slop, 0.0001, "")
DEF_ARRAY_STATE(Attribute, Attribute, DeviceType::GPU, "Rigid body attributes")
FixedJoint & createFixedJoint(std::shared_ptr< PdActor > actor1, std::shared_ptr< PdActor > actor2)
std::vector< BallAndSocketJoint > mHostJointsBallAndSocket
FixedJoint & createUnilateralFixedJoint(std::shared_ptr< PdActor > actor1)
DEF_VAR(bool, GravityEnabled, true, "A toggle to control the gravity")
std::vector< RigidBodyInfo > mHostRigidBodyStates
void bindBox(const std::shared_ptr< PdActor > actor, const BoxInfo &box, const Real density=Real(100))
DArray2D< Vec3f > getSamples()
DArray2D< Vec3f > m_deviceNormals
DEF_ARRAY_STATE(TQuat, Quaternion, DeviceType::GPU, "Quaternion")
DEF_ARRAY_STATE(Coord, Velocity, DeviceType::GPU, "Velocity of rigid bodies")
Rigid Velocity.
dyno::TOrientedBox3D< Real > Box3D
DEF_ARRAY_STATE(Real, FrictionCoefficients, DeviceType::GPU, "FrictionCoefficients of rigid bodies")
DEF_ARRAY_STATE(Matrix, Inertia, DeviceType::GPU, "Inertia matrix")
std::shared_ptr< PdActor > addCapsule(const CapsuleInfo &capsule, const RigidBodyInfo &bodyDef, const Real density=Real(100))
DArray< CapsuleInfo > mDeviceCapsules
DEF_ARRAY_STATE(Coord, Center, DeviceType::GPU, "Center of rigid bodies")
Rigid Position.
int getSamplingPointSize()
DArray< BoxInfo > mDeviceBoxes
::dyno::BallAndSocketJoint< Real > BallAndSocketJoint
std::vector< CapsuleInfo > mHostCapsules
std::vector< SphereInfo > mHostSpheres
void bindCapsule(const std::shared_ptr< PdActor > actor, const CapsuleInfo &capsule, const Real density=Real(100))
std::vector< Pair< uint, uint > > mHostShape2RigidBodyMapping
DArray< SphereInfo > mDeviceSpheres
::dyno::SliderJoint< Real > SliderJoint
DEF_VAR(Real, GravityValue, 9.8, "")
void postUpdateStates() override
::dyno::HingeJoint< Real > HingeJoint
std::vector< FixedJoint > mHostJointsFixed
PointJoint & createPointJoint(std::shared_ptr< PdActor > actor1)
void bindSphere(const std::shared_ptr< PdActor > actor, const SphereInfo &sphere, const Real density=Real(100))
std::vector< Vec3f > samples
std::vector< Vec3f > normals
std::vector< SliderJoint > mHostJointsSlider
std::shared_ptr< PdActor > addSphere(const SphereInfo &sphere, const RigidBodyInfo &bodyDef, const Real density=Real(100))
std::vector< PointJoint > mHostJointsPoint
~RigidBodySystem() override
DEF_ARRAY_STATE(Real, Mass, DeviceType::GPU, "Mass of rigid bodies")
Rigid Mass.
DEF_INSTANCE_STATE(DiscreteElements< TDataType >, Topology, "Topology")
std::vector< TetInfo > mHostTets
DArray2D< Vec3f > m_deviceSamples
DEF_ARRAY_STATE(Matrix, RotationMatrix, DeviceType::GPU, "Rotation matrix of rigid bodies")
Rigid Rotation.
DEF_ARRAY_STATE(Matrix, InitialInertia, DeviceType::GPU, "Initial inertia matrix")
::dyno::FixedJoint< Real > FixedJoint
BallAndSocketJoint & createBallAndSocketJoint(std::shared_ptr< PdActor > actor1, std::shared_ptr< PdActor > actor2)
DEF_ARRAY_STATE(Coord, AngularVelocity, DeviceType::GPU, "Angular velocity of rigid bodies")
Rigid Angular Velocity.
dyno::TContactPair< Real > ContactPair
3D geometric primitives in three-dimensional space
This is an implementation of AdditiveCCD based on peridyno.
SquareMatrix< float, 3 > Mat3f
Array< T, DeviceType::GPU > DArray
Array2D< T, DeviceType::GPU > DArray2D