Class EmitterBoxShape

java.lang.Object
com.jme3.effect.shapes.EmitterBoxShape
All Implemented Interfaces:
EmitterShape, Savable, JmeCloneable, Cloneable

public class EmitterBoxShape extends Object implements EmitterShape
An EmitterShape that emits particles randomly within the bounds of an axis-aligned box. The box is defined by a minimum corner and a length vector.
  • Constructor Details

    • EmitterBoxShape

      public EmitterBoxShape()
      For serialization only. Do not use.
    • EmitterBoxShape

      public EmitterBoxShape(Vector3f min, Vector3f max)
      Constructs an EmitterBoxShape defined by a minimum and maximum corner.
      Parameters:
      min - The minimum corner of the box.
      max - The maximum corner of the box.
      Throws:
      IllegalArgumentException - If either min or max is null.
  • Method Details

    • getRandomPoint

      public void getRandomPoint(Vector3f store)
      Generates a random point within the bounds of the box.
      Specified by:
      getRandomPoint in interface EmitterShape
      Parameters:
      store - The Vector3f to store the generated point in.
    • getRandomPointAndNormal

      public void getRandomPointAndNormal(Vector3f store, Vector3f normal)
      For a box shape, the normal is not well-defined for points within the volume. This implementation simply calls getRandomPoint(Vector3f) and does not modify the provided normal.
      Specified by:
      getRandomPointAndNormal in interface EmitterShape
      Parameters:
      store - The Vector3f to store the generated point in.
      normal - The Vector3f to store the generated normal in (unused).
    • deepClone

      public EmitterShape deepClone()
      Description copied from interface: EmitterShape
      This method creates a deep clone of the current instance of the emitter shape.
      Specified by:
      deepClone in interface EmitterShape
      Returns:
      deep clone of the current instance of the emitter shape
    • jmeClone

      public Object jmeClone()
      Called internally by com.jme3.util.clone.Cloner. Do not call directly.
      Specified by:
      jmeClone in interface JmeCloneable
      Returns:
      a new instance
    • cloneFields

      public void cloneFields(Cloner cloner, Object original)
      Called internally by com.jme3.util.clone.Cloner. Do not call directly.
      Specified by:
      cloneFields in interface JmeCloneable
      Parameters:
      cloner - The cloner that is performing the cloning operation. The cloneFields method can call back into the cloner to make clones of its subordinate fields.
      original - The original object from which this object was cloned. This is provided for the very rare case that this object needs to refer to its original for some reason. In general, all of the relevant values should have been transferred during the shallow clone, and this object need only clone what it wants.
    • getMin

      public Vector3f getMin()
      Returns the minimum corner of the emitting box.
      Returns:
      The minimum corner.
    • setMin

      public void setMin(Vector3f min)
      Sets the minimum corner of the emitting box.
      Parameters:
      min - The new minimum corner.
    • getLen

      public Vector3f getLen()
      Returns the length vector of the emitting box. This vector represents the extent of the box along each axis (length = max - min).
      Returns:
      The length vector.
    • setLen

      public void setLen(Vector3f len)
      Sets the length vector of the emitting box. This vector should represent the extent of the box along each axis (length = max - min).
      Parameters:
      len - The new length vector.
    • write

      public void write(JmeExporter ex) throws IOException
      Specified by:
      write in interface Savable
      Throws:
      IOException
    • read

      public void read(JmeImporter im) throws IOException
      Specified by:
      read in interface Savable
      Throws:
      IOException