Package org.jbox2d.pooling.normal
Class DefaultWorldPool
- java.lang.Object
-
- org.jbox2d.pooling.normal.DefaultWorldPool
-
- All Implemented Interfaces:
IWorldPool
public class DefaultWorldPool extends java.lang.Object implements IWorldPool
Provides object pooling for all objects used in the engine. Objects retrieved from here should only be used temporarily, and then pushed back (with the exception of arrays).
-
-
Field Summary
Fields Modifier and Type Field Description private OrderedStack<AABB>aabbsprivate java.util.HashMap<java.lang.Integer,float[]>afloatsprivate java.util.HashMap<java.lang.Integer,int[]>aintsprivate java.util.HashMap<java.lang.Integer,Vec2[]>avecsprivate MutableStack<Contact>ccstackprivate MutableStack<Contact>chcstackprivate MutableStack<Contact>chpstackprivate Collisioncollisionprivate MutableStack<Contact>cpstackprivate Distancedistprivate MutableStack<Contact>ecstackprivate MutableStack<Contact>epstackprivate OrderedStack<Mat33>mat33sprivate OrderedStack<Mat22>matsprivate MutableStack<Contact>pcstackprivate OrderedStack<Rot>rotsprivate TimeOfImpacttoiprivate OrderedStack<Vec3>vec3sprivate OrderedStack<Vec2>vecsprivate IWorldPoolworld
-
Constructor Summary
Constructors Constructor Description DefaultWorldPool(int argSize, int argContainerSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDynamicStack<Contact>getChainCircleContactStack()IDynamicStack<Contact>getChainPolyContactStack()IDynamicStack<Contact>getCircleContactStack()CollisiongetCollision()DistancegetDistance()IDynamicStack<Contact>getEdgeCircleContactStack()IDynamicStack<Contact>getEdgePolyContactStack()float[]getFloatArray(int argLength)int[]getIntArray(int argLength)IDynamicStack<Contact>getPolyCircleContactStack()IDynamicStack<Contact>getPolyContactStack()TimeOfImpactgetTimeOfImpact()Vec2[]getVec2Array(int argLength)AABBpopAABB()AABB[]popAABB(int argNum)Mat22popMat22()Mat22[]popMat22(int argNum)Mat33popMat33()RotpopRot()Vec2popVec2()Vec2[]popVec2(int argNum)Vec3popVec3()Vec3[]popVec3(int argNum)voidpushAABB(int argNum)voidpushMat22(int argNum)voidpushMat33(int argNum)voidpushRot(int num)voidpushVec2(int argNum)voidpushVec3(int argNum)
-
-
-
Field Detail
-
vecs
private final OrderedStack<Vec2> vecs
-
vec3s
private final OrderedStack<Vec3> vec3s
-
mats
private final OrderedStack<Mat22> mats
-
mat33s
private final OrderedStack<Mat33> mat33s
-
aabbs
private final OrderedStack<AABB> aabbs
-
rots
private final OrderedStack<Rot> rots
-
afloats
private final java.util.HashMap<java.lang.Integer,float[]> afloats
-
aints
private final java.util.HashMap<java.lang.Integer,int[]> aints
-
avecs
private final java.util.HashMap<java.lang.Integer,Vec2[]> avecs
-
world
private final IWorldPool world
-
pcstack
private final MutableStack<Contact> pcstack
-
ccstack
private final MutableStack<Contact> ccstack
-
cpstack
private final MutableStack<Contact> cpstack
-
ecstack
private final MutableStack<Contact> ecstack
-
epstack
private final MutableStack<Contact> epstack
-
chcstack
private final MutableStack<Contact> chcstack
-
chpstack
private final MutableStack<Contact> chpstack
-
collision
private final Collision collision
-
toi
private final TimeOfImpact toi
-
dist
private final Distance dist
-
-
Method Detail
-
getPolyContactStack
public final IDynamicStack<Contact> getPolyContactStack()
- Specified by:
getPolyContactStackin interfaceIWorldPool
-
getCircleContactStack
public final IDynamicStack<Contact> getCircleContactStack()
- Specified by:
getCircleContactStackin interfaceIWorldPool
-
getPolyCircleContactStack
public final IDynamicStack<Contact> getPolyCircleContactStack()
- Specified by:
getPolyCircleContactStackin interfaceIWorldPool
-
getEdgeCircleContactStack
public IDynamicStack<Contact> getEdgeCircleContactStack()
- Specified by:
getEdgeCircleContactStackin interfaceIWorldPool
-
getEdgePolyContactStack
public IDynamicStack<Contact> getEdgePolyContactStack()
- Specified by:
getEdgePolyContactStackin interfaceIWorldPool
-
getChainCircleContactStack
public IDynamicStack<Contact> getChainCircleContactStack()
- Specified by:
getChainCircleContactStackin interfaceIWorldPool
-
getChainPolyContactStack
public IDynamicStack<Contact> getChainPolyContactStack()
- Specified by:
getChainPolyContactStackin interfaceIWorldPool
-
popVec2
public final Vec2 popVec2()
- Specified by:
popVec2in interfaceIWorldPool
-
popVec2
public final Vec2[] popVec2(int argNum)
- Specified by:
popVec2in interfaceIWorldPool
-
pushVec2
public final void pushVec2(int argNum)
- Specified by:
pushVec2in interfaceIWorldPool
-
popVec3
public final Vec3 popVec3()
- Specified by:
popVec3in interfaceIWorldPool
-
popVec3
public final Vec3[] popVec3(int argNum)
- Specified by:
popVec3in interfaceIWorldPool
-
pushVec3
public final void pushVec3(int argNum)
- Specified by:
pushVec3in interfaceIWorldPool
-
popMat22
public final Mat22 popMat22()
- Specified by:
popMat22in interfaceIWorldPool
-
popMat22
public final Mat22[] popMat22(int argNum)
- Specified by:
popMat22in interfaceIWorldPool
-
pushMat22
public final void pushMat22(int argNum)
- Specified by:
pushMat22in interfaceIWorldPool
-
popMat33
public final Mat33 popMat33()
- Specified by:
popMat33in interfaceIWorldPool
-
pushMat33
public final void pushMat33(int argNum)
- Specified by:
pushMat33in interfaceIWorldPool
-
popAABB
public final AABB popAABB()
- Specified by:
popAABBin interfaceIWorldPool
-
popAABB
public final AABB[] popAABB(int argNum)
- Specified by:
popAABBin interfaceIWorldPool
-
pushAABB
public final void pushAABB(int argNum)
- Specified by:
pushAABBin interfaceIWorldPool
-
popRot
public final Rot popRot()
- Specified by:
popRotin interfaceIWorldPool
-
pushRot
public final void pushRot(int num)
- Specified by:
pushRotin interfaceIWorldPool
-
getCollision
public final Collision getCollision()
- Specified by:
getCollisionin interfaceIWorldPool
-
getTimeOfImpact
public final TimeOfImpact getTimeOfImpact()
- Specified by:
getTimeOfImpactin interfaceIWorldPool
-
getDistance
public final Distance getDistance()
- Specified by:
getDistancein interfaceIWorldPool
-
getFloatArray
public final float[] getFloatArray(int argLength)
- Specified by:
getFloatArrayin interfaceIWorldPool
-
getIntArray
public final int[] getIntArray(int argLength)
- Specified by:
getIntArrayin interfaceIWorldPool
-
getVec2Array
public final Vec2[] getVec2Array(int argLength)
- Specified by:
getVec2Arrayin interfaceIWorldPool
-
-