/** * Releases a ColorRGBA back to be used by a future call to fetchTempInstance. TAKE CARE: this ColorRGBA object * should no longer have other classes referencing it or "Bad Things" will happen. * * @param color * the ColorRGBA to release. */ public final static void releaseTempInstance(final ColorRGBA color) { if (MathConstants.useMathPools) { ColorRGBA.COLOR_POOL.release(color); } }
/** * @return An instance of Vector2 that is intended for temporary use in calculations and so forth. Multiple calls to * the method should return instances of this class that are not currently in use. */ public final static Vector2 fetchTempInstance() { if (MathConstants.useMathPools) { return Vector2.VEC_POOL.fetch(); } else { return new Vector2(); } }
public final T fetch() { final List<T> objects = _pool.get(); return objects.isEmpty() ? newInstance() : objects.remove(objects.size() - 1); }
/** * @return An instance of Rectangle3 that is intended for temporary use in calculations and so forth. Multiple calls * to the method should return instances of this class that are not currently in use. */ public final static Rectangle3 fetchTempInstance() { if (MathConstants.useMathPools) { return Rectangle3.RECTANGLE_POOL.fetch(); } else { return new Rectangle3(); } }
public final T fetch() { final List<T> objects = _pool.get(); return objects.isEmpty() ? newInstance() : objects.remove(objects.size() - 1); }
/** * @return An instance of Line3 that is intended for temporary use in calculations and so forth. Multiple calls to * the method should return instances of this class that are not currently in use. */ public final static Line3 fetchTempInstance() { if (MathConstants.useMathPools) { return LINE3_POOL.fetch(); } else { return new Line3(); } }
public final static void releaseTempInstance(final StateStack s) { if (Constants.useStatePools) { STATESTACKS_POOL.release(s); } }
/** * @return An instance of Triangle that is intended for temporary use in calculations and so forth. Multiple calls * to the method should return instances of this class that are not currently in use. */ public final static Triangle fetchTempInstance() { if (MathConstants.useMathPools) { return Triangle.TRI_POOL.fetch(); } else { return new Triangle(); } }
public final static void releaseTempInstance(final StateStack s) { if (Constants.useStatePools) { STATESTACKS_POOL.release(s); } }
/** * @return An instance of Matrix4 that is intended for temporary use in calculations and so forth. Multiple calls to * the method should return instances of this class that are not currently in use. */ public final static Matrix4 fetchTempInstance() { if (MathConstants.useMathPools) { return Matrix4.MAT_POOL.fetch(); } else { return new Matrix4(); } }
/** * Releases a ColorRGBA back to be used by a future call to fetchTempInstance. TAKE CARE: this ColorRGBA object * should no longer have other classes referencing it or "Bad Things" will happen. * * @param color * the ColorRGBA to release. */ public final static void releaseTempInstance(final ColorRGBA color) { if (MathConstants.useMathPools) { ColorRGBA.COLOR_POOL.release(color); } }
/** * @return An instance of Ray that is intended for temporary use in calculations and so forth. Multiple calls to the * method should return instances of this class that are not currently in use. */ public final static Ray3 fetchTempInstance() { if (MathConstants.useMathPools) { return Ray3.RAY_POOL.fetch(); } else { return new Ray3(); } }
/** * Releases a Matrix3 back to be used by a future call to fetchTempInstance. TAKE CARE: this Matrix3 object should * no longer have other classes referencing it or "Bad Things" will happen. * * @param mat * the Matrix3 to release. */ public final static void releaseTempInstance(final Matrix3 mat) { if (MathConstants.useMathPools) { Matrix3.MAT_POOL.release(mat); } } }
/** * @return An instance of Matrix3 that is intended for temporary use in calculations and so forth. Multiple calls to * the method should return instances of this class that are not currently in use. */ public final static Matrix3 fetchTempInstance() { if (MathConstants.useMathPools) { return Matrix3.MAT_POOL.fetch(); } else { return new Matrix3(); } }
/** * Releases a Triangle back to be used by a future call to fetchTempInstance. TAKE CARE: this Triangle object should * no longer have other classes referencing it or "Bad Things" will happen. * * @param tri * the Triangle to release. */ public final static void releaseTempInstance(final Triangle tri) { if (MathConstants.useMathPools) { Triangle.TRI_POOL.release(tri); } } }
/** * @return An instance of Transform that is intended for temporary use in calculations and so forth. Multiple calls * to the method should return instances of this class that are not currently in use. */ public final static Transform fetchTempInstance() { if (MathConstants.useMathPools) { return Transform.TRANS_POOL.fetch(); } else { return new Transform(); } }
/** * Releases a Vector4 back to be used by a future call to fetchTempInstance. TAKE CARE: this Vector4 object should * no longer have other classes referencing it or "Bad Things" will happen. * * @param vec * the Vector4 to release. */ public final static void releaseTempInstance(final Vector4 vec) { if (MathConstants.useMathPools) { Vector4.VEC_POOL.release(vec); } } }
/** * @return An instance of Plane that is intended for temporary use in calculations and so forth. Multiple calls to * the method should return instances of this class that are not currently in use. */ public final static Plane fetchTempInstance() { if (MathConstants.useMathPools) { return Plane.PLANE_POOL.fetch(); } else { return new Plane(); } }