Class Cylinder
java.lang.Object
com.marginallyclever.ro3.mesh.Mesh
com.marginallyclever.ro3.mesh.proceduralmesh.ProceduralMesh
com.marginallyclever.ro3.mesh.proceduralmesh.Cylinder
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloatfloatfloatstatic final intstatic final intFields inherited from class com.marginallyclever.ro3.mesh.Mesh
colorArray, indexArray, normalArray, NUM_BUFFERS, renderStyle, textureArray, vertexArray -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfromJSON(org.json.JSONObject jo) voidsetLength(double length) Sets the length of the cylinder.voidsetRadius(double radius) Sets the radius of the cylinder.voidsetRadiusAndLength(double radius, double length) Sets both radius's and the length of the cylinder.org.json.JSONObjecttoJSON()voidProcedurally generate a list of triangles and update the bounding box.Methods inherited from class com.marginallyclever.ro3.mesh.Mesh
addColor, addIndex, addNormal, addNormal, addPropertyChangeListener, addTexCoord, addVertex, addVertex, clear, fireMeshChanged, getBoundingBox, getHasColors, getHasIndexes, getHasNormals, getHasTextures, getNormal, getNumTriangles, getNumVertices, getRandomPointOnSurface, getRandomPointOnTriangle, getRenderStyle, getSourceName, getTexCoord, getTriangleArea, getVertex, getVertexProvider, intersect, isDirty, isLoaded, isTransparent, removePropertyChangeListener, render, render, setDirty, setLoaded, setRenderStyle, setSourceName, setTexCoord, setVertex, unload, updateCuboid, updateVertexBuffers
-
Field Details
-
RESOLUTION_CIRCULAR
public static final int RESOLUTION_CIRCULAR- See Also:
-
RESOLUTION_LENGTH
public static final int RESOLUTION_LENGTH- See Also:
-
radius0
public float radius0 -
radius1
public float radius1 -
height
public float height
-
-
Constructor Details
-
Cylinder
public Cylinder() -
Cylinder
public Cylinder(double height, double radius0, double radius1)
-
-
Method Details
-
getEnglishName
- Specified by:
getEnglishNamein classProceduralMesh
-
updateModel
public void updateModel()Description copied from class:ProceduralMeshProcedurally generate a list of triangles and update the bounding box.- Specified by:
updateModelin classProceduralMesh
-
toJSON
public org.json.JSONObject toJSON()- Overrides:
toJSONin classProceduralMesh
-
fromJSON
public void fromJSON(org.json.JSONObject jo) - Overrides:
fromJSONin classProceduralMesh
-
setRadiusAndLength
public void setRadiusAndLength(double radius, double length) Sets both radius's and the length of the cylinder.- Parameters:
radius-length-
-
setLength
public void setLength(double length) Sets the length of the cylinder. does not update the mesh.- Parameters:
length-
-
setRadius
public void setRadius(double radius) Sets the radius of the cylinder. does not update the mesh.- Parameters:
radius-
-