DirectionalEmitter

public class DirectionalEmitter : Emitter

An emiiter that casts a single ray at a given angle

  • The origin of the emiiter

    Declaration

    Swift

    public var origin: Vector
  • The direction of the ray to be cast

    Declaration

    Swift

    public var direction: Vector
  • Visual style for the emitter’s rays

    Declaration

    Swift

    public var style: RayTraceStyle
  • Instantiate a new emitter

    Declaration

    Swift

    public init(_ origin: Vector, _ direction: Degrees)

    Parameters

    origin

    The emitter’s origin

    direction

    Direction of the emitter’s ray

  • Instantiate a new emitter

    Declaration

    Swift

    public convenience init(x: Double, y: Double, direction: Degrees)

    Parameters

    x

    x coordinate of the origin

    y

    y coordinate of the origin

    direction

    Direction of the emitter’s ray

  • 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()
  • Draws a representation of the emitter suitable for debugging.

    Declaration

    Swift

    public func debugDraw(in context: CGContext)

    Parameters

    context

    Context in which to draw