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 convenience init(x: Double, y: Double, direction: Degrees)Parameters
xxcoordinate of the originyycoordinate of the origindirectionDirection 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
objectsThe 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
contextContext in which to draw
View on GitHub
DirectionalEmitter Class Reference