Package geometries
Class Geometry
java.lang.Object
geometries.Geometry
- All Implemented Interfaces:
Intersectible
public abstract class Geometry extends java.lang.Object implements Intersectible
Represents a three dimensional shape
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected Intersection
intersection(Point point)
Create an intersection object with this geometry and the givenPoint
.abstract NormalizedVector
normal(Point point)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface geometries.Intersectible
boundary, intersect
-
Field Details
-
material
The material of this geometry.
-
-
Constructor Details
-
Geometry
Construct a new Geometry with the given material.- Parameters:
material
- TheMaterial
the geometry is made from.
-
-
Method Details
-
normal
Calculates the normal to theGeometry
at the givenPoint
. If the givenPoint
is not on the surface of theGeometry
the resulting behaviour is undefined.- Parameters:
point
- ThePoint
at which to calculate the normal.- Returns:
- A
NormalizedVector
perpendicular to the surface of the shape at the givenPoint
.
-
intersection
Create an intersection object with this geometry and the givenPoint
.- Parameters:
point
- The point at which the intersection occurs.- Returns:
- An
Intersection
with this geometry at the given point.
-