Package org.jbox2d.particle
Class ParticleGroup
java.lang.Object
org.jbox2d.particle.ParticleGroup
A group of particles
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatgetAngle()Get the rotational angle of the particle group as a whole.floatGet the angular velocity of the group.intGet the offset of this group in the global particle buffer.Get the center of gravity for the group.intGet the construction flags for the group.floatGet the moment of inertia for the group.Get the linear velocity of the group.floatgetMass()Get the total mass of the group: the sum of all particles in it.getNext()Get the next particle group from the list in world.intGet the number of particles.Get the position of the particle group as a whole.Get the position of the group's origin and rotation.Get the user data pointer that was provided in the group definition.voidsetGroupFlags(int flags) Set the construction flags for the group.voidsetUserData(Object data) Set the user data.void
-
Constructor Details
-
ParticleGroup
public ParticleGroup()
-
-
Method Details
-
getNext
Get the next particle group from the list in world.- Returns:
- The next particle group from the list in world
-
getParticleCount
public int getParticleCount()Get the number of particles.- Returns:
- The number of particles.
-
getBufferIndex
public int getBufferIndex()Get the offset of this group in the global particle buffer.- Returns:
- The offset of this group in the global particle buffer.
-
getGroupFlags
public int getGroupFlags()Get the construction flags for the group.- Returns:
- The construction flags for the group.
-
setGroupFlags
public void setGroupFlags(int flags) Set the construction flags for the group.- Parameters:
flags- The construction flags for the group
-
getMass
public float getMass()Get the total mass of the group: the sum of all particles in it.- Returns:
- The total mass of the group: the sum of all particles in it.
-
getInertia
public float getInertia()Get the moment of inertia for the group.- Returns:
- The moment of inertia for the group.
-
getCenter
Get the center of gravity for the group.- Returns:
- The center of gravity for the group.
-
getLinearVelocity
Get the linear velocity of the group.- Returns:
- The linear velocity of the group.
-
getAngularVelocity
public float getAngularVelocity()Get the angular velocity of the group.- Returns:
- The angular velocity of the group.
-
getTransform
Get the position of the group's origin and rotation. Used only with groups of rigid particles.- Returns:
- The position of the group's origin and rotation.
-
getPosition
Get the position of the particle group as a whole. Used only with groups of rigid particles.- Returns:
- The position of the particle group as a whole.
-
getAngle
public float getAngle()Get the rotational angle of the particle group as a whole. Used only with groups of rigid particles.- Returns:
- The rotational angle of the particle group as a whole.
-
getUserData
Get the user data pointer that was provided in the group definition.- Returns:
- The user data pointer that was provided in the group definition.
-
setUserData
Set the user data. Use this to store your application specific data.- Parameters:
data- The user data.
-
updateStatistics
public void updateStatistics()
-