18 #ifndef B2_PARTICLE_GROUP
19 #define B2_PARTICLE_GROUP
21 #include <Box2D/Particle/b2Particle.h>
29 enum b2ParticleGroupFlag
31 b2_solidParticleGroup = 1 << 0,
32 b2_rigidParticleGroup = 1 << 1,
48 color = b2ParticleColor_zero;
152 int32 m_firstIndex, m_lastIndex;
158 mutable int32 m_timestamp;
159 mutable float32 m_mass;
160 mutable float32 m_inertia;
162 mutable b2Vec2 m_linearVelocity;
163 mutable float32 m_angularVelocity;
166 unsigned m_destroyAutomatically:1;
167 unsigned m_toBeDestroyed:1;
168 unsigned m_toBeSplit:1;
174 void UpdateStatistics()
const;
190 return m_lastIndex - m_firstIndex;
b2Vec2 linearVelocity
The linear velocity of the group's origin in world co-ordinates.
Definition: b2ParticleGroup.h:70
uint32 flags
The particle-behavior flags.
Definition: b2ParticleGroup.h:56
void * userData
Use this to store application-specific group data.
Definition: b2ParticleGroup.h:88
bool destroyAutomatically
If true, destroy the group automatically after its last particle has been destroyed.
Definition: b2ParticleGroup.h:85
Definition: b2ParticleGroup.h:37
float32 angle
Definition: b2ParticleGroup.h:67
float32 GetMass() const
Get the total mass of the group: the sum of all particles in it.
Definition: b2ParticleGroup.cpp:67
b2Vec2 position
Definition: b2ParticleGroup.h:63
void SetGroupFlags(int32 flags)
Set the construction flags for the group.
Definition: b2ParticleGroup.cpp:62
uint32 groupFlags
The group-construction flags.
Definition: b2ParticleGroup.h:59
b2Vec2 GetLinearVelocity() const
Get the linear velocity of the group.
Definition: b2ParticleGroup.cpp:85
Definition: b2ParticleSystem.h:74
b2Vec2 GetCenter() const
Get the center of gravity for the group.
Definition: b2ParticleGroup.cpp:79
float32 angularVelocity
The angular velocity of the group.
Definition: b2ParticleGroup.h:73
float32 GetAngle() const
Definition: b2ParticleGroup.cpp:107
const b2Transform & GetTransform() const
Definition: b2ParticleGroup.cpp:97
A group of particles. These are created via b2World::CreateParticleGroup.
Definition: b2ParticleGroup.h:93
void SetUserData(void *data)
Set the user data. Use this to store your application specific data.
Definition: b2ParticleGroup.cpp:117
float32 strength
The strength of cohesion among the particles in a group with flag b2_elasticParticle or b2_springPart...
Definition: b2ParticleGroup.h:79
int32 GetParticleCount() const
Get the number of particles.
Definition: b2ParticleGroup.h:188
float32 GetInertia() const
Get the moment of inertia for the group.
Definition: b2ParticleGroup.cpp:73
void * GetUserData() const
Get the user data pointer that was provided in the group definition.
Definition: b2ParticleGroup.cpp:112
const b2Vec2 & GetPosition() const
Definition: b2ParticleGroup.cpp:102
Small color object for each particle.
Definition: b2Particle.h:42
int32 GetBufferIndex() const
Get the offset of this group in the global particle buffer.
Definition: b2ParticleGroup.cpp:52
A 2D column vector.
Definition: b2Math.h:64
b2ParticleGroup * GetNext()
Get the next particle group from the list in b2_World.
Definition: b2ParticleGroup.h:178
b2ParticleColor color
The color of all particles in the group.
Definition: b2ParticleGroup.h:76
float32 GetAngularVelocity() const
Get the angular velocity of the group.
Definition: b2ParticleGroup.cpp:91
const b2Shape * shape
Shape containing the particle group.
Definition: b2ParticleGroup.h:82
int32 GetGroupFlags() const
Get the construction flags for the group.
Definition: b2ParticleGroup.cpp:57