Class EmitterMeshFaceShape

java.lang.Object
com.jme3.effect.shapes.EmitterMeshVertexShape
com.jme3.effect.shapes.EmitterMeshFaceShape
All Implemented Interfaces:
EmitterShape, Savable, JmeCloneable, Cloneable
Direct Known Subclasses:
EmitterMeshConvexHullShape

public class EmitterMeshFaceShape extends EmitterMeshVertexShape
This emitter shape emits the particles from the given shape's faces.
  • Constructor Details

    • EmitterMeshFaceShape

      public EmitterMeshFaceShape()
      Empty constructor. Sets nothing.
    • EmitterMeshFaceShape

      public EmitterMeshFaceShape(List<Mesh> meshes)
      Constructor. Initializes the emitter shape with a list of meshes. The vertices and normals for all triangles of these meshes are extracted and stored internally.
      Parameters:
      meshes - a list of Mesh objects that will define the shape from which particles are emitted.
  • Method Details

    • setMeshes

      public void setMeshes(List<Mesh> meshes)
      Sets the meshes for this emitter shape. This method extracts all triangle vertices and computes their normals, storing them internally for subsequent particle emission.
      Overrides:
      setMeshes in class EmitterMeshVertexShape
      Parameters:
      meshes - a list of Mesh objects to set as the emitter's shape.
    • getRandomPoint

      public void getRandomPoint(Vector3f store)
      Randomly selects a point on a random face of one of the stored meshes. The point is generated using barycentric coordinates to ensure uniform distribution within the selected triangle.
      Specified by:
      getRandomPoint in interface EmitterShape
      Overrides:
      getRandomPoint in class EmitterMeshVertexShape
      Parameters:
      store - a Vector3f object where the coordinates of the selected point will be stored.
    • getRandomPointAndNormal

      public void getRandomPointAndNormal(Vector3f store, Vector3f normal)
      Randomly selects a point on a random face of one of the stored meshes, and also sets the normal of that selected face. The point is generated using barycentric coordinates for uniform distribution.
      Specified by:
      getRandomPointAndNormal in interface EmitterShape
      Overrides:
      getRandomPointAndNormal in class EmitterMeshVertexShape
      Parameters:
      store - a Vector3f object where the coordinates of the selected point will be stored.
      normal - a Vector3f object where the normal of the selected face will be stored.