public class Cylinder extends Shape3D
Cylinder
class defines a 3 dimensional cylinder with the specified size.
A Cylinder
is a 3D geometry primitive created with a given radius and height.
It is centered at the origin.Type | Property and Description |
---|---|
DoubleProperty |
height
Defines the height or the Y dimension of the Cylinder.
|
DoubleProperty |
radius
Defines the radius in the Z plane of the Cylinder.
|
cullFaceProperty, drawModeProperty, materialProperty
Modifier and Type | Class and Description |
---|---|
private static class |
Cylinder.CylinderKey |
Shape3D.Key
Modifier and Type | Field and Description |
---|---|
(package private) static int |
DEFAULT_DIVISIONS |
(package private) static double |
DEFAULT_HEIGHT |
(package private) static double |
DEFAULT_RADIUS |
private int |
divisions |
private DoubleProperty |
height
Defines the height or the Y dimension of the Cylinder.
|
private TriangleMesh |
mesh |
private DoubleProperty |
radius
Defines the radius in the Z plane of the Cylinder.
|
Constructor and Description |
---|
Cylinder()
Creates a new instance of
Cylinder of radius of 1.0 and height of 2.0. |
Cylinder(double radius,
double height)
Creates a new instance of
Cylinder of a given radius and height. |
Cylinder(double radius,
double height,
int divisions)
Creates a new instance of
Cylinder of a given radius, height, and
divisions. |
Modifier and Type | Method and Description |
---|---|
(package private) static TriangleMesh |
createMesh(int div,
float h,
float r) |
private boolean |
doComputeContains(double localX,
double localY) |
private BaseBounds |
doComputeGeomBounds(BaseBounds bounds,
BaseTransform tx) |
private boolean |
doComputeIntersects(PickRay pickRay,
PickResultChooser pickResult) |
private NGNode |
doCreatePeer() |
private void |
doUpdatePeer() |
int |
getDivisions()
Retrieves the divisions attribute use to generate this cylinder.
|
double |
getHeight()
Gets the value of the property height.
|
double |
getRadius()
Gets the value of the property radius.
|
DoubleProperty |
heightProperty()
Defines the height or the Y dimension of the Cylinder.
|
DoubleProperty |
radiusProperty()
Defines the radius in the Z plane of the Cylinder.
|
void |
setHeight(double value)
Sets the value of the property height.
|
void |
setRadius(double value)
Sets the value of the property radius.
|
cullFaceProperty, drawModeProperty, getCullFace, getDrawMode, getMaterial, materialProperty, setCullFace, setDrawMode, setMaterial
public final DoubleProperty heightProperty
getHeight()
,
setHeight(double)
public final DoubleProperty radiusProperty
getRadius()
,
setRadius(double)
static final int DEFAULT_DIVISIONS
static final double DEFAULT_RADIUS
static final double DEFAULT_HEIGHT
private int divisions
private TriangleMesh mesh
private DoubleProperty height
private DoubleProperty radius
public Cylinder()
Cylinder
of radius of 1.0 and height of 2.0.
Resolution defaults to 15 divisions along X and Z axis.public Cylinder(double radius, double height)
Cylinder
of a given radius and height.
Resolution defaults to 15 divisions along X and Z axis.radius
- Radiusheight
- Heightpublic Cylinder(double radius, double height, int divisions)
Cylinder
of a given radius, height, and
divisions. Resolution defaults to 15 divisions along X and Z axis.
Note that divisions should be at least 3. Any value less than that will be
clamped to 3.radius
- Radiusheight
- Heightdivisions
- Divisionspublic final void setHeight(double value)
public final double getHeight()
public final DoubleProperty heightProperty()
getHeight()
,
setHeight(double)
public final void setRadius(double value)
public final double getRadius()
public final DoubleProperty radiusProperty()
getRadius()
,
setRadius(double)
public int getDivisions()
private void doUpdatePeer()
private NGNode doCreatePeer()
private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx)
private boolean doComputeContains(double localX, double localY)
private boolean doComputeIntersects(PickRay pickRay, PickResultChooser pickResult)
static TriangleMesh createMesh(int div, float h, float r)