Class

Stick

Stick(p1, p2, lengthopt, stiffnessopt, hiddenopt)

Constructor

new Stick(p1, p2, lengthopt, stiffnessopt, hiddenopt)

creates a stick between two Point takes optional length and stiffness
Parameters:
Name Type Attributes Description
p1 Point
p2 Point
length number <optional>
stiffness number <optional>
hidden boolean <optional>

View Source Stick.js, line 11

Methods

render(ctx)

Parameters:
Name Type Description
ctx CanvasRenderingContext2D

View Source Stick.js, line 131

setColor(color) → {Stick}

Parameters:
Name Type Description
color string

View Source Stick.js, line 95

Stick

setHidden(value) → {Stick}

Parameters:
Name Type Description
value boolean

View Source Stick.js, line 122

Stick

setLength(length) → {Stick}

Parameters:
Name Type Description
length number

View Source Stick.js, line 104

Stick

setStiffness(value) → {Stick}

Parameters:
Name Type Description
value number

View Source Stick.js, line 113

Stick

update(stepCoefopt)

Parameters:
Name Type Attributes Description
stepCoef number <optional>

View Source Stick.js, line 30