final class LineRenderer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Graphics3D |
g3d |
private BS |
lineBits |
private java.util.Map<java.lang.Float,BS> |
lineCache |
private boolean |
lineTypeX |
private int |
nBits |
private Shader |
shader |
private float |
slope |
private java.lang.Float |
slopeKey |
private static int |
VISIBILITY_CLIPPED |
private static int |
VISIBILITY_OFFSCREEN |
private static int |
VISIBILITY_UNCLIPPED |
private int |
x1t |
private int |
x2t |
private int |
y1t |
private int |
y2t |
private int |
z1t |
private int |
z2t |
Constructor and Description |
---|
LineRenderer(Graphics3D g3d) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
clearLineCache() |
private int |
getTrimmedLine()
Cohen-Sutherland line clipping used to check visibility.
|
(package private) void |
plotDashedLine(int argb,
int run,
int rise,
int xA,
int yA,
int zA,
int xB,
int yB,
int zB,
boolean clipped) |
(package private) void |
plotLine(int argbA,
int argbB,
int xA,
int yA,
int zA,
int xB,
int yB,
int zB,
boolean clipped) |
private void |
plotLineClipped(int argb1,
int argb2,
int x,
int y,
int z,
int dx,
int dy,
int dz,
boolean clipped,
int run,
int rise) |
(package private) void |
plotLineDelta(int argbA,
int argbB,
int xA,
int yA,
int zA,
int dxBA,
int dyBA,
int dzBA,
boolean clipped) |
(package private) void |
plotLineDeltaA(int[] shades1,
int[] shades2,
int screen,
int shadeIndex,
int x,
int y,
int z,
int dx,
int dy,
int dz,
boolean clipped) |
(package private) void |
plotLineDeltaBits(int[] shades1,
int[] shades2,
int shadeIndex,
int x,
int y,
int z,
int dx,
int dy,
int dz,
boolean clipped) |
(package private) void |
setLineBits(float dx,
float dy) |
private final Graphics3D g3d
private final Shader shader
private BS lineBits
private float slope
private boolean lineTypeX
private int nBits
private java.util.Map<java.lang.Float,BS> lineCache
private java.lang.Float slopeKey
private static final int VISIBILITY_UNCLIPPED
private static final int VISIBILITY_CLIPPED
private static final int VISIBILITY_OFFSCREEN
private int x1t
private int y1t
private int z1t
private int x2t
private int y2t
private int z2t
LineRenderer(Graphics3D g3d)
void setLineBits(float dx, float dy)
void clearLineCache()
void plotLine(int argbA, int argbB, int xA, int yA, int zA, int xB, int yB, int zB, boolean clipped)
void plotLineDelta(int argbA, int argbB, int xA, int yA, int zA, int dxBA, int dyBA, int dzBA, boolean clipped)
void plotLineDeltaA(int[] shades1, int[] shades2, int screen, int shadeIndex, int x, int y, int z, int dx, int dy, int dz, boolean clipped)
void plotLineDeltaBits(int[] shades1, int[] shades2, int shadeIndex, int x, int y, int z, int dx, int dy, int dz, boolean clipped)
void plotDashedLine(int argb, int run, int rise, int xA, int yA, int zA, int xB, int yB, int zB, boolean clipped)
private int getTrimmedLine()
Cohen-Sutherland line clipping used to check visibility.
Note that this routine is only used for visibility checking. To avoid integer rounding errors which cause cracking to occur in 'solid' surfaces, the lines are actually drawn from their original end-points. The nuance is that this algorithm doesn't just deliver a boolean. It delivers the trimmed line. Although we need to start the raster loop at the origin for good surfaces, we can save lots of time by saving the known endpoints as globals variables. -- Bob Hanson 7/06
private void plotLineClipped(int argb1, int argb2, int x, int y, int z, int dx, int dy, int dz, boolean clipped, int run, int rise)