Package rayrangers.raytracer.world
Class Face
java.lang.Object
rayrangers.raytracer.world.Face
- All Implemented Interfaces:
Hittable
- Direct Known Subclasses:
Triangle
Represents a face described by a Wavefront OBJ file.
OBJ file:
f v ...
f v/vt ...
f v//vn
f v/vt/vn ...
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Vertex3D[]
Returns all vertices of the face in an array.abstract Vertex3D
Calculates the center point of a face.Returns the material of the face.Returns the smoothing group of the face.boolean
isInSameSmoothinggroup
(Face otherFace) Checks if another face is in the same smoothing group.
-
Field Details
-
material
Material of the face. -
smoothingGroup
Smoothing group the face belongs to. OBJ file: s smoothing-group
-
-
Constructor Details
-
Face
Constructs a face with the given material and smoothing group.- Parameters:
material
- materialsmoothingGroup
- smoothing group, parser will pass Integer.MIN_VALUE if not specified
-
-
Method Details
-
getMaterial
Returns the material of the face.- Returns:
- material
-
getSmoothingGroup
Returns the smoothing group of the face.- Returns:
- smoothing group
-
isInSameSmoothinggroup
Checks if another face is in the same smoothing group.- Parameters:
otherFace
- face to compare- Returns:
- boolean result
-
getAllVert
Returns all vertices of the face in an array.- Returns:
- vertices
-
getCenter
Calculates the center point of a face.- Returns:
- center point
-