16 #ifndef SURGSIM_PHYSICS_RIGIDREPRESENTATIONBASE_H 17 #define SURGSIM_PHYSICS_RIGIDREPRESENTATIONBASE_H 19 #include "SurgSim/DataStructures/Location.h" 20 #include "SurgSim/Math/Shape.h" 21 #include "SurgSim/Physics/Representation.h" 22 #include "SurgSim/Physics/RigidLocalization.h" 23 #include "SurgSim/Physics/RigidState.h" 53 void resetState()
override;
69 void setDensity(
double rho);
73 double getDensity()
const;
77 double getMass()
const;
89 void setLinearDamping(
double linearDamping);
93 double getLinearDamping()
const;
97 void setAngularDamping(
double angularDamping);
101 double getAngularDamping()
const;
106 void setShape(
const std::shared_ptr<SurgSim::Math::Shape> shape);
110 const std::shared_ptr<SurgSim::Math::Shape> getShape()
const;
117 void setCollisionRepresentation(std::shared_ptr<SurgSim::Collision::Representation> representation)
override;
119 void beforeUpdate(
double dt)
override;
120 void afterUpdate(
double dt)
override;
123 bool doInitialize()
override;
124 bool doWakeUp()
override;
157 std::shared_ptr<SurgSim::Math::Shape>
m_shape;
168 void updateProperties();
170 virtual void updateGlobalInertiaMatrices(
const RigidState& state) = 0;
176 #include "SurgSim/Physics/RigidRepresentationBase-inl.h" 178 #endif // SURGSIM_PHYSICS_RIGIDREPRESENTATIONBASE_H double m_angularDamping
Angular damping parameter (in N.m.s.rad-1)
Definition: RigidRepresentationBase.h:148
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
std::shared_ptr< SurgSim::Math::Shape > m_shape
Shape to be used for the mass/inertia calculation.
Definition: RigidRepresentationBase.h:157
SurgSim::Math::Matrix33d m_localInertia
Inertia matrix in local coordinates.
Definition: RigidRepresentationBase.h:154
The Representation class defines the base class for all physics objects.
Definition: Representation.h:53
A Location defines a local position w.r.t.
Definition: Location.h:39
RigidState m_previousState
Previous rigid representation state.
Definition: RigidRepresentationBase.h:129
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
RigidState m_initialState
Initial rigid representation state (useful for reset)
Definition: RigidRepresentationBase.h:127
The RigidRepresentationBase class defines the base class for all rigid motion based representations (...
Definition: RigidRepresentationBase.h:38
The RigidState class describes a state (position and velocity information).
Definition: RigidState.h:31
double m_mass
Total mass of the object (in Kg)
Definition: RigidRepresentationBase.h:142
RigidState m_currentState
Current rigid representation state.
Definition: RigidRepresentationBase.h:131
double m_rho
Density of the object (in Kg.m-3)
Definition: RigidRepresentationBase.h:139
bool m_parametersValid
Validity of the parameters.
Definition: RigidRepresentationBase.h:136
RigidState m_finalState
Last valid/final rigid representation state.
Definition: RigidRepresentationBase.h:133
double m_linearDamping
Linear damping parameter (in N.s.m-1 or Kg.s-1)
Definition: RigidRepresentationBase.h:145
SurgSim::Math::Vector3d m_massCenter
Mass-center of the object.
Definition: RigidRepresentationBase.h:151
Eigen::Matrix< double, 3, 3, Eigen::RowMajor > Matrix33d
A 3x3 matrix of doubles.
Definition: Matrix.h:51