physics3d
Class PlaneCircle
java.lang.Object
physics3d.PlaneCircle
- All Implemented Interfaces:
- PhysicsShape
public class PlaneCircle
- extends Object
- implements PhysicsShape
PlaneCircle represents a plane circle in 3 space
- Specification Fields
-
-
centerPoint
: Vect3 // center of circle
-
normal
: Vect3 // a unit vector perpendicular to the circle
-
radius
: double // radius of circle
-
texture
: String // texture of this object
PlaneCircle
public PlaneCircle(Vect3 center,
Vect3 normal,
double r,
String texture)
- Parameters:
center
- the center point of the circlenormal
- the orientation of the circler
- 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 circlenormal
- the orientation of the circler
- 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.
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