Package com.jme3.util

Class TempVars

java.lang.Object
com.jme3.util.TempVars

public class TempVars extends Object
Temporary variables assigned to each thread. Engine classes may access these temp variables with TempVars.get(), all retrieved TempVars instances must be returned via TempVars.release(). This returns an available instance of the TempVar class ensuring this particular instance is never used elsewhere in the meantime.
  • Field Details

    • vect1

      public final Vector3f vect1
      General vectors.
    • vect2

      public final Vector3f vect2
      auxiliary Vector3f
    • quat1

      public final Quaternion quat1
      General quaternions.
  • Method Details

    • get

      public static TempVars get()
      Acquire an instance of the TempVar class. You have to release the instance after use by calling the release() method. If more than STACK_SIZE (currently 5) instances are requested in a single thread then an ArrayIndexOutOfBoundsException will be thrown.
      Returns:
      A TempVar instance
    • release

      public void release()
      Releases this instance of TempVars. Once released, the contents of the TempVars are undefined. The TempVars must be released in the opposite order that they are retrieved, e.g. Acquiring vars1, then acquiring vars2, vars2 MUST be released first otherwise an exception will be thrown.