Package toxi.geom
Class AxisAlignedCylinder
java.lang.Object
toxi.geom.AxisAlignedCylinder
- All Implemented Interfaces:
Shape3D
- Direct Known Subclasses:
XAxisCylinder,YAxisCylinder,ZAxisCylinder
-
Method Summary
Modifier and TypeMethodDescriptionabstract booleanChecks if the given point is inside the cylinder.floatabstract Vec3D.AxisReturns the cylinder's position (centroid).floatvoidsetLength(float length) voidsetPosition(Vec3D pos) voidsetRadius(float radius) toMesh()Builds a TriangleMesh representation of the cylinder at a default resolution 30 degrees.toMesh(int steps, float thetaOffset) Builds a TriangleMesh representation of the cylinder using the given number of steps and start angle offset.
-
Method Details
-
containsPoint
Checks if the given point is inside the cylinder.- Specified by:
containsPointin interfaceShape3D- Parameters:
p-- Returns:
- true, if inside
-
getLength
public float getLength()- Returns:
- the length
-
getMajorAxis
- Returns:
- the cylinder's orientation axis
-
getPosition
Returns the cylinder's position (centroid).- Returns:
- the pos
-
getRadius
public float getRadius()- Returns:
- the cylinder radius
-
setLength
public void setLength(float length) - Parameters:
length- the length to set
-
setPosition
- Parameters:
pos- the pos to set
-
setRadius
public void setRadius(float radius) - Parameters:
radius-
-
toMesh
Builds a TriangleMesh representation of the cylinder at a default resolution 30 degrees.- Returns:
- mesh instance
-
toMesh
Builds a TriangleMesh representation of the cylinder using the given number of steps and start angle offset.- Parameters:
steps-thetaOffset-- Returns:
- mesh
-
toMesh
-