public final class Ring extends java.lang.Object implements Savable, java.lang.Cloneable, java.io.Serializable
Ring
defines a flat ring or disk within three dimensional
space that is specified via the ring's center point, an up vector, an inner
radius, and an outer radius.Constructor and Description |
---|
Ring()
Constructor creates a new
Ring lying on the XZ plane,
centered at the origin, with an inner radius of zero and an outer radius
of one (a unit disk). |
Ring(Vector3f center,
Vector3f up,
float innerRadius,
float outerRadius)
Constructor creates a new
Ring with defined center point,
up vector, and inner and outer radii. |
Modifier and Type | Method and Description |
---|---|
Ring |
clone()
Create a copy of this ring.
|
Vector3f |
getCenter()
getCenter returns the center of the ring. |
float |
getInnerRadius()
getInnerRadius returns the ring's inner radius. |
float |
getOuterRadius()
getOuterRadius returns the ring's outer radius. |
Vector3f |
getUp()
getUp returns the ring's up vector. |
Vector3f |
random()
random returns a random point within the ring. |
Vector3f |
random(Vector3f result)
random returns a random point within the ring. |
void |
read(JmeImporter e)
De-serialize this ring from the specified importer, for example
when loading from a J3O file.
|
void |
setCenter(Vector3f center)
setCenter sets the center of the ring. |
void |
setInnerRadius(float innerRadius)
setInnerRadius sets the ring's inner radius. |
void |
setOuterRadius(float outerRadius)
setOuterRadius sets the ring's outer radius. |
void |
setUp(Vector3f up)
setUp sets the ring's up vector. |
void |
write(JmeExporter e)
Serialize this ring to the specified exporter, for example when
saving to a J3O file.
|
public Ring()
Ring
lying on the XZ plane,
centered at the origin, with an inner radius of zero and an outer radius
of one (a unit disk).public Ring(Vector3f center, Vector3f up, float innerRadius, float outerRadius)
Ring
with defined center point,
up vector, and inner and outer radii.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.public Vector3f getCenter()
getCenter
returns the center of the ring.public void setCenter(Vector3f center)
setCenter
sets the center of the ring.center
- the center of the ring.public Vector3f getUp()
getUp
returns the ring's up vector.public void setUp(Vector3f up)
setUp
sets the ring's up vector.up
- the ring's up vector.public float getInnerRadius()
getInnerRadius
returns the ring's inner radius.public void setInnerRadius(float innerRadius)
setInnerRadius
sets the ring's inner radius.innerRadius
- the ring's inner radius.public float getOuterRadius()
getOuterRadius
returns the ring's outer radius.public void setOuterRadius(float outerRadius)
setOuterRadius
sets the ring's outer radius.outerRadius
- the ring's outer radius.public Vector3f random()
random
returns a random point within the ring.public Vector3f random(Vector3f result)
random
returns a random point within the ring.result
- Vector to store result inpublic void write(JmeExporter e) throws java.io.IOException
public void read(JmeImporter e) throws java.io.IOException
public Ring clone()
clone
in class java.lang.Object