17 #ifndef AGX_PARTICLESTATE_H
18 #define AGX_PARTICLESTATE_H
30 class ParticleState :
public BitSet_small<ParticleStateDataType>
37 bool enableMerge()
const;
38 bool enableRotation()
const;
39 bool particleClipped()
const;
40 bool particleFiltered()
const;
41 bool isTerrainSoilParticle()
const;
44 void setEnabled(
bool flag);
45 void setRemoved(
bool flag);
46 void setEnableMerge(
bool flag);
47 void setEnableRotation(
bool flag);
48 void setParticleClipped(
bool flag);
49 void setParticleFiltered(
bool flag);
50 void setIsTerrainSoilParticle(
bool flag);
53 friend class RigidBody;
54 friend class DynamicsSystem;
55 friend class MergedBody;
56 friend class MassPropertiesUpdate;
58 static const UInt16 TERRAIN_SOIL_PARTICLE = 11;
59 static const UInt16 RENDERING_PARTICLE_FILTERED = 10;
60 static const UInt16 RENDERING_PARTICLE_CLIPPED = 9;
61 static const UInt16 ENABLE_NO_ROTATIONS = 8;
62 static const UInt16 ENABLE_MERGE_BIT = 7;
63 static const UInt16 REMOVED_BIT = 6;
64 static const UInt16 ENABLE_BIT = 5;
68 AGX_FORCE_INLINE ParticleState::ParticleState() : BitSet_small<ParticleStateDataType>()
70 this->set(ENABLE_BIT,
true);
71 this->set(REMOVED_BIT,
false);
72 this->set(ENABLE_MERGE_BIT,
true);
73 this->set(RENDERING_PARTICLE_CLIPPED,
false);
74 this->set(RENDERING_PARTICLE_FILTERED,
false );
75 this->set(TERRAIN_SOIL_PARTICLE,
false);
86 return this->test(ENABLE_BIT);
91 return this->test(RENDERING_PARTICLE_CLIPPED);
96 return this->test(REMOVED_BIT);
101 return this->test(ENABLE_MERGE_BIT);
106 return !this->test(ENABLE_NO_ROTATIONS);
111 return this->test(RENDERING_PARTICLE_FILTERED);
116 return this->test( TERRAIN_SOIL_PARTICLE );
121 const ParticleStateDataType mask = (ParticleStateDataType) 0x3;
122 m_state = (m_state & ~mask) | ((ParticleStateDataType)motionControl);
127 this->set(ENABLE_BIT, flag);
132 this->set(RENDERING_PARTICLE_CLIPPED, flag);
137 this->set(RENDERING_PARTICLE_FILTERED, flag);
142 this->set(ENABLE_NO_ROTATIONS, !flag);
147 this->set(REMOVED_BIT, flag);
152 this->set(ENABLE_MERGE_BIT, flag);
155 AGX_FORCE_INLINE void agx::ParticleState::setIsTerrainSoilParticle(
bool flag )
157 this->set( TERRAIN_SOIL_PARTICLE, flag );
161 std::ostream&
operator << (std::ostream& output,
const ParticleState& state);
std::ostream & operator<<(std::ostream &stream, const AtomicValueT< T > &value)
#define AGX_TYPE_BINDING(_Type, _Name)
AGXPHYSICS_EXPORT void setMotionControl(agx::RigidBodyPtrVector &bodies, agx::RigidBody::MotionControl motionControl)
Utility function to set motion control for a vector of rigid bodies.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()