Package com.jme3.scene.shape
Class Cylinder
java.lang.Object
com.jme3.scene.Mesh
com.jme3.scene.shape.Cylinder
- All Implemented Interfaces:
- Savable,- JmeCloneable,- Cloneable
A simple cylinder, defined by its height and radius.
 (Ported to jME3)
- 
Nested Class Summary
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCylinder()constructor for serialization only.Cylinder(int axisSamples, int radialSamples, float radius, float height) Creates a Cylinder.Cylinder(int axisSamples, int radialSamples, float radius, float height, boolean closed) Creates a Cylinder.Cylinder(int axisSamples, int radialSamples, float radius, float height, boolean closed, boolean inverted) Creates a new Cylinder.Cylinder(int axisSamples, int radialSamples, float radius, float radius2, float height, boolean closed, boolean inverted) 
- 
Method SummaryModifier and TypeMethodDescriptionintfloatintfloatfloatbooleanisClosed()booleanvoidread(JmeImporter importer) voidupdateGeometry(int axisSamples, int radialSamples, float topRadius, float bottomRadius, float height, boolean closed, boolean inverted) Rebuilds the cylinder based on a new set of parameters.voidwrite(JmeExporter e) Methods inherited from class com.jme3.scene.MeshaddMorphTarget, clearBuffer, clearCollisionData, clone, cloneFields, cloneForAnim, collideWith, createCollisionData, deepClone, extractVertexData, generateBindPose, generateBindPose, getBound, getBuffer, getBufferList, getBuffers, getElementLengths, getFloatBuffer, getId, getIndexBuffer, getIndicesAsList, getInstanceCount, getLineWidth, getLodLevel, getMaxNumWeights, getMode, getModeStart, getMorphIndex, getMorphTarget, getMorphTargetNames, getMorphTargets, getNumLodLevels, getPatchVertexCount, getPointSize, getShortBuffer, getTriangle, getTriangle, getTriangle, getTriangleCount, getTriangleCount, getVertexCount, hasMorphTargets, isAnimated, isAnimatedByBone, isAnimatedByJoint, jmeClone, prepareForAnim, removeMorphTarget, removeMorphTarget, scaleTextureCoordinates, setBound, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setDynamic, setElementLengths, setId, setInterleaved, setLineWidth, setLodLevels, setMaxNumWeights, setMode, setModeStart, setPatchVertexCount, setStatic, setStreamed, updateBound, updateCounts
- 
Constructor Details- 
Cylinderprotected Cylinder()constructor for serialization only. Do not use.
- 
Cylinderpublic Cylinder(int axisSamples, int radialSamples, float radius, float height) Creates a Cylinder. By default, its center is the origin. More samples create a better looking cylinder, at the cost of more vertex data.- Parameters:
- axisSamples- Number of triangle samples along the axis.
- radialSamples- Number of triangle samples along the radial.
- radius- The radius of the cylinder.
- height- The cylinder's height.
 
- 
Cylinderpublic Cylinder(int axisSamples, int radialSamples, float radius, float height, boolean closed) Creates a Cylinder. By default, its center is the origin. More samples create a better looking cylinder, at the cost of more vertex data.
 If the cylinder is closed, the texture is split into axisSamples parts: the topmost and bottommost parts are used for top and bottom of the cylinder, and the rest of the texture is used for the cylinder wall. The middle of the top is mapped to texture coordinates (0.5, 1), bottom to (0.5, 0). Thus, it requires- Parameters:
- axisSamples- Number of triangle samples along the axis.
- radialSamples- Number of triangle samples along the radial.
- radius- The radius of the cylinder.
- height- The cylinder's height.
- closed- true to create a cylinder with top and bottom surface
 
- 
Cylinderpublic Cylinder(int axisSamples, int radialSamples, float radius, float height, boolean closed, boolean inverted) Creates a new Cylinder. By default, its center is the origin. More samples create a better looking cylinder, at the cost of more vertex data.
 If the cylinder is closed, the texture is split into axisSamples parts: the topmost and bottommost parts are used for top and bottom of the cylinder, and the rest of the texture is used for the cylinder wall. The middle of the top is mapped to texture coordinates (0.5, 1), bottom to (0.5, 0). Thus, it requires- Parameters:
- axisSamples- The number of vertices samples along the axis. It is equal to the number of segments + 1; so that, for instance, 4 samples mean the cylinder will be made of 3 segments.
- radialSamples- The number of triangle samples along the radius. For instance, 4 means that the sides of the cylinder are made of 4 rectangles, and the top and bottom are made of 4 triangles.
- radius- The radius of the cylinder.
- height- The cylinder's height.
- closed- true to create a cylinder with top and bottom surface
- inverted- true to create a cylinder that is meant to be viewed from the interior.
 
- 
Cylinderpublic Cylinder(int axisSamples, int radialSamples, float radius, float radius2, float height, boolean closed, boolean inverted) 
 
- 
- 
Method Details- 
getAxisSamplespublic int getAxisSamples()- Returns:
- the number of samples along the cylinder axis
 
- 
getHeightpublic float getHeight()- Returns:
- Returns the height.
 
- 
getRadialSamplespublic int getRadialSamples()- Returns:
- number of samples around cylinder
 
- 
getRadiuspublic float getRadius()- Returns:
- Returns the radius.
 
- 
getRadius2public float getRadius2()
- 
isClosedpublic boolean isClosed()- Returns:
- true if end caps are used.
 
- 
isInvertedpublic boolean isInverted()- Returns:
- true if normals and uvs are created for interior use
 
- 
updateGeometrypublic void updateGeometry(int axisSamples, int radialSamples, float topRadius, float bottomRadius, float height, boolean closed, boolean inverted) Rebuilds the cylinder based on a new set of parameters.- Parameters:
- axisSamples- The number of vertices samples along the axis. It is equal to the number of segments + 1; so that, for instance, 4 samples mean the cylinder will be made of 3 segments.
- radialSamples- The number of triangle samples along the radius. For instance, 4 means that the sides of the cylinder are made of 4 rectangles, and the top and bottom are made of 4 triangles.
- topRadius- the radius of the top of the cylinder.
- bottomRadius- the radius of the bottom of the cylinder.
- height- the cylinder's height.
- closed- should the cylinder have top and bottom surfaces.
- inverted- is the cylinder is meant to be viewed from the inside.
 
- 
read- Specified by:
- readin interface- Savable
- Overrides:
- readin class- Mesh
- Throws:
- IOException
 
- 
write- Specified by:
- writein interface- Savable
- Overrides:
- writein class- Mesh
- Throws:
- IOException
 
 
-