physics3d
Class PlaneCircle

java.lang.Object
  extended by physics3d.PlaneCircle
All Implemented Interfaces:
PhysicsShape

public class PlaneCircle
extends Object
implements PhysicsShape

PlaneCircle represents a plane circle in 3 space

Specification Fields

Constructor Summary
PlaneCircle(Vect3 center, Vect3 normal, double r)
           
PlaneCircle(Vect3 center, Vect3 normal, double r, String texture)
           
 
Method Summary
 boolean containsPoint(Vect3 p)
           
 Vect3 getCenter()
           
 Vect3 getNormal()
           
 double getRadius()
           
 ShapeClassification getShapeClassification()
           
 String getTexture()
           
 double minDistanceToObjectFromP(Vect3 p)
           
 Plane planeContainingObject()
           
 PlaneCircle rotateAboutCwithAxisAandAngleT(Vect3 center, Vect3 axis, Angle tAngle)
           
 String toString()
           
 PlaneCircle translateByT(Vect3 t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlaneCircle

public PlaneCircle(Vect3 center,
                   Vect3 normal,
                   double r,
                   String texture)
Parameters:
center - the center point of the circle
normal - the orientation of the circle
r - the radius of the circle
Requires:
r >= 0, center != null, normal != null, normal.rho() != 0, texture != null,
Effects:
Creates a new circle with the specified size and location and orientation in 3D.

PlaneCircle

public PlaneCircle(Vect3 center,
                   Vect3 normal,
                   double r)
Parameters:
center - the center point of the circle
normal - the orientation of the circle
r - the radius of the circle
Requires:
r >= 0, center != null, normal != null, normal.rho() > 0
Effects:
Creates a new circle with the specified size and location and orientation in 3D.
Method Detail

getCenter

public Vect3 getCenter()
Returns:
the center point of this circle.

getNormal

public Vect3 getNormal()
Returns:
the unit vector perpendicular to the given circle with correct orientation as specified at initilization.

getRadius

public double getRadius()
Returns:
the radius of this circle.

getTexture

public String getTexture()
Returns:
texture of this object

planeContainingObject

public Plane planeContainingObject()
Returns:
the plane containing this

containsPoint

public boolean containsPoint(Vect3 p)
Specified by:
containsPoint in interface PhysicsShape
Returns:
true if p is within the geometric shape created by the intersection of a sphere of radius centered at centerPoint and the geometric shape created by moving this up and down this.normal by GameConstants.TOLERANCE, false otherwise
Requires:
v != null

minDistanceToObjectFromP

public double minDistanceToObjectFromP(Vect3 p)
Specified by:
minDistanceToObjectFromP in interface PhysicsShape
Returns:
the minimum distance between p and this
Requires:
p is not null

rotateAboutCwithAxisAandAngleT

public PlaneCircle rotateAboutCwithAxisAandAngleT(Vect3 center,
                                                  Vect3 axis,
                                                  Angle tAngle)
Specified by:
rotateAboutCwithAxisAandAngleT in interface PhysicsShape
Returns:
A PlaneCircle rotated about the line created by center and axis counterclockwise by an amount tAngle with same texture
Requires:
center != null, axis != null, axis.rho() > 0, tAngle != null.

translateByT

public PlaneCircle translateByT(Vect3 t)
Specified by:
translateByT in interface PhysicsShape
Returns:
A PlaneCircle translated by t with same texture
Requires:
t != null

toString

public String toString()
Overrides:
toString in class Object

getShapeClassification

public ShapeClassification getShapeClassification()
Specified by:
getShapeClassification in interface PhysicsShape