Package com.jme3.effect.shapes
Class EmitterBoxShape
java.lang.Object
com.jme3.effect.shapes.EmitterBoxShape
- All Implemented Interfaces:
EmitterShape,Savable,JmeCloneable,Cloneable
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 Summary
ConstructorsConstructorDescriptionFor serialization only.EmitterBoxShape(Vector3f min, Vector3f max) Constructs anEmitterBoxShapedefined by a minimum and maximum corner. -
Method Summary
Modifier and TypeMethodDescriptionvoidcloneFields(Cloner cloner, Object original) Called internally by com.jme3.util.clone.Cloner.This method creates a deep clone of the current instance of the emitter shape.getLen()Returns the length vector of the emitting box.getMin()Returns the minimum corner of the emitting box.voidgetRandomPoint(Vector3f store) Generates a random point within the bounds of the box.voidgetRandomPointAndNormal(Vector3f store, Vector3f normal) For a box shape, the normal is not well-defined for points within the volume.jmeClone()Called internally by com.jme3.util.clone.Cloner.voidread(JmeImporter im) voidSets the length vector of the emitting box.voidSets the minimum corner of the emitting box.voidwrite(JmeExporter ex)
-
Constructor Details
-
EmitterBoxShape
public EmitterBoxShape()For serialization only. Do not use. -
EmitterBoxShape
Constructs anEmitterBoxShapedefined by a minimum and maximum corner.- Parameters:
min- The minimum corner of the box.max- The maximum corner of the box.- Throws:
IllegalArgumentException- If eitherminormaxis null.
-
-
Method Details
-
getRandomPoint
Generates a random point within the bounds of the box.- Specified by:
getRandomPointin interfaceEmitterShape- Parameters:
store- TheVector3fto store the generated point in.
-
getRandomPointAndNormal
For a box shape, the normal is not well-defined for points within the volume. This implementation simply callsgetRandomPoint(Vector3f)and does not modify the provided normal.- Specified by:
getRandomPointAndNormalin interfaceEmitterShape- Parameters:
store- TheVector3fto store the generated point in.normal- TheVector3fto store the generated normal in (unused).
-
deepClone
Description copied from interface:EmitterShapeThis method creates a deep clone of the current instance of the emitter shape.- Specified by:
deepClonein interfaceEmitterShape- Returns:
- deep clone of the current instance of the emitter shape
-
jmeClone
Called internally by com.jme3.util.clone.Cloner. Do not call directly.- Specified by:
jmeClonein interfaceJmeCloneable- Returns:
- a new instance
-
cloneFields
Called internally by com.jme3.util.clone.Cloner. Do not call directly.- Specified by:
cloneFieldsin interfaceJmeCloneable- 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
Returns the minimum corner of the emitting box.- Returns:
- The minimum corner.
-
setMin
Sets the minimum corner of the emitting box.- Parameters:
min- The new minimum corner.
-
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
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
- Specified by:
writein interfaceSavable- Throws:
IOException
-
read
- Specified by:
readin interfaceSavable- Throws:
IOException
-