toxi.geom
Class XAxisCylinder

java.lang.Object
  extended by toxi.geom.XAxisCylinder
All Implemented Interfaces:
AxisAlignedCylinder

public class XAxisCylinder
extends java.lang.Object
implements AxisAlignedCylinder


Constructor Summary
XAxisCylinder(Vec3D pos, float radius, float length)
           
 
Method Summary
 boolean containsPoint(Vec3D p)
          Checks if the given point is inside the cylinder.
 float getLength()
           
 Vec3D.Axis getMajorAxis()
           
 Vec3D getPosition()
          Returns the cylinder's position (centroid).
 float getRadius()
           
 void setLength(float length)
           
 void setPosition(Vec3D pos)
           
 void setRadius(float radius)
           
 TriangleMesh toMesh()
          Builds a TriangleMesh representation of the cylinder at a default resolution 30 degrees.
 TriangleMesh toMesh(int steps, float thetaOffset)
          Builds a TriangleMesh representation of the cylinder using the given number of steps and start angle offset.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XAxisCylinder

public XAxisCylinder(Vec3D pos,
                     float radius,
                     float length)
Method Detail

containsPoint

public boolean containsPoint(Vec3D p)
Description copied from interface: AxisAlignedCylinder
Checks if the given point is inside the cylinder.

Specified by:
containsPoint in interface AxisAlignedCylinder
Returns:
true, if inside

getLength

public float getLength()
Specified by:
getLength in interface AxisAlignedCylinder
Returns:
the length

getMajorAxis

public Vec3D.Axis getMajorAxis()
Specified by:
getMajorAxis in interface AxisAlignedCylinder
Returns:
the cylinder's orientation axis

getPosition

public Vec3D getPosition()
Description copied from interface: AxisAlignedCylinder
Returns the cylinder's position (centroid).

Specified by:
getPosition in interface AxisAlignedCylinder
Returns:
the pos

getRadius

public float getRadius()
Specified by:
getRadius in interface AxisAlignedCylinder
Returns:
the cylinder radius

setLength

public void setLength(float length)
Specified by:
setLength in interface AxisAlignedCylinder
Parameters:
length - the length to set

setPosition

public void setPosition(Vec3D pos)
Specified by:
setPosition in interface AxisAlignedCylinder
Parameters:
pos - the pos to set

setRadius

public void setRadius(float radius)
Specified by:
setRadius in interface AxisAlignedCylinder

toMesh

public TriangleMesh toMesh()
Description copied from interface: AxisAlignedCylinder
Builds a TriangleMesh representation of the cylinder at a default resolution 30 degrees.

Specified by:
toMesh in interface AxisAlignedCylinder
Returns:
mesh instance

toMesh

public TriangleMesh toMesh(int steps,
                           float thetaOffset)
Description copied from interface: AxisAlignedCylinder
Builds a TriangleMesh representation of the cylinder using the given number of steps and start angle offset.

Specified by:
toMesh in interface AxisAlignedCylinder
Returns:
mesh