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 TypeMethodDescriptionvoidgetRandomPoint(Vector3f store) Randomly selects a point on a random face of one of the stored meshes.voidgetRandomPointAndNormal(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.voidSets 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 ofMeshobjects 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:
setMeshesin classEmitterMeshVertexShape- Parameters:
meshes- a list ofMeshobjects 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:
getRandomPointin interfaceEmitterShape- Overrides:
getRandomPointin classEmitterMeshVertexShape- Parameters:
store- aVector3fobject 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:
getRandomPointAndNormalin interfaceEmitterShape- Overrides:
getRandomPointAndNormalin classEmitterMeshVertexShape- Parameters:
store- aVector3fobject where the coordinates of the selected point will be stored.normal- aVector3fobject where the normal of the selected face will be stored.
-