Package renderer.pipeline
Class NearClip_Line
- java.lang.Object
-
- renderer.pipeline.NearClip_Line
-
public final class NearClip_Line extends Object
Clip in camera space anyLineSegment
that crosses the camera's near clipping planez = -near
. InterpolateVertex
color from any clipped offVertex
to the newVertex
.This clipping algorithm is a simplification of the Liang-Barsky Parametric Line Clipping algorithm.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<Primitive>
clip(Model model, LineSegment ls, Camera camera)
If theLineSegment
crosses the camera's near plane, then return a clipped version that is contained in the far side of the near plane.
-
-
-
Method Detail
-
clip
public static Optional<Primitive> clip(Model model, LineSegment ls, Camera camera)
If theLineSegment
crosses the camera's near plane, then return a clipped version that is contained in the far side of the near plane. The new, clippedLineSegment
object is returned wrapped in anOptional
object.One new clipped
Vertex
object may be added to theModel
's vertex list and one new interpolatedColor
object may be added to the model's color list.If the
LineSegment
is completely on the camera side of the near plane, then return an emptyOptional
object to indicate that theLineSegment
should be discarded from the model'sPrimitive
list.- Parameters:
model
-Model
that theLineSegment
ls
comes fromls
-LineSegment
to be clippedcamera
-Camera
that determines the near clipping plane- Returns:
- a clipped version of
ls
wrapped in anOptional
object
-
-