LinearEmitter

public class LinearEmitter : Line, Emitter

A Line that emitts evenly spaced rays parallel to its normal.

  • Visual style for the emitter’s rays

    Declaration

    Swift

    public var style: RayTraceStyle
  • Distance between each ray

    Declaration

    Swift

    public var rayStep: Double
  • Instantiate a new Line

    Declaration

    Swift

    public init(_ start: Vector, _ end: Vector, rayStep: Double)

    Parameters

    start

    Starting point

    end

    Ending point

  • Instantiate a new Line from coordinates

    Declaration

    Swift

    public init(_ x1: Double, _ y1: Double, _ x2: Double, _ y2: Double, rayStep: Double)

    Parameters

    x1

    Starting X coordinate

    y1

    Starting Y coordinate

    x2

    Ending X coordinate

    y2

    Ending Y coordinate

  • Process the ray casting operations for this emitter.

    This method calculates the paths of the emitter’s rays, but does not draw them. Any previous rays will be overwritten.

    Declaration

    Swift

    public func run(objects: [RayTracable])

    Parameters

    objects

    The objects with which the rays will interact

  • Draw the paths taken by the emitter’s rays.

    This method does not perform any ray tracing.

    Declaration

    Swift

    public func draw()