Package com.jme3.math
Class Ring
java.lang.Object
com.jme3.math.Ring
- All Implemented Interfaces:
- Savable,- Serializable,- Cloneable
Ring defines a flat ring or disc in three-dimensional
 space that is specified via the ring's center point, an up vector, an inner
 radius, and an outer radius.- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionRing()Constructor creates a newRinglying on the XZ plane, centered at the origin, with an inner radius of zero and an outer radius of one (a unit disk).Constructor creates a newRingwith defined center point, up vector, and inner and outer radii.
- 
Method SummaryModifier and TypeMethodDescriptionclone()Create a copy of this ring.getCenterreturns the center of the ring.floatgetInnerRadiusreturns the ring's inner radius.floatgetOuterRadiusreturns the ring's outer radius.getUp()getUpreturns the ring's up vector.random()randomreturns a random point within the ring.randomreturns a random point within the ring.voidread(JmeImporter importer) De-serialize this ring from the specified importer, for example when loading from a J3O file.voidsetCentersets the center of the ring.voidsetInnerRadius(float innerRadius) setInnerRadiussets the ring's inner radius.voidsetOuterRadius(float outerRadius) setOuterRadiussets the ring's outer radius.voidsetUpsets the ring's up vector.voidwrite(JmeExporter e) Serialize this ring to the specified exporter, for example when saving to a J3O file.
- 
Constructor Details- 
Ringpublic Ring()Constructor creates a newRinglying on the XZ plane, centered at the origin, with an inner radius of zero and an outer radius of one (a unit disk).
- 
RingConstructor creates a newRingwith defined center point, up vector, and inner and outer radii.- Parameters:
- center- the center of the ring.
- up- the unit up vector defining the ring's orientation.
- innerRadius- the ring's inner radius.
- outerRadius- the ring's outer radius.
 
 
- 
- 
Method Details- 
getCentergetCenterreturns the center of the ring.- Returns:
- the center of the ring.
 
- 
setCentersetCentersets the center of the ring.- Parameters:
- center- the center of the ring.
 
- 
getUpgetUpreturns the ring's up vector.- Returns:
- the ring's up vector.
 
- 
setUpsetUpsets the ring's up vector.- Parameters:
- up- the ring's up vector.
 
- 
getInnerRadiuspublic float getInnerRadius()getInnerRadiusreturns the ring's inner radius.- Returns:
- the ring's inner radius.
 
- 
setInnerRadiuspublic void setInnerRadius(float innerRadius) setInnerRadiussets the ring's inner radius.- Parameters:
- innerRadius- the ring's inner radius.
 
- 
getOuterRadiuspublic float getOuterRadius()getOuterRadiusreturns the ring's outer radius.- Returns:
- the ring's outer radius.
 
- 
setOuterRadiuspublic void setOuterRadius(float outerRadius) setOuterRadiussets the ring's outer radius.- Parameters:
- outerRadius- the ring's outer radius.
 
- 
randomrandomreturns a random point within the ring.- Returns:
- a random point within the ring.
 
- 
randomrandomreturns a random point within the ring.- Parameters:
- result- Vector to store result in
- Returns:
- a random point within the ring.
 
- 
writeSerialize this ring to the specified exporter, for example when saving to a J3O file.- Specified by:
- writein interface- Savable
- Parameters:
- e- (not null)
- Throws:
- IOException- from the exporter
 
- 
readDe-serialize this ring from the specified importer, for example when loading from a J3O file.- Specified by:
- readin interface- Savable
- Parameters:
- importer- (not null)
- Throws:
- IOException- from the importer
 
- 
cloneCreate a copy of this ring.
 
-