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 boolean
Checks if the given point is inside the cylinder.float
abstract Vec3D.Axis
Returns the cylinder's position (centroid).float
void
setLength
(float length) void
setPosition
(Vec3D pos) void
setRadius
(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:
containsPoint
in 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
-