public struct Ray
A ray in a raycasting process.

Constructors

Ray

#
public Ray(double x, double y, int index)
Create a new ray. Use the Create() method if you're unsure whether x and y are within legal bounds.
x (double)X coordinate. Ideally the x-coordinate is within the [int.MinValue, int.MaxValue] range.
y (double)Y coordinate. Ideally the y-coordinate is within the [int.MinValue, int.MaxValue] range.
index (int)Start of ray as specified by the index within the object stack.

Properties

Index

#
public int Index { get; }
Gets the layer index at which the ray originates.

ParamX

#
public double ParamX { get; }
Gets the normalised parameter horizontally along the pixel.

ParamY

#
public double ParamY { get; }
Gets the normalised parameter vertically along the pixel.

PixelX

#
public int PixelX { get; }
Gets the pixel x index.

PixelY

#
public int PixelY { get; }
Gets the pixel y index.

X

#
public double X { get; }
Gets the floating point accurate x-coordinate of the ray in the image coordinate system.

Y

#
public double Y { get; }
Gets the floating point accurate y-coordinate of the ray in the image coordinate system.

Methods

Continue

#
public Ray Continue()
Continue this ray along its current direction.
Continued ray.

Nudge

#
public Ray Nudge(double du, double dv)
Nudge this ray without changing its level.
du (double)Nudge amount in x.
dv (double)Nurde amount in y.
Nudged ray.

NudgeAndContinue

#
public Ray NudgeAndContinue(double du, double dv)
Create a ray positioned relative to this ray and one level deeper.
du (double)X offset.
dv (double)Y offset.
Nudged ray.

Transport

#
public Ray Transport(int index)
Transport this ray to a new originating layer.
index (int)New originating layer index.
Transported ray.