public class TubeMesh
extends com.jme3.scene.Mesh
The tube is rendered from the xz-plane along the y axis. Transformations should be applied to the associated geometry.
Note: After updating the properties of the mesh, you should call
refresh(boolean)
.
Constructor and Description |
---|
TubeMesh()
The default constructor.
|
TubeMesh(float length,
float radius)
Constructs a tube with all default parameters except for those specified
(if valid)
|
TubeMesh(float length,
float innerRadius,
float outerRadius)
Constructs a tube with all default parameters except for those specified
(if valid)
|
TubeMesh(float length,
float innerRadius,
float outerRadius,
int axialSamples,
int radialSamples)
Constructs a tube with all default parameters except for those specified
(if valid)
|
TubeMesh(float length,
float radius,
int axialSamples,
int radialSamples)
Constructs a tube with all default parameters except for those specified
(if valid)
|
Modifier and Type | Method and Description |
---|---|
com.jme3.math.Vector3f[] |
getBottomEdgeVertices()
Gets the outermost vertices from the bottom edge of the tube.
|
com.jme3.math.Vector3f[] |
getTopEdgeVertices()
Gets the outermost vertices from the top edge of the tube.
|
void |
refresh(boolean indicesChanged)
Updates the underlying buffers used to render the mesh.
|
void |
setAxialSamples(int axialSamples)
Sets the number of axial samples along the length of the tube mesh.
|
void |
setLength(float length)
Sets the length of the tube mesh.
|
void |
setRadialSamples(int radialSamples)
Sets the number of radial samples around the tube mesh.
|
void |
setRadii(float innerRadius,
float outerRadius)
Sets the inner and outer radii of the tube mesh.
|
void |
setRadius(float radius)
Sets the radius of the tube mesh.
|
clearBuffer, clone, cloneForAnim, collideWith, createCollisionData, deepClone, extractVertexData, generateBindPose, getBound, getBuffer, getBufferList, getBuffers, getElementLengths, getFloatBuffer, getId, getIndexBuffer, getIndicesAsList, getLineWidth, getLodLevel, getMaxNumWeights, getMode, getModeStart, getNumLodLevels, getPointSize, getShortBuffer, getTriangle, getTriangle, getTriangle, getTriangleCount, getTriangleCount, getVertexCount, isAnimated, prepareForAnim, read, scaleTextureCoordinates, setBound, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setBuffer, setDynamic, setElementLengths, setId, setInterleaved, setLineWidth, setLodLevels, setMaxNumWeights, setMode, setModeStart, setPointSize, setStatic, setStreamed, updateBound, updateCounts, write
public TubeMesh()
public TubeMesh(float length, float radius)
length
- The length of the tube mesh.radius
- The inner and outer radius of the tube. The top and bottom
edges will not be rendered.public TubeMesh(float length, float radius, int axialSamples, int radialSamples)
length
- The length of the tube mesh.radius
- The inner and outer radius of the tube. The top and bottom
edges will not be rendered.axialSamples
- The number of sections of mesh elements along the length of
the tube.radialSamples
- The number of sections of mesh elements around the
circumference of the tube.public TubeMesh(float length, float innerRadius, float outerRadius)
length
- The length of the tube mesh.innerRadius
- The inner radius of the tube mesh.outerRadius
- The outer radius of the tube mesh. This should be greater than
the inner radius.public TubeMesh(float length, float innerRadius, float outerRadius, int axialSamples, int radialSamples)
length
- The length of the tube mesh.innerRadius
- The inner radius of the tube mesh.outerRadius
- The outer radius of the tube mesh. This should be greater than
the inner radius.axialSamples
- The number of sections of mesh elements along the length of
the tube.radialSamples
- The number of sections of mesh elements around the
circumference of the tube.public void setLength(float length)
length
- The length of the tube mesh. This must be greater than 0.public void setRadius(float radius)
radius
- The inner and outer radius of the tube mesh.public void setRadii(float innerRadius, float outerRadius)
innerRadius
- The inner radius of the tube mesh.outerRadius
- The outer radius of the tube mesh. This should be greater than
the inner radius.public void setAxialSamples(int axialSamples)
axialSamples
- The number of sections of mesh elements along the length of
the tube. Must be greater than 0, although it should be
increased if the tube is very long.public void setRadialSamples(int radialSamples)
radialSamples
- The number of sections of mesh elements around the
circumference of the tube. Must be greater than 2.public void refresh(boolean indicesChanged)
indicesChanged
- Whether or not the number of vertices changed. This should be
true if any of the following are true:
public com.jme3.math.Vector3f[] getBottomEdgeVertices()
public com.jme3.math.Vector3f[] getTopEdgeVertices()