17#ifndef AGX_RIGIDBODYSTATE_H
18#define AGX_RIGIDBODYSTATE_H
28 class RigidBodyState :
public BitSet_small<agx::UInt32>
33 bool handleAsParticle()
const;
34 bool hasEffectiveMass()
const;
35 bool hasEffectiveInertia()
const;
38 bool mergedRootBody()
const;
39 bool powerline()
const;
40 bool isKinematicForParticles()
const;
42 void setKinematicForParticles(
bool flag);
45 friend class RigidBody;
46 friend class DynamicsSystem;
47 friend class MergedBody;
48 friend class MassPropertiesUpdate;
51 void setHandleAsParticle(
bool flag);
52 void setHasEffectiveMass(
bool flag);
53 void setHasEffectiveInertia(
bool flag);
54 void setEnabled(
bool flag);
55 void setRemoved(
bool flag);
56 void setMergedRootBody(
bool flag);
57 void setPowerline(
bool flag);
61 PARTICLE_KINEMATIC_BIT = 29,
63 MERGED_ROOT_BODY_BIT = 25,
66 HAS_EFFECTIVE_INERTIA_BIT = 18,
67 HAS_EFFECTIVE_MASS_BIT = 17,
68 HANDLE_AS_PARTICLE_BIT = 16,
76 this->set(ENABLE_BIT,
true);
86 return this->test(HANDLE_AS_PARTICLE_BIT);
91 return this->test(HAS_EFFECTIVE_MASS_BIT);
96 return this->test(HAS_EFFECTIVE_INERTIA_BIT);
101 return this->test(ENABLE_BIT);
106 return this->test(REMOVED_BIT);
111 return this->test(MERGED_ROOT_BODY_BIT);
116 return this->test(HYDRAULICS_BIT);
121 return this->test(PARTICLE_KINEMATIC_BIT);
126 m_state = ( m_state & ~0x3 ) | ((
agx::UInt32)motionControl);
131 this->set(ENABLE_BIT, flag);
136 this->set(HANDLE_AS_PARTICLE_BIT, flag);
141 this->set(HAS_EFFECTIVE_MASS_BIT, flag);
146 this->set(HAS_EFFECTIVE_INERTIA_BIT, flag);
151 this->set(REMOVED_BIT, flag);
156 this->set(MERGED_ROOT_BODY_BIT, flag);
161 this->set(HYDRAULICS_BIT, flag);
164 inline void RigidBodyState::setKinematicForParticles(
bool flag)
166 this->set(PARTICLE_KINEMATIC_BIT, flag);
169 std::ostream&
operator << ( std::ostream& output,
const RigidBodyState& state );
#define AGX_TYPE_BINDING(_Type, _Name)
std::ostream & operator<<(std::ostream &o, const agx::Vec6 &v)
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
AGXPHYSICS_EXPORT void setMotionControl(agx::RigidBodyPtrVector &bodies, agx::RigidBody::MotionControl motionControl)
Utility function to set motion control for a vector of rigid bodies.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.