Package org.jbox2d.particle
Class ParticleSystem
java.lang.Object
org.jbox2d.particle.ParticleSystem
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConnection between two particles.static classstatic classUsed for detecting particle contactsstatic classConnection between three particles. -
Field Summary
FieldsModifier and TypeFieldDescriptionintint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContact(int a, int b) voidfloatintcreateParticleGroup(ParticleGroupDef groupDef) voiddestroyParticle(int index, boolean callDestructionListener) voiddestroyParticlesInGroup(ParticleGroup group, boolean callDestructionListener) intdestroyParticlesInShape(Shape shape, Transform xf, boolean callDestructionListener) intGet the number of particles.floatfloatint[]floatintintVec2[]floatObject[]Vec2[]voidjoinParticleGroups(ParticleGroup groupA, ParticleGroup groupB) voidqueryAABB(ParticleQueryCallback callback, AABB aabb) Query the particle system for all particles that potentially overlap the provided AABB.voidraycast(ParticleRaycastCallback callback, Vec2 point1, Vec2 point2) Ray-cast the particle system for all particles in the path of the ray.voidsetParticleColorBuffer(ParticleColor[] buffer, int capacity) voidsetParticleDamping(float damping) voidsetParticleDensity(float density) voidsetParticleFlagsBuffer(int[] buffer, int capacity) voidsetParticleGravityScale(float gravityScale) voidsetParticleMaxCount(int count) voidsetParticlePositionBuffer(Vec2[] buffer, int capacity) voidsetParticleRadius(float radius) voidsetParticleUserDataBuffer(Object[] buffer, int capacity) voidsetParticleVelocityBuffer(Vec2[] buffer, int capacity) voidvoidsolveCollision(TimeStep step) voidvoidvoidupdateContacts(boolean exceptZombie)
-
Field Details
-
colorBuffer
-
contactCount
public int contactCount -
contactBuffer
-
bodyContactCount
public int bodyContactCount -
bodyContactBuffer
-
-
Constructor Details
-
ParticleSystem
-
-
Method Details
-
createParticle
-
destroyParticle
public void destroyParticle(int index, boolean callDestructionListener) -
destroyParticlesInShape
-
destroyParticlesInGroup
-
createParticleGroup
-
joinParticleGroups
-
computeDepthForGroup
-
addContact
public void addContact(int a, int b) -
updateContacts
public void updateContacts(boolean exceptZombie) -
updateBodyContacts
public void updateBodyContacts() -
solveCollision
-
solve
-
solveWall
-
setParticleRadius
public void setParticleRadius(float radius) -
setParticleDensity
public void setParticleDensity(float density) -
getParticleDensity
public float getParticleDensity() -
setParticleGravityScale
public void setParticleGravityScale(float gravityScale) -
getParticleGravityScale
public float getParticleGravityScale() -
setParticleDamping
public void setParticleDamping(float damping) -
getParticleDamping
public float getParticleDamping() -
getParticleRadius
public float getParticleRadius() -
getParticleFlagsBuffer
public int[] getParticleFlagsBuffer() -
getParticlePositionBuffer
-
getParticleVelocityBuffer
-
getParticleColorBuffer
-
getParticleUserDataBuffer
-
getParticleMaxCount
public int getParticleMaxCount() -
setParticleMaxCount
public void setParticleMaxCount(int count) -
setParticleFlagsBuffer
public void setParticleFlagsBuffer(int[] buffer, int capacity) -
setParticlePositionBuffer
-
setParticleVelocityBuffer
-
setParticleColorBuffer
-
getParticleGroupBuffer
-
getParticleGroupCount
public int getParticleGroupCount() -
getParticleGroupList
-
getParticleCount
public int getParticleCount()Get the number of particles. -
setParticleUserDataBuffer
-
queryAABB
Query the particle system for all particles that potentially overlap the provided AABB.- Parameters:
callback- A user implemented callback class.aabb- The query box.
-
raycast
Ray-cast the particle system for all particles in the path of the ray. Your callback controls whether you get the closest point, any point, or n-points. The ray-cast ignores particles that contain the starting point.- Parameters:
callback- A user implemented callback class.point1- The ray starting point.point2- The ray ending point.
-
computeParticleCollisionEnergy
public float computeParticleCollisionEnergy()
-