Exemple #1
0
 /**
  * @return An instance of Vector4 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 static final Vector4 fetchTempInstance() {
   if (MathConstants.useMathPools) {
     return Vector4.VEC_POOL.fetch();
   } else {
     return new Vector4();
   }
 }
Exemple #2
0
 /**
  * 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 static final void releaseTempInstance(final Vector4 vec) {
   if (MathConstants.useMathPools) {
     Vector4.VEC_POOL.release(vec);
   }
 }