When an object is created, properties are set to default values. BasicCreator.prototype.paths is set to a list of cubic Bezier curves for each joint orbit.
A cubic Bezier curve has four coordinates: a start point, an end point, and corresponding control points. For example, in the orbit of the right hand "catch-to-throw" has (-90, 10), (-90, 37), (-30, 37), and (-30, 10). A total of 8 Bezier curves (SVGPathElement objects representing them) are set as shown in the table below.
| arm | direction | joint | orbit overview |
|---|---|---|---|
| right | catch-to-throw | hand | bottom half of large ellipse from right to left |
| elbow | bottom half of small ellipse from right to left | ||
| throw-to-catch | hand | top half of large ellipse from left to right | |
| elbow | top half of small ellipse from left to right | ||
| left | catch-to-throw | hand | bottom half of large ellipse from left to right |
| elbow | bottom half of small ellipse from left to right | ||
| throw-to-catch | hand | top half of large ellipse from right to left | |
| elbow | top half of small ellipse from right to left |
Note that these are approximate representations of ellipses, not exact ellipses.
Syntax
new BasicCreator()
Parameters
none
Examples
const creator = new jmotion.BasicCreator();
// creator = {
// "offset": {
// "left": { "x": 0, "y": -10 },
// "right": { "x": 0, "y": -10 },
// },
// "paths": {
// "left": [
// [ path, path ],
// [ path, path ],
// ],
// "right": [
// [ path, path ],
// [ path, path ],
// ],
// },
// }