Package renderer.pipeline
Class NearClip_Line
- java.lang.Object
-
- renderer.pipeline.NearClip_Line
-
public final class NearClip_Line extends Object
Clip in camera space anyLineSegmentthat crosses the camera's near clipping planez = -near. InterpolateVertexcolor from any clipped offVertexto 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 theLineSegmentcrosses 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 theLineSegmentcrosses the camera's near plane, then return a clipped version that is contained in the far side of the near plane. The new, clippedLineSegmentobject is returned wrapped in anOptionalobject.One new clipped
Vertexobject may be added to theModel's vertex list and one new interpolatedColorobject may be added to the model's color list.If the
LineSegmentis completely on the camera side of the near plane, then return an emptyOptionalobject to indicate that theLineSegmentshould be discarded from the model'sPrimitivelist.- Parameters:
model-Modelthat theLineSegmentlscomes fromls-LineSegmentto be clippedcamera-Camerathat determines the near clipping plane- Returns:
- a clipped version of
lswrapped in anOptionalobject
-
-