18 #ifndef B2_PARTICLE_GROUP
19 #define B2_PARTICLE_GROUP
44 b2_particleGroupInternalMask =
62 color = b2ParticleColor_zero;
220 int32 m_firstIndex, m_lastIndex;
226 mutable int32 m_timestamp;
227 mutable float32 m_mass;
228 mutable float32 m_inertia;
230 mutable b2Vec2 m_linearVelocity;
231 mutable float32 m_angularVelocity;
238 void UpdateStatistics()
const;
264 return m_lastIndex - m_firstIndex;
269 return m_firstIndex <= index && index < m_lastIndex;
272 inline b2ParticleGroup::~b2ParticleGroup()
283 return m_groupFlags & ~b2_particleGroupInternalMask;
307 return m_linearVelocity;
313 return m_angularVelocity;
323 return m_transform.p;
b2Vec2 linearVelocity
The linear velocity of the group's origin in world co-ordinates.
Definition: b2ParticleGroup.h:90
float32 stride
Definition: b2ParticleGroup.h:113
uint32 flags
The particle-behavior flags (See b2ParticleFlag).
Definition: b2ParticleGroup.h:76
Keeps its shape.
Definition: b2ParticleGroup.h:37
float32 GetAngle() const
Get the angle in radians.
Definition: b2Math.h:388
void * userData
Use this to store application-specific group data.
Definition: b2ParticleGroup.h:126
Definition: b2ParticleGroup.h:51
float32 angle
Definition: b2ParticleGroup.h:87
const b2Shape *const * shapes
A array of shapes where particles will be added.
Definition: b2ParticleGroup.h:106
float32 GetMass() const
Get the total mass of the group: the sum of all particles in it.
Definition: b2ParticleGroup.h:286
const b2Vec2 * positionData
The initial positions of the particleCount particles.
Definition: b2ParticleGroup.h:119
b2ParticleGroupFlag
The particle group type. Can be combined with the | operator.
Definition: b2ParticleGroup.h:32
b2Vec2 position
Definition: b2ParticleGroup.h:83
Will be destroyed on next simulation step.
Definition: b2ParticleGroup.h:41
void ApplyForce(const b2Vec2 &force)
Call b2ParticleSystem::ApplyForce for every particle in the group.
Definition: b2ParticleGroup.cpp:88
b2ParticleGroup * group
An existing particle group to which the particles will be added.
Definition: b2ParticleGroup.h:129
Updates depth data on next simulation step.
Definition: b2ParticleGroup.h:43
void SetGroupFlags(int32 flags)
Set the construction flags for the group.
Definition: b2ParticleGroup.cpp:45
uint32 groupFlags
The group-construction flags (See b2ParticleGroupFlag).
Definition: b2ParticleGroup.h:79
b2Vec2 GetLinearVelocity() const
Get the linear velocity of the group.
Definition: b2ParticleGroup.h:304
Definition: b2ParticleSystem.h:189
Won't be destroyed if it gets empty.
Definition: b2ParticleGroup.h:39
bool ContainsParticle(int32 index) const
Does this group contain the particle.
Definition: b2ParticleGroup.h:267
b2Vec2 GetCenter() const
Get the center of gravity for the group.
Definition: b2ParticleGroup.h:298
Small color object for each particle.
Definition: b2Particle.h:81
float32 angularVelocity
The angular velocity of the group.
Definition: b2ParticleGroup.h:93
float32 GetAngle() const
Definition: b2ParticleGroup.h:326
int32 particleCount
The number of particles in addition to ones added in the shape.
Definition: b2ParticleGroup.h:116
const b2Transform & GetTransform() const
Definition: b2ParticleGroup.h:316
A group of particles. b2ParticleGroup::CreateParticleGroup creates these.
Definition: b2ParticleGroup.h:134
void SetUserData(void *data)
Set the user data. Use this to store your application specific data.
Definition: b2ParticleGroup.h:336
float32 strength
Definition: b2ParticleGroup.h:100
void ApplyLinearImpulse(const b2Vec2 &impulse)
Definition: b2ParticleGroup.cpp:93
int32 GetParticleCount() const
Get the number of particles.
Definition: b2ParticleGroup.h:262
Prevents overlapping or leaking.
Definition: b2ParticleGroup.h:35
float32 GetInertia() const
Get the moment of inertia for the group.
Definition: b2ParticleGroup.h:292
b2ParticleSystem * GetParticleSystem()
Get the particle system that holds this particle group.
Definition: b2ParticleGroup.h:252
int32 shapeCount
The number of shapes.
Definition: b2ParticleGroup.h:109
void * GetUserData() const
Get the user data pointer that was provided in the group definition.
Definition: b2ParticleGroup.h:331
const b2Vec2 & GetPosition() const
Definition: b2ParticleGroup.h:321
int32 GetBufferIndex() const
Get the offset of this group in the global particle buffer.
Definition: b2ParticleGroup.h:276
A 2D column vector.
Definition: b2Math.h:56
b2ParticleGroup * GetNext()
Get the next particle group from the list in b2_World.
Definition: b2ParticleGroup.h:242
void DestroyParticles()
Definition: b2ParticleGroup.h:341
b2ParticleColor color
The color of all particles in the group.
Definition: b2ParticleGroup.h:96
float32 GetAngularVelocity() const
Get the angular velocity of the group.
Definition: b2ParticleGroup.h:310
const b2Shape * shape
The shape where particles will be added.
Definition: b2ParticleGroup.h:103
float32 lifetime
Definition: b2ParticleGroup.h:123
int32 GetGroupFlags() const
Get the construction flags for the group.
Definition: b2ParticleGroup.h:281