Class Capsule
java.lang.Object
com.marginallyclever.ro3.mesh.Mesh
com.marginallyclever.ro3.mesh.proceduralmesh.ProceduralMesh
com.marginallyclever.ro3.mesh.proceduralmesh.Capsule
-
Field Summary
Modifier and TypeFieldDescriptionfloat
float
static final int
static final int
static final int
Fields inherited from class com.marginallyclever.ro3.mesh.Mesh
BYTES_PER_FLOAT, BYTES_PER_INT, colorArray, indexArray, normalArray, NUM_BUFFERS, renderStyle, textureArray, vertexArray
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
fromJSON
(org.json.JSONObject jo) void
setLength
(double length) Sets the length of the cylinder.void
setRadius
(double radius) Sets the radius of the cylinder.org.json.JSONObject
toJSON()
void
Procedurally generate a list of triangles and update the bounding box.Methods inherited from class com.marginallyclever.ro3.mesh.Mesh
addColor, addIndex, addNormal, addPropertyChangeListener, addTexCoord, addVertex, clear, fireMeshChanged, getBoundingBox, getHasColors, getHasIndexes, getHasNormals, getHasTextures, getNormal, getNumTriangles, getNumVertices, getRenderStyle, getSourceName, getTexCoord, getVertex, 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:
-
RESOLUTION_DOME
public static final int RESOLUTION_DOME- See Also:
-
radius
public float radius -
height
public float height
-
-
Constructor Details
-
Capsule
public Capsule() -
Capsule
public Capsule(double height, double radius)
-
-
Method Details
-
getEnglishName
- Specified by:
getEnglishName
in classProceduralMesh
-
updateModel
public void updateModel()Description copied from class:ProceduralMesh
Procedurally generate a list of triangles and update the bounding box.- Specified by:
updateModel
in classProceduralMesh
-
toJSON
public org.json.JSONObject toJSON()- Overrides:
toJSON
in classProceduralMesh
-
fromJSON
public void fromJSON(org.json.JSONObject jo) - Overrides:
fromJSON
in classProceduralMesh
-
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
-
-