UNPKG

awv3

Version:
1,295 lines 342 kB
{ "type": "File", "start": 0, "end": 1147, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 25, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 1147, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 25, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 31, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 31 } }, "specifiers": [ { "type": "ImportNamespaceSpecifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } }, "local": { "type": "Identifier", "start": 12, "end": 17, "loc": { "start": { "line": 1, "column": 12 }, "end": { "line": 1, "column": 17 }, "identifierName": "THREE" }, "name": "THREE" } } ], "source": { "type": "StringLiteral", "start": 23, "end": 30, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 30 } }, "extra": { "rawValue": "three", "raw": "'three'" }, "value": "three" } }, { "type": "ImportDeclaration", "start": 32, "end": 66, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 34 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 39, "end": 51, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 19 } }, "local": { "type": "Identifier", "start": 39, "end": 51, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 19 }, "identifierName": "BaseGraphics" }, "name": "BaseGraphics" } } ], "source": { "type": "StringLiteral", "start": 57, "end": 65, "loc": { "start": { "line": 2, "column": 25 }, "end": { "line": 2, "column": 33 } }, "extra": { "rawValue": "./base", "raw": "'./base'" }, "value": "./base" } }, { "type": "ExportDefaultDeclaration", "start": 68, "end": 1146, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 24, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 83, "end": 1146, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 24, "column": 1 } }, "id": { "type": "Identifier", "start": 89, "end": 95, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 27 }, "identifierName": "Linear" }, "name": "Linear" }, "superClass": { "type": "Identifier", "start": 104, "end": 116, "loc": { "start": { "line": 4, "column": 36 }, "end": { "line": 4, "column": 48 }, "identifierName": "BaseGraphics" }, "name": "BaseGraphics" }, "body": { "type": "ClassBody", "start": 117, "end": 1146, "loc": { "start": { "line": 4, "column": 49 }, "end": { "line": 24, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 123, "end": 184, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 7, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 123, "end": 134, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 15 }, "identifierName": "constructor" }, "name": "constructor" }, "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "RestElement", "start": 135, "end": 142, "loc": { "start": { "line": 5, "column": 16 }, "end": { "line": 5, "column": 23 } }, "argument": { "type": "Identifier", "start": 138, "end": 142, "loc": { "start": { "line": 5, "column": 19 }, "end": { "line": 5, "column": 23 }, "identifierName": "args" }, "name": "args" } } ], "body": { "type": "BlockStatement", "start": 144, "end": 184, "loc": { "start": { "line": 5, "column": 25 }, "end": { "line": 7, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 154, "end": 178, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 32 } }, "expression": { "type": "CallExpression", "start": 154, "end": 177, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 31 } }, "callee": { "type": "Super", "start": 154, "end": 159, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 13 } } }, "arguments": [ { "type": "SpreadElement", "start": 160, "end": 167, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 21 } }, "argument": { "type": "Identifier", "start": 163, "end": 167, "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 21 }, "identifierName": "args" }, "name": "args" } }, { "type": "NumericLiteral", "start": 169, "end": 170, "loc": { "start": { "line": 6, "column": 23 }, "end": { "line": 6, "column": 24 } }, "extra": { "rawValue": 4, "raw": "4" }, "value": 4 }, { "type": "NumericLiteral", "start": 172, "end": 173, "loc": { "start": { "line": 6, "column": 26 }, "end": { "line": 6, "column": 27 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 }, { "type": "NumericLiteral", "start": 175, "end": 176, "loc": { "start": { "line": 6, "column": 29 }, "end": { "line": 6, "column": 30 } }, "extra": { "rawValue": 2, "raw": "2" }, "value": 2 } ] } } ], "directives": [] } }, { "type": "ClassMethod", "start": 190, "end": 1144, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 23, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 190, "end": 205, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 19 }, "identifierName": "updateFromState" }, "name": "updateFromState" }, "static": false, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 206, "end": 211, "loc": { "start": { "line": 9, "column": 20 }, "end": { "line": 9, "column": 25 }, "identifierName": "state" }, "name": "state" }, { "type": "RestElement", "start": 213, "end": 220, "loc": { "start": { "line": 9, "column": 27 }, "end": { "line": 9, "column": 34 } }, "argument": { "type": "Identifier", "start": 216, "end": 220, "loc": { "start": { "line": 9, "column": 30 }, "end": { "line": 9, "column": 34 }, "identifierName": "args" }, "name": "args" } } ], "body": { "type": "BlockStatement", "start": 222, "end": 1144, "loc": { "start": { "line": 9, "column": 36 }, "end": { "line": 23, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 232, "end": 352, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 128 } }, "declarations": [ { "type": "VariableDeclarator", "start": 238, "end": 351, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 127 } }, "id": { "type": "ArrayPattern", "start": 238, "end": 255, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 31 } }, "elements": [ { "type": "Identifier", "start": 239, "end": 244, "loc": { "start": { "line": 10, "column": 15 }, "end": { "line": 10, "column": 20 }, "identifierName": "start" }, "name": "start" }, { "type": "Identifier", "start": 246, "end": 249, "loc": { "start": { "line": 10, "column": 22 }, "end": { "line": 10, "column": 25 }, "identifierName": "end" }, "name": "end" }, { "type": "Identifier", "start": 251, "end": 254, "loc": { "start": { "line": 10, "column": 27 }, "end": { "line": 10, "column": 30 }, "identifierName": "dim" }, "name": "dim" } ] }, "init": { "type": "CallExpression", "start": 258, "end": 351, "loc": { "start": { "line": 10, "column": 34 }, "end": { "line": 10, "column": 127 } }, "callee": { "type": "MemberExpression", "start": 258, "end": 291, "loc": { "start": { "line": 10, "column": 34 }, "end": { "line": 10, "column": 67 } }, "object": { "type": "ArrayExpression", "start": 258, "end": 287, "loc": { "start": { "line": 10, "column": 34 }, "end": { "line": 10, "column": 63 } }, "elements": [ { "type": "StringLiteral", "start": 259, "end": 268, "loc": { "start": { "line": 10, "column": 35 }, "end": { "line": 10, "column": 44 } }, "extra": { "rawValue": "startPt", "raw": "'startPt'" }, "value": "startPt" }, { "type": "StringLiteral", "start": 270, "end": 277, "loc": { "start": { "line": 10, "column": 46 }, "end": { "line": 10, "column": 53 } }, "extra": { "rawValue": "endPt", "raw": "'endPt'" }, "value": "endPt" }, { "type": "StringLiteral", "start": 279, "end": 286, "loc": { "start": { "line": 10, "column": 55 }, "end": { "line": 10, "column": 62 } }, "extra": { "rawValue": "dimPt", "raw": "'dimPt'" }, "value": "dimPt" } ] }, "property": { "type": "Identifier", "start": 288, "end": 291, "loc": { "start": { "line": 10, "column": 64 }, "end": { "line": 10, "column": 67 }, "identifierName": "map" }, "name": "map" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 292, "end": 350, "loc": { "start": { "line": 10, "column": 68 }, "end": { "line": 10, "column": 126 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 292, "end": 293, "loc": { "start": { "line": 10, "column": 68 }, "end": { "line": 10, "column": 69 }, "identifierName": "x" }, "name": "x" } ], "body": { "type": "CallExpression", "start": 297, "end": 350, "loc": { "start": { "line": 10, "column": 73 }, "end": { "line": 10, "column": 126 } }, "callee": { "type": "MemberExpression", "start": 297, "end": 326, "loc": { "start": { "line": 10, "column": 73 }, "end": { "line": 10, "column": 102 } }, "object": { "type": "NewExpression", "start": 297, "end": 316, "loc": { "start": { "line": 10, "column": 73 }, "end": { "line": 10, "column": 92 } }, "callee": { "type": "MemberExpression", "start": 301, "end": 314, "loc": { "start": { "line": 10, "column": 77 }, "end": { "line": 10, "column": 90 } }, "object": { "type": "Identifier", "start": 301, "end": 306, "loc": { "start": { "line": 10, "column": 77 }, "end": { "line": 10, "column": 82 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 307, "end": 314, "loc": { "start": { "line": 10, "column": 83 }, "end": { "line": 10, "column": 90 }, "identifierName": "Vector3" }, "name": "Vector3" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 317, "end": 326, "loc": { "start": { "line": 10, "column": 93 }, "end": { "line": 10, "column": 102 }, "identifierName": "fromArray" }, "name": "fromArray" }, "computed": false }, "arguments": [ { "type": "MemberExpression", "start": 327, "end": 349, "loc": { "start": { "line": 10, "column": 103 }, "end": { "line": 10, "column": 125 } }, "object": { "type": "MemberExpression", "start": 327, "end": 343, "loc": { "start": { "line": 10, "column": 103 }, "end": { "line": 10, "column": 119 } }, "object": { "type": "MemberExpression", "start": 327, "end": 340, "loc": { "start": { "line": 10, "column": 103 }, "end": { "line": 10, "column": 116 } }, "object": { "type": "Identifier", "start": 327, "end": 332, "loc": { "start": { "line": 10, "column": 103 }, "end": { "line": 10, "column": 108 }, "identifierName": "state" }, "name": "state" }, "property": { "type": "Identifier", "start": 333, "end": 340, "loc": { "start": { "line": 10, "column": 109 }, "end": { "line": 10, "column": 116 }, "identifierName": "members" }, "name": "members" }, "computed": false }, "property": { "type": "Identifier", "start": 341, "end": 342, "loc": { "start": { "line": 10, "column": 117 }, "end": { "line": 10, "column": 118 }, "identifierName": "x" }, "name": "x" }, "computed": true }, "property": { "type": "Identifier", "start": 344, "end": 349, "loc": { "start": { "line": 10, "column": 120 }, "end": { "line": 10, "column": 125 }, "identifierName": "value" }, "name": "value" }, "computed": false } ] } } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 361, "end": 466, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 113 } }, "declarations": [ { "type": "VariableDeclarator", "start": 365, "end": 465, "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 112 } }, "id": { "type": "Identifier", "start": 365, "end": 368, "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 15 }, "identifierName": "dir" }, "name": "dir" }, "init": { "type": "NewExpression", "start": 371, "end": 465, "loc": { "start": { "line": 11, "column": 18 }, "end": { "line": 11, "column": 112 } }, "callee": { "type": "MemberExpression", "start": 375, "end": 388, "loc": { "start": { "line": 11, "column": 22 }, "end": { "line": 11, "column": 35 } }, "object": { "type": "Identifier", "start": 375, "end": 380, "loc": { "start": { "line": 11, "column": 22 }, "end": { "line": 11, "column": 27 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 381, "end": 388, "loc": { "start": { "line": 11, "column": 28 }, "end": { "line": 11, "column": 35 }, "identifierName": "Vector3" }, "name": "Vector3" }, "computed": false }, "arguments": [ { "type": "CallExpression", "start": 389, "end": 424, "loc": { "start": { "line": 11, "column": 36 }, "end": { "line": 11, "column": 71 } }, "callee": { "type": "MemberExpression", "start": 389, "end": 397, "loc": { "start": { "line": 11, "column": 36 }, "end": { "line": 11, "column": 44 } }, "object": { "type": "Identifier", "start": 389, "end": 393, "loc": { "start": { "line": 11, "column": 36 }, "end": { "line": 11, "column": 40 }, "identifierName": "Math" }, "name": "Math" }, "property": { "type": "Identifier", "start": 394, "end": 397, "loc": { "start": { "line": 11, "column": 41 }, "end": { "line": 11, "column": 44 }, "identifierName": "cos" }, "name": "cos" }, "computed": false }, "arguments": [ { "type": "MemberExpression", "start": 398, "end": 423, "loc": { "start": { "line": 11, "column": 45 }, "end": { "line": 11, "column": 70 } }, "object": { "type": "MemberExpression", "start": 398, "end": 417, "loc": { "start": { "line": 11, "column": 45 }, "end": { "line": 11, "column": 64 } }, "object": { "type": "MemberExpression", "start": 398, "end": 411, "loc": { "start": { "line": 11, "column": 45 }, "end": { "line": 11, "column": 58 } },