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>
aabbs
private java.util.HashMap<java.lang.Integer,float[]>
afloats
private java.util.HashMap<java.lang.Integer,int[]>
aints
private java.util.HashMap<java.lang.Integer,Vec2[]>
avecs
private MutableStack<Contact>
ccstack
private MutableStack<Contact>
chcstack
private MutableStack<Contact>
chpstack
private Collision
collision
private MutableStack<Contact>
cpstack
private Distance
dist
private MutableStack<Contact>
ecstack
private MutableStack<Contact>
epstack
private OrderedStack<Mat33>
mat33s
private OrderedStack<Mat22>
mats
private MutableStack<Contact>
pcstack
private OrderedStack<Rot>
rots
private TimeOfImpact
toi
private OrderedStack<Vec3>
vec3s
private OrderedStack<Vec2>
vecs
private IWorldPool
world
-
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()
Collision
getCollision()
Distance
getDistance()
IDynamicStack<Contact>
getEdgeCircleContactStack()
IDynamicStack<Contact>
getEdgePolyContactStack()
float[]
getFloatArray(int argLength)
int[]
getIntArray(int argLength)
IDynamicStack<Contact>
getPolyCircleContactStack()
IDynamicStack<Contact>
getPolyContactStack()
TimeOfImpact
getTimeOfImpact()
Vec2[]
getVec2Array(int argLength)
AABB
popAABB()
AABB[]
popAABB(int argNum)
Mat22
popMat22()
Mat22[]
popMat22(int argNum)
Mat33
popMat33()
Rot
popRot()
Vec2
popVec2()
Vec2[]
popVec2(int argNum)
Vec3
popVec3()
Vec3[]
popVec3(int argNum)
void
pushAABB(int argNum)
void
pushMat22(int argNum)
void
pushMat33(int argNum)
void
pushRot(int num)
void
pushVec2(int argNum)
void
pushVec3(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:
getPolyContactStack
in interfaceIWorldPool
-
getCircleContactStack
public final IDynamicStack<Contact> getCircleContactStack()
- Specified by:
getCircleContactStack
in interfaceIWorldPool
-
getPolyCircleContactStack
public final IDynamicStack<Contact> getPolyCircleContactStack()
- Specified by:
getPolyCircleContactStack
in interfaceIWorldPool
-
getEdgeCircleContactStack
public IDynamicStack<Contact> getEdgeCircleContactStack()
- Specified by:
getEdgeCircleContactStack
in interfaceIWorldPool
-
getEdgePolyContactStack
public IDynamicStack<Contact> getEdgePolyContactStack()
- Specified by:
getEdgePolyContactStack
in interfaceIWorldPool
-
getChainCircleContactStack
public IDynamicStack<Contact> getChainCircleContactStack()
- Specified by:
getChainCircleContactStack
in interfaceIWorldPool
-
getChainPolyContactStack
public IDynamicStack<Contact> getChainPolyContactStack()
- Specified by:
getChainPolyContactStack
in interfaceIWorldPool
-
popVec2
public final Vec2 popVec2()
- Specified by:
popVec2
in interfaceIWorldPool
-
popVec2
public final Vec2[] popVec2(int argNum)
- Specified by:
popVec2
in interfaceIWorldPool
-
pushVec2
public final void pushVec2(int argNum)
- Specified by:
pushVec2
in interfaceIWorldPool
-
popVec3
public final Vec3 popVec3()
- Specified by:
popVec3
in interfaceIWorldPool
-
popVec3
public final Vec3[] popVec3(int argNum)
- Specified by:
popVec3
in interfaceIWorldPool
-
pushVec3
public final void pushVec3(int argNum)
- Specified by:
pushVec3
in interfaceIWorldPool
-
popMat22
public final Mat22 popMat22()
- Specified by:
popMat22
in interfaceIWorldPool
-
popMat22
public final Mat22[] popMat22(int argNum)
- Specified by:
popMat22
in interfaceIWorldPool
-
pushMat22
public final void pushMat22(int argNum)
- Specified by:
pushMat22
in interfaceIWorldPool
-
popMat33
public final Mat33 popMat33()
- Specified by:
popMat33
in interfaceIWorldPool
-
pushMat33
public final void pushMat33(int argNum)
- Specified by:
pushMat33
in interfaceIWorldPool
-
popAABB
public final AABB popAABB()
- Specified by:
popAABB
in interfaceIWorldPool
-
popAABB
public final AABB[] popAABB(int argNum)
- Specified by:
popAABB
in interfaceIWorldPool
-
pushAABB
public final void pushAABB(int argNum)
- Specified by:
pushAABB
in interfaceIWorldPool
-
popRot
public final Rot popRot()
- Specified by:
popRot
in interfaceIWorldPool
-
pushRot
public final void pushRot(int num)
- Specified by:
pushRot
in interfaceIWorldPool
-
getCollision
public final Collision getCollision()
- Specified by:
getCollision
in interfaceIWorldPool
-
getTimeOfImpact
public final TimeOfImpact getTimeOfImpact()
- Specified by:
getTimeOfImpact
in interfaceIWorldPool
-
getDistance
public final Distance getDistance()
- Specified by:
getDistance
in interfaceIWorldPool
-
getFloatArray
public final float[] getFloatArray(int argLength)
- Specified by:
getFloatArray
in interfaceIWorldPool
-
getIntArray
public final int[] getIntArray(int argLength)
- Specified by:
getIntArray
in interfaceIWorldPool
-
getVec2Array
public final Vec2[] getVec2Array(int argLength)
- Specified by:
getVec2Array
in interfaceIWorldPool
-
-