AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
VirtualConstraintInertia.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material without having a written signed agreement with Algoryx Simulation AB.
9
10Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
11from using this software, unless otherwise stated in written agreements with
12Algoryx Simulation AB.
13*/
14
15#ifndef AGX_VIRTUALCONSTRAINTINERTIA_H
16#define AGX_VIRTUALCONSTRAINTINERTIA_H
17
20#include <agx/Constraint.h>
21
22namespace agx
23{
25
36 {
37 public:
48 agx::Real rigidBody1TranslationInertia,
49 agx::Real rigidBody1RotationalInertia,
50 agx::Real rigidBody2TranslationInertia,
51 agx::Real rigidBody2RotationalInertia);
52
53 public:
58 void setRigidBody1TranslationalInertia(agx::Real translationalInertia);
59
64 void setRigidBody2TranslationalInertia(agx::Real translationalInertia);
65
72
79
85
92
98
105
109 virtual agx::RigidBody* getRigidBody1() const override;
110
114 virtual agx::RigidBody* getRigidBody2() const override;
115
117
118 protected:
123
128
132 virtual void prepare() override;
133
138 agx::StrongInteraction::MatrixData rb2DiagonalBlock,
139 agx::StrongInteraction::MatrixData offDiagonalBlock) override;
140
145 agx::Real* rb1Rhs,
147 agx::Real* rb2Rhs,
148 agx::Bool isRestingSolve) override;
149
150 protected:
152 {
157
158 void reset()
159 {
160 addedMassMatrix1.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );
161 addedMassMatrix2.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );
162 addedInertiaMatrix1.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );
163 addedInertiaMatrix2.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );
164 }
165 };
166
167 protected:
174 };
175}
176
177#endif /*AGX_VIRTUALINERTIAINTERACTION_H*/
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
#define AGXPHYSICS_EXPORT
The base class for a constraint.
Definition: Constraint.h:89
void set(T const *const ptr)
Definition: Matrix3x3.h:467
Pointer to a entity instance of type Physics.RigidBody.
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:49
Base class for a strong interaction concept where there interaction is defined in the mass matrix par...
This class will add a virtual inertia along or around the constraint axis (N-axis),...
void setRigidBody1TranslationalInertia(agx::Real translationalInertia)
Sets the virtual translational inertia that will be applied in the constraint interaction applied on ...
virtual ~VirtualConstraintInertia()
Reference counted object, protected destructor.
virtual void writeRhs(agx::Physics::RigidBodyPtr rb1, agx::Real *rb1Rhs, agx::Physics::RigidBodyPtr rb2, agx::Real *rb2Rhs, agx::Bool isRestingSolve) override
Write data to the right hand side, for dynamic bodies.
agx::Real getRigidBody2RotationalInertia() const
Gets the virtual rotational inertia that will be applied in the constraint interaction upon rigid bod...
agx::Real getRigidBody1TranslationalInertia() const
Gets the virtual translational inertia that will be applied in the constraint interaction applied on ...
virtual agx::RigidBody * getRigidBody1() const override
void setRigidBody2RotationalInertia(agx::Real rotationalInertia)
Sets the virtual rotational inertia that will be applied in the constraint interaction upon rigid bod...
virtual agx::RigidBody * getRigidBody2() const override
agx::Real getRigidBody2TranslationalInertia() const
Gets the virtual translational inertia that will be applied in the constraint interaction applied on ...
VirtualConstraintInertia(agx::Constraint *constraint, agx::Real rigidBody1TranslationInertia, agx::Real rigidBody1RotationalInertia, agx::Real rigidBody2TranslationInertia, agx::Real rigidBody2RotationalInertia)
Basic constructor that takes a constraint and the virtual inertias that should be applied in the cent...
void setRigidBody2TranslationalInertia(agx::Real translationalInertia)
Sets the virtual translational inertia that will be applied in the constraint interaction applied on ...
virtual void writeMatrixData(agx::StrongInteraction::MatrixData rb1DiagonalBlock, agx::StrongInteraction::MatrixData rb2DiagonalBlock, agx::StrongInteraction::MatrixData offDiagonalBlock) override
Write data for dynamic bodies.
virtual void prepare() override
Prepares for solve.
agx::Real getRigidBody1RotationalInertia() const
Gets the virtual rotational inertia that will be applied in the constraint interaction upon rigid bod...
VirtualConstraintInertia()
Default constructor used by serialization.
void setRigidBody1RotationalInertia(agx::Real rotationalInertia)
Sets the virtual rotational inertia that will be applied in the constraint interaction upon rigid bod...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:40
double Real
Definition: Real.h:41