UNPKG

awv3

Version:
1,384 lines (1,383 loc) 692 kB
{ "type": "File", "start": 0, "end": 2831, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 75, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 2831, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 75, "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" }, "trailingComments": [ { "type": "CommentBlock", "value": "* A heads up display that renders a separate scene. ", "start": 33, "end": 89, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 56 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 90, "end": 2830, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 74, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 105, "end": 2830, "loc": { "start": { "line": 4, "column": 15 }, "end": { "line": 74, "column": 1 } }, "id": { "type": "Identifier", "start": 111, "end": 114, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 24 }, "identifierName": "Hud" }, "name": "Hud", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 115, "end": 2830, "loc": { "start": { "line": 4, "column": 25 }, "end": { "line": 74, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 121, "end": 790, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 22, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 121, "end": 132, "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": "Identifier", "start": 133, "end": 137, "loc": { "start": { "line": 5, "column": 16 }, "end": { "line": 5, "column": 20 }, "identifierName": "view" }, "name": "view" } ], "body": { "type": "BlockStatement", "start": 139, "end": 790, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 22, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 149, "end": 169, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 28 } }, "expression": { "type": "AssignmentExpression", "start": 149, "end": 168, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 27 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 149, "end": 161, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 20 } }, "object": { "type": "ThisExpression", "start": 149, "end": 153, "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 12 } } }, "property": { "type": "Identifier", "start": 154, "end": 161, "loc": { "start": { "line": 6, "column": 13 }, "end": { "line": 6, "column": 20 }, "identifierName": "enabled" }, "name": "enabled" }, "computed": false }, "right": { "type": "BooleanLiteral", "start": 164, "end": 168, "loc": { "start": { "line": 6, "column": 23 }, "end": { "line": 6, "column": 27 } }, "value": true } } }, { "type": "ExpressionStatement", "start": 178, "end": 195, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 25 } }, "expression": { "type": "AssignmentExpression", "start": 178, "end": 194, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 24 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 178, "end": 187, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 17 } }, "object": { "type": "ThisExpression", "start": 178, "end": 182, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 12 } } }, "property": { "type": "Identifier", "start": 183, "end": 187, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 17 }, "identifierName": "view" }, "name": "view" }, "computed": false }, "right": { "type": "Identifier", "start": 190, "end": 194, "loc": { "start": { "line": 7, "column": 20 }, "end": { "line": 7, "column": 24 }, "identifierName": "view" }, "name": "view" } } }, { "type": "ExpressionStatement", "start": 204, "end": 234, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 38 } }, "expression": { "type": "AssignmentExpression", "start": 204, "end": 233, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 37 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 204, "end": 217, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 21 } }, "object": { "type": "ThisExpression", "start": 204, "end": 208, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 12 } } }, "property": { "type": "Identifier", "start": 209, "end": 217, "loc": { "start": { "line": 8, "column": 13 }, "end": { "line": 8, "column": 21 }, "identifierName": "renderer" }, "name": "renderer" }, "computed": false }, "right": { "type": "MemberExpression", "start": 220, "end": 233, "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 37 } }, "object": { "type": "Identifier", "start": 220, "end": 224, "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 28 }, "identifierName": "view" }, "name": "view" }, "property": { "type": "Identifier", "start": 225, "end": 233, "loc": { "start": { "line": 8, "column": 29 }, "end": { "line": 8, "column": 37 }, "identifierName": "renderer" }, "name": "renderer" }, "computed": false } } }, { "type": "ExpressionStatement", "start": 243, "end": 274, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 39 } }, "expression": { "type": "AssignmentExpression", "start": 243, "end": 273, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 38 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 243, "end": 253, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 18 } }, "object": { "type": "ThisExpression", "start": 243, "end": 247, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 12 } } }, "property": { "type": "Identifier", "start": 248, "end": 253, "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 18 }, "identifierName": "scene" }, "name": "scene" }, "computed": false }, "right": { "type": "NewExpression", "start": 256, "end": 273, "loc": { "start": { "line": 9, "column": 21 }, "end": { "line": 9, "column": 38 } }, "callee": { "type": "MemberExpression", "start": 260, "end": 271, "loc": { "start": { "line": 9, "column": 25 }, "end": { "line": 9, "column": 36 } }, "object": { "type": "Identifier", "start": 260, "end": 265, "loc": { "start": { "line": 9, "column": 25 }, "end": { "line": 9, "column": 30 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 266, "end": 271, "loc": { "start": { "line": 9, "column": 31 }, "end": { "line": 9, "column": 36 }, "identifierName": "Scene" }, "name": "Scene" }, "computed": false }, "arguments": [] } } }, { "type": "ExpressionStatement", "start": 283, "end": 315, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 40 } }, "expression": { "type": "AssignmentExpression", "start": 283, "end": 314, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 39 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 283, "end": 300, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 25 } }, "object": { "type": "MemberExpression", "start": 283, "end": 293, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 18 } }, "object": { "type": "ThisExpression", "start": 283, "end": 287, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 12 } } }, "property": { "type": "Identifier", "start": 288, "end": 293, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 18 }, "identifierName": "scene" }, "name": "scene" }, "computed": false }, "property": { "type": "Identifier", "start": 294, "end": 300, "loc": { "start": { "line": 10, "column": 19 }, "end": { "line": 10, "column": 25 }, "identifierName": "canvas" }, "name": "canvas" }, "computed": false }, "right": { "type": "MemberExpression", "start": 303, "end": 314, "loc": { "start": { "line": 10, "column": 28 }, "end": { "line": 10, "column": 39 } }, "object": { "type": "Identifier", "start": 303, "end": 307, "loc": { "start": { "line": 10, "column": 28 }, "end": { "line": 10, "column": 32 }, "identifierName": "view" }, "name": "view" }, "property": { "type": "Identifier", "start": 308, "end": 314, "loc": { "start": { "line": 10, "column": 33 }, "end": { "line": 10, "column": 39 }, "identifierName": "canvas" }, "name": "canvas" }, "computed": false } } }, { "type": "ExpressionStatement", "start": 324, "end": 347, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 31 } }, "expression": { "type": "AssignmentExpression", "start": 324, "end": 346, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 30 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 324, "end": 339, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 23 } }, "object": { "type": "MemberExpression", "start": 324, "end": 334, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 18 } }, "object": { "type": "ThisExpression", "start": 324, "end": 328, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 12 } } }, "property": { "type": "Identifier", "start": 329, "end": 334, "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 18 }, "identifierName": "scene" }, "name": "scene" }, "computed": false }, "property": { "type": "Identifier", "start": 335, "end": 339, "loc": { "start": { "line": 11, "column": 19 }, "end": { "line": 11, "column": 23 }, "identifierName": "view" }, "name": "view" }, "computed": false }, "right": { "type": "Identifier", "start": 342, "end": 346, "loc": { "start": { "line": 11, "column": 26 }, "end": { "line": 11, "column": 30 }, "identifierName": "view" }, "name": "view" } } }, { "type": "ExpressionStatement", "start": 356, "end": 380, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 32 } }, "expression": { "type": "AssignmentExpression", "start": 356, "end": 379, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 31 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 356, "end": 367, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 19 } }, "object": { "type": "ThisExpression", "start": 356, "end": 360, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 12 } } }, "property": { "type": "Identifier", "start": 361, "end": 367, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 19 }, "identifierName": "camera" }, "name": "camera" }, "computed": false }, "right": { "type": "Identifier", "start": 370, "end": 379, "loc": { "start": { "line": 12, "column": 22 }, "end": { "line": 12, "column": 31 }, "identifierName": "undefined" }, "name": "undefined" } } }, { "type": "ExpressionStatement", "start": 389, "end": 415, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 34 } }, "expression": { "type": "AssignmentExpression", "start": 389, "end": 414, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 33 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 389, "end": 402, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 21 } }, "object": { "type": "ThisExpression", "start": 389, "end": 393, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 12 } } }, "property": { "type": "Identifier", "start": 394, "end": 402, "loc": { "start": { "line": 13, "column": 13 }, "end": { "line": 13, "column": 21 }, "identifierName": "controls" }, "name": "controls" }, "computed": false }, "right": { "type": "Identifier", "start": 405, "end": 414, "loc": { "start": { "line": 13, "column": 24 }, "end": { "line": 13, "column": 33 }, "identifierName": "undefined" }, "name": "undefined" } } }, { "type": "ExpressionStatement", "start": 425, "end": 529, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 112 } }, "expression": { "type": "AssignmentExpression", "start": 425, "end": 528, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 111 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 425, "end": 437, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 20 } }, "object": { "type": "ThisExpression", "start": 425, "end": 429, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 12 } } }, "property": { "type": "Identifier", "start": 430, "end": 437, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 20 }, "identifierName": "ambient" }, "name": "ambient" }, "computed": false }, "right": { "type": "NewExpression", "start": 440, "end": 528, "loc": { "start": { "line": 15, "column": 23 }, "end": { "line": 15, "column": 111 } }, "callee": { "type": "MemberExpression", "start": 444, "end": 462, "loc": { "start": { "line": 15, "column": 27 }, "end": { "line": 15, "column": 45 } }, "object": { "type": "Identifier", "start": 444, "end": 449, "loc": { "start": { "line": 15, "column": 27 }, "end": { "line": 15, "column": 32 }, "identifierName": "THREE" }, "name": "THREE" }, "property": { "type": "Identifier", "start": 450, "end": 462, "loc": { "start": { "line": 15, "column": 33 }, "end": { "line": 15, "column": 45 }, "identifierName": "AmbientLight" }, "name": "AmbientLight" }, "computed": false }, "arguments": [ { "type": "ConditionalExpression", "start": 463, "end": 527, "loc": { "start": { "line": 15, "column": 46 }, "end": { "line": 15, "column": 110 } }, "test": { "type": "MemberExpression", "start": 463, "end": 488, "loc": { "start": { "line": 15, "column": 46 }, "end": { "line": 15, "column": 71 } }, "object": { "type": "MemberExpression", "start": 463, "end": 475, "loc": { "start": { "line": 15, "column": 46 }, "end": { "line": 15, "column": 58 } },