Constructor
new ConstraintRenderer(solver, context)
Parameters:
Name | Type | Description |
---|---|---|
solver | Solver | |
context | context | the HTMLCanvas context |
Methods
draw(c)
Draws a single constraint
Parameters:
Name | Type | Description |
---|---|---|
c | Constraint |
renderFrame()
Renders the constraints per frame
(static) calculateStressColor(c, maxForce, min, sensitivity) → {string}
Parameters:
Name | Type | Default | Description |
---|---|---|---|
c | Constraint | ||
maxForce | Number | maximum force magnitude | |
min | Number | 0 | minimum force magnitude |
sensitivity | Number | 2 | colour change sensitivity |
Returns:
a string in the HTML RGB color format
- Type:
- string