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 anEmitterBoxShape
defined by a minimum and maximum corner. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cloneFields
(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.void
getRandomPoint
(Vector3f store) Generates a random point within the bounds of the box.void
getRandomPointAndNormal
(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.void
read
(JmeImporter im) void
Sets the length vector of the emitting box.void
Sets the minimum corner of the emitting box.void
write
(JmeExporter ex)
-
Constructor Details
-
EmitterBoxShape
public EmitterBoxShape()For serialization only. Do not use. -
EmitterBoxShape
Constructs anEmitterBoxShape
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 eithermin
ormax
is null.
-
-
Method Details
-
getRandomPoint
Generates a random point within the bounds of the box.- Specified by:
getRandomPoint
in interfaceEmitterShape
- Parameters:
store
- TheVector3f
to 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:
getRandomPointAndNormal
in interfaceEmitterShape
- Parameters:
store
- TheVector3f
to store the generated point in.normal
- TheVector3f
to store the generated normal in (unused).
-
deepClone
Description copied from interface:EmitterShape
This method creates a deep clone of the current instance of the emitter shape.- Specified by:
deepClone
in 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:
jmeClone
in interfaceJmeCloneable
- Returns:
- a new instance
-
cloneFields
Called internally by com.jme3.util.clone.Cloner. Do not call directly.- Specified by:
cloneFields
in 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:
write
in interfaceSavable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Throws:
IOException
-