illuminated.DiscObject Class
A circular, opaque object.
Constructor
illuminated.DiscObject
-
[options]
Parameters:
-
[options]
Object optionalOptions to be applied to this disc object.
-
[center]
illuminated.Vec2 optionalPosition of the disc object.
-
[radius]
Number optionalSize of the disc object.
-
[diffuse]
Number optionalHow diffuse this disc object should be.
-
Methods
bounds
()
Object
Calculate the boundaries of this disc object.
Returns:
cast
-
ctx
-
origin
-
bounds
Fill ctx with the shadows projected by this disc object from the origin point, constrained by the given bounds.
Parameters:
-
ctx
CanvasRenderingContext2DThe canvas context onto which the shadows will be cast.
-
origin
illuminated.Vec2A vector that represents the origin for the casted shadows.
-
bounds
ObjectAn anonymous object with the properties topleft and bottomright. The property values are illuminated.Vec2 objects representing the corners of the boundary.
contains
-
point
Determine if the given point is inside the disc.
Parameters:
-
point
illuminated.Vec2The point to be checked.
Returns:
path
-
ctx
Draw the path of the disc onto the ctx.
Parameters:
-
ctx
CanvasRenderingContext2DThe context onto which the path will be drawn.
Properties
center
Vec2
Position of the disc object.
Default: new illuminated.Vec2()
diffuse
Number
How diffuse this opaque object should be.
Default: 0.8
radius
Number
Size of the disc object.
Default: 20