us.ihmc.utilities.math.geometry
Class Cylinder3d

java.lang.Object
  extended by us.ihmc.utilities.math.geometry.Cylinder3d
All Implemented Interfaces:
Shape3d

public class Cylinder3d
extends java.lang.Object
implements Shape3d


Constructor Summary
Cylinder3d(Cylinder3d cylinder3d)
           
Cylinder3d(double height, double radius)
           
Cylinder3d(javax.media.j3d.Transform3D transform, double height, double radius)
           
 
Method Summary
 void applyTransform(javax.media.j3d.Transform3D transform)
          Apply the given transform to translate and rotate this shape.
 Cylinder3d applyTransformCopy(javax.media.j3d.Transform3D transform)
          Create a copy of this shape, then apply the given transform to translate and rotate the copy.
 double distance(javax.vecmath.Point3d point)
          Find the distance from the closest point on this shape to the given point.
 void getClosestPointAndNormalAt(javax.vecmath.Point3d closestPointToPack, javax.vecmath.Vector3d normalToPack, javax.vecmath.Point3d pointInWorldToCheck)
          Find the closest point on the surface of this shape to the given point as well as the surface normal at that point.
 double getHeight()
           
 double getRadius()
           
 javax.media.j3d.Transform3D getTransform()
           
 boolean isInsideOrOnSurface(javax.vecmath.Point3d pointToCheck)
          Determine whether the given point is on or inside the surface of this shape.
 boolean isInsideOrOnSurface(javax.vecmath.Point3d pointToCheck, double epsilon)
          Determine whether the given point is on or inside the surface of this shape, within a given tolerance or error level.
 void orthogonalProjection(javax.vecmath.Point3d pointToCheckAndPack)
          Find the closest point on the surface of this shape to the given point.
 javax.vecmath.Point3d orthogonalProjectionCopy(javax.vecmath.Point3d point)
          Find the closest point on the surface of this shape to the given point.
 void set(Cylinder3d cylinder3d)
           
 void setHeight(double height)
           
 void setRadius(double radius)
           
 void setTransform(javax.media.j3d.Transform3D newTransform)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cylinder3d

public Cylinder3d(double height,
                  double radius)

Cylinder3d

public Cylinder3d(javax.media.j3d.Transform3D transform,
                  double height,
                  double radius)

Cylinder3d

public Cylinder3d(Cylinder3d cylinder3d)
Method Detail

set

public void set(Cylinder3d cylinder3d)

getRadius

public double getRadius()

setRadius

public void setRadius(double radius)

getHeight

public double getHeight()

setHeight

public void setHeight(double height)

getTransform

public javax.media.j3d.Transform3D getTransform()

setTransform

public void setTransform(javax.media.j3d.Transform3D newTransform)

applyTransform

public void applyTransform(javax.media.j3d.Transform3D transform)
Description copied from interface: Shape3d
Apply the given transform to translate and rotate this shape.

Specified by:
applyTransform in interface Shape3d

applyTransformCopy

public Cylinder3d applyTransformCopy(javax.media.j3d.Transform3D transform)
Description copied from interface: Shape3d
Create a copy of this shape, then apply the given transform to translate and rotate the copy.

Specified by:
applyTransformCopy in interface Shape3d
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getClosestPointAndNormalAt

public void getClosestPointAndNormalAt(javax.vecmath.Point3d closestPointToPack,
                                       javax.vecmath.Vector3d normalToPack,
                                       javax.vecmath.Point3d pointInWorldToCheck)
Description copied from interface: Shape3d
Find the closest point on the surface of this shape to the given point as well as the surface normal at that point.

Specified by:
getClosestPointAndNormalAt in interface Shape3d
Parameters:
closestPointToPack - out parameter packed with the resulting closest point on the shape
normalToPack - out parameter packed with the resulting normal vector

distance

public double distance(javax.vecmath.Point3d point)
Description copied from interface: Shape3d
Find the distance from the closest point on this shape to the given point.

Specified by:
distance in interface Shape3d
Returns:

isInsideOrOnSurface

public boolean isInsideOrOnSurface(javax.vecmath.Point3d pointToCheck)
Description copied from interface: Shape3d
Determine whether the given point is on or inside the surface of this shape.

Specified by:
isInsideOrOnSurface in interface Shape3d
Returns:

isInsideOrOnSurface

public boolean isInsideOrOnSurface(javax.vecmath.Point3d pointToCheck,
                                   double epsilon)
Description copied from interface: Shape3d
Determine whether the given point is on or inside the surface of this shape, within a given tolerance or error level.

Specified by:
isInsideOrOnSurface in interface Shape3d
Returns:

orthogonalProjection

public void orthogonalProjection(javax.vecmath.Point3d pointToCheckAndPack)
Description copied from interface: Shape3d
Find the closest point on the surface of this shape to the given point. If the given point is on or inside the shape, then it is not changed.

Specified by:
orthogonalProjection in interface Shape3d
Parameters:
pointToCheckAndPack - both an input parameter (the point to check), and an output parameter (packed with the resulting ortho point).

orthogonalProjectionCopy

public javax.vecmath.Point3d orthogonalProjectionCopy(javax.vecmath.Point3d point)
Description copied from interface: Shape3d
Find the closest point on the surface of this shape to the given point. If the given point is on or inside the shape, then it returned unchanged.

Specified by:
orthogonalProjectionCopy in interface Shape3d
Returns:
a new point on surface of the shape