Package com.jme3.effect.shapes
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
This emitter shape emits the particles from the given shape's faces.
-
Field Summary
Fields inherited from class com.jme3.effect.shapes.EmitterMeshVertexShape
normals, vertices
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
getRandomPoint
(Vector3f store) Randomly selects a point on a random face of one of the stored meshes.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.void
Sets the meshes for this emitter shape.Methods inherited from class com.jme3.effect.shapes.EmitterMeshVertexShape
cloneFields, deepClone, jmeClone, read, write
-
Constructor Details
-
EmitterMeshFaceShape
public EmitterMeshFaceShape()Empty constructor. Sets nothing. -
EmitterMeshFaceShape
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 ofMesh
objects that will define the shape from which particles are emitted.
-
-
Method Details
-
setMeshes
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 classEmitterMeshVertexShape
- Parameters:
meshes
- a list ofMesh
objects to set as the emitter's shape.
-
getRandomPoint
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 interfaceEmitterShape
- Overrides:
getRandomPoint
in classEmitterMeshVertexShape
- Parameters:
store
- aVector3f
object where the coordinates of the selected point will be stored.
-
getRandomPointAndNormal
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 interfaceEmitterShape
- Overrides:
getRandomPointAndNormal
in classEmitterMeshVertexShape
- Parameters:
store
- aVector3f
object where the coordinates of the selected point will be stored.normal
- aVector3f
object where the normal of the selected face will be stored.
-