UNPKG

oxygen-core

Version:

Oxygen game engine (Xenon Core for browsers)

1,887 lines (1,886 loc) 1.08 MB
{ "type": "File", "start": 0, "end": 7867, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 322, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 7867, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 322, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 30, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 30 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 13, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 13 } }, "local": { "type": "Identifier", "start": 7, "end": 13, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 13 }, "identifierName": "Events" }, "name": "Events" } } ], "source": { "type": "StringLiteral", "start": 19, "end": 29, "loc": { "start": { "line": 1, "column": 19 }, "end": { "line": 1, "column": 29 } }, "extra": { "rawValue": "./Events", "raw": "'./Events'" }, "value": "./Events" } }, { "type": "ImportDeclaration", "start": 32, "end": 148, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 12, "column": 21 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 44, "end": 52, "loc": { "start": { "line": 3, "column": 2 }, "end": { "line": 3, "column": 10 } }, "imported": { "type": "Identifier", "start": 44, "end": 52, "loc": { "start": { "line": 3, "column": 2 }, "end": { "line": 3, "column": 10 }, "identifierName": "glMatrix" }, "name": "glMatrix" }, "local": { "type": "Identifier", "start": 44, "end": 52, "loc": { "start": { "line": 3, "column": 2 }, "end": { "line": 3, "column": 10 }, "identifierName": "glMatrix" }, "name": "glMatrix" } }, { "type": "ImportSpecifier", "start": 57, "end": 61, "loc": { "start": { "line": 4, "column": 2 }, "end": { "line": 4, "column": 6 } }, "imported": { "type": "Identifier", "start": 57, "end": 61, "loc": { "start": { "line": 4, "column": 2 }, "end": { "line": 4, "column": 6 }, "identifierName": "mat2" }, "name": "mat2" }, "local": { "type": "Identifier", "start": 57, "end": 61, "loc": { "start": { "line": 4, "column": 2 }, "end": { "line": 4, "column": 6 }, "identifierName": "mat2" }, "name": "mat2" } }, { "type": "ImportSpecifier", "start": 66, "end": 71, "loc": { "start": { "line": 5, "column": 2 }, "end": { "line": 5, "column": 7 } }, "imported": { "type": "Identifier", "start": 66, "end": 71, "loc": { "start": { "line": 5, "column": 2 }, "end": { "line": 5, "column": 7 }, "identifierName": "mat2d" }, "name": "mat2d" }, "local": { "type": "Identifier", "start": 66, "end": 71, "loc": { "start": { "line": 5, "column": 2 }, "end": { "line": 5, "column": 7 }, "identifierName": "mat2d" }, "name": "mat2d" } }, { "type": "ImportSpecifier", "start": 76, "end": 80, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 6, "column": 6 } }, "imported": { "type": "Identifier", "start": 76, "end": 80, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 6, "column": 6 }, "identifierName": "mat3" }, "name": "mat3" }, "local": { "type": "Identifier", "start": 76, "end": 80, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 6, "column": 6 }, "identifierName": "mat3" }, "name": "mat3" } }, { "type": "ImportSpecifier", "start": 85, "end": 89, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 6 } }, "imported": { "type": "Identifier", "start": 85, "end": 89, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 6 }, "identifierName": "mat4" }, "name": "mat4" }, "local": { "type": "Identifier", "start": 85, "end": 89, "loc": { "start": { "line": 7, "column": 2 }, "end": { "line": 7, "column": 6 }, "identifierName": "mat4" }, "name": "mat4" } }, { "type": "ImportSpecifier", "start": 94, "end": 98, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 8, "column": 6 } }, "imported": { "type": "Identifier", "start": 94, "end": 98, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 8, "column": 6 }, "identifierName": "quat" }, "name": "quat" }, "local": { "type": "Identifier", "start": 94, "end": 98, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 8, "column": 6 }, "identifierName": "quat" }, "name": "quat" } }, { "type": "ImportSpecifier", "start": 103, "end": 107, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 6 } }, "imported": { "type": "Identifier", "start": 103, "end": 107, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 6 }, "identifierName": "vec2" }, "name": "vec2" }, "local": { "type": "Identifier", "start": 103, "end": 107, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 6 }, "identifierName": "vec2" }, "name": "vec2" } }, { "type": "ImportSpecifier", "start": 112, "end": 116, "loc": { "start": { "line": 10, "column": 2 }, "end": { "line": 10, "column": 6 } }, "imported": { "type": "Identifier", "start": 112, "end": 116, "loc": { "start": { "line": 10, "column": 2 }, "end": { "line": 10, "column": 6 }, "identifierName": "vec3" }, "name": "vec3" }, "local": { "type": "Identifier", "start": 112, "end": 116, "loc": { "start": { "line": 10, "column": 2 }, "end": { "line": 10, "column": 6 }, "identifierName": "vec3" }, "name": "vec3" } }, { "type": "ImportSpecifier", "start": 121, "end": 125, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 6 } }, "imported": { "type": "Identifier", "start": 121, "end": 125, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 6 }, "identifierName": "vec4" }, "name": "vec4" }, "local": { "type": "Identifier", "start": 121, "end": 125, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 6 }, "identifierName": "vec4" }, "name": "vec4" } } ], "source": { "type": "StringLiteral", "start": 134, "end": 147, "loc": { "start": { "line": 12, "column": 7 }, "end": { "line": 12, "column": 20 } }, "extra": { "rawValue": "./gl-matrix", "raw": "'./gl-matrix'" }, "value": "./gl-matrix" } }, { "type": "ImportDeclaration", "start": 150, "end": 183, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 13, "column": 33 } }, "specifiers": [ { "type": "ImportNamespaceSpecifier", "start": 157, "end": 167, "loc": { "start": { "line": 13, "column": 7 }, "end": { "line": 13, "column": 17 } }, "local": { "type": "Identifier", "start": 162, "end": 167, "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 17 }, "identifierName": "box2d" }, "name": "box2d" } } ], "source": { "type": "StringLiteral", "start": 173, "end": 182, "loc": { "start": { "line": 13, "column": 23 }, "end": { "line": 13, "column": 32 } }, "extra": { "rawValue": "./box2d", "raw": "'./box2d'" }, "value": "./box2d" } }, { "type": "ExportDefaultDeclaration", "start": 187, "end": 612, "loc": { "start": { "line": 15, "column": 0 }, "end": { "line": 40, "column": 2 } }, "declaration": { "type": "ObjectExpression", "start": 202, "end": 611, "loc": { "start": { "line": 15, "column": 15 }, "end": { "line": 40, "column": 1 } }, "properties": [ { "type": "ObjectProperty", "start": 207, "end": 213, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 16, "column": 8 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 207, "end": 213, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 16, "column": 8 }, "identifierName": "Events" }, "name": "Events" }, "value": { "type": "Identifier", "start": 207, "end": 213, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 16, "column": 8 }, "identifierName": "Events" }, "name": "Events" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 218, "end": 226, "loc": { "start": { "line": 17, "column": 2 }, "end": { "line": 17, "column": 10 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 218, "end": 226, "loc": { "start": { "line": 17, "column": 2 }, "end": { "line": 17, "column": 10 }, "identifierName": "glMatrix" }, "name": "glMatrix" }, "value": { "type": "Identifier", "start": 218, "end": 226, "loc": { "start": { "line": 17, "column": 2 }, "end": { "line": 17, "column": 10 }, "identifierName": "glMatrix" }, "name": "glMatrix" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 231, "end": 235, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 18, "column": 6 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 231, "end": 235, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 18, "column": 6 }, "identifierName": "mat2" }, "name": "mat2" }, "value": { "type": "Identifier", "start": 231, "end": 235, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 18, "column": 6 }, "identifierName": "mat2" }, "name": "mat2" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 240, "end": 245, "loc": { "start": { "line": 19, "column": 2 }, "end": { "line": 19, "column": 7 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 240, "end": 245, "loc": { "start": { "line": 19, "column": 2 }, "end": { "line": 19, "column": 7 }, "identifierName": "mat2d" }, "name": "mat2d" }, "value": { "type": "Identifier", "start": 240, "end": 245, "loc": { "start": { "line": 19, "column": 2 }, "end": { "line": 19, "column": 7 }, "identifierName": "mat2d" }, "name": "mat2d" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 250, "end": 254, "loc": { "start": { "line": 20, "column": 2 }, "end": { "line": 20, "column": 6 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 250, "end": 254, "loc": { "start": { "line": 20, "column": 2 }, "end": { "line": 20, "column": 6 }, "identifierName": "mat3" }, "name": "mat3" }, "value": { "type": "Identifier", "start": 250, "end": 254, "loc": { "start": { "line": 20, "column": 2 }, "end": { "line": 20, "column": 6 }, "identifierName": "mat3" }, "name": "mat3" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 259, "end": 263, "loc": { "start": { "line": 21, "column": 2 }, "end": { "line": 21, "column": 6 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 259, "end": 263, "loc": { "start": { "line": 21, "column": 2 }, "end": { "line": 21, "column": 6 }, "identifierName": "mat4" }, "name": "mat4" }, "value": { "type": "Identifier", "start": 259, "end": 263, "loc": { "start": { "line": 21, "column": 2 }, "end": { "line": 21, "column": 6 }, "identifierName": "mat4" }, "name": "mat4" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 268, "end": 272, "loc": { "start": { "line": 22, "column": 2 }, "end": { "line": 22, "column": 6 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 268, "end": 272, "loc": { "start": { "line": 22, "column": 2 }, "end": { "line": 22, "column": 6 }, "identifierName": "quat" }, "name": "quat" }, "value": { "type": "Identifier", "start": 268, "end": 272, "loc": { "start": { "line": 22, "column": 2 }, "end": { "line": 22, "column": 6 }, "identifierName": "quat" }, "name": "quat" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 277, "end": 281, "loc": { "start": { "line": 23, "column": 2 }, "end": { "line": 23, "column": 6 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 277, "end": 281, "loc": { "start": { "line": 23, "column": 2 }, "end": { "line": 23, "column": 6 }, "identifierName": "vec2" }, "name": "vec2" }, "value": { "type": "Identifier", "start": 277, "end": 281, "loc": { "start": { "line": 23, "column": 2 }, "end": { "line": 23, "column": 6 }, "identifierName": "vec2" }, "name": "vec2" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 286, "end": 290, "loc": { "start": { "line": 24, "column": 2 }, "end": { "line": 24, "column": 6 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 286, "end": 290, "loc": { "start": { "line": 24, "column": 2 }, "end": { "line": 24, "column": 6 }, "identifierName": "vec3" }, "name": "vec3" }, "value": { "type": "Identifier", "start": 286, "end": 290, "loc": { "start": { "line": 24, "column": 2 }, "end": { "line": 24, "column": 6 }, "identifierName": "vec3" }, "name": "vec3" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 295, "end": 299, "loc": { "start": { "line": 25, "column": 2 }, "end": { "line": 25, "column": 6 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 295, "end": 299, "loc": { "start": { "line": 25, "column": 2 }, "end": { "line": 25, "column": 6 }, "identifierName": "vec4" }, "name": "vec4" }, "value": { "type": "Identifier", "start": 295, "end": 299, "loc": { "start": { "line": 25, "column": 2 }, "end": { "line": 25, "column": 6 }, "identifierName": "vec4" }, "name": "vec4" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 304, "end": 309, "loc": { "start": { "line": 26, "column": 2 }, "end": { "line": 26, "column": 7 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 304, "end": 309, "loc": { "start": { "line": 26, "column": 2 }, "end": { "line": 26, "column": 7 }, "identifierName": "box2d" }, "name": "box2d" }, "value": { "type": "Identifier", "start": 304, "end": 309, "loc": { "start": { "line": 26, "column": 2 }, "end": { "line": 26, "column": 7 }, "identifierName": "box2d" }, "name": "box2d" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 314, "end": 331, "loc": { "start": { "line": 27, "column": 2 }, "end": { "line": 27, "column": 19 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 314, "end": 331, "loc": { "start": { "line": 27, "column": 2 }, "end": { "line": 27, "column": 19 }, "identifierName": "findMapKeyOfValue" }, "name": "findMapKeyOfValue" }, "value": { "type": "Identifier", "start": 314, "end": 331, "loc": { "start": { "line": 27, "column": 2 }, "end": { "line": 27, "column": 19 }, "identifierName": "findMapKeyOfValue" }, "name": "findMapKeyOfValue" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 336, "end": 350, "loc": { "start": { "line": 28, "column": 2 }, "end": { "line": 28, "column": 16 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 336, "end": 350, "loc": { "start": { "line": 28, "column": 2 }, "end": { "line": 28, "column": 16 }, "identifierName": "waitForSeconds" }, "name": "waitForSeconds" }, "value": { "type": "Identifier", "start": 336, "end": 350, "loc": { "start": { "line": 28, "column": 2 }, "end": { "line": 28, "column": 16 }, "identifierName": "waitForSeconds" }, "name": "waitForSeconds" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 355, "end": 367, "loc": { "start": { "line": 29, "column": 2 }, "end": { "line": 29, "column": 14 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 355, "end": 367, "loc": { "start": { "line": 29, "column": 2 }, "end": { "line": 29, "column": 14 }, "identifierName": "stringToRGBA" }, "name": "stringToRGBA" }, "value": { "type": "Identifier", "start": 355, "end": 367, "loc": { "start": { "line": 29, "column": 2 }, "end": { "line": 29, "column": 14 }, "identifierName": "stringToRGBA" }, "name": "stringToRGBA" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 372, "end": 390, "loc": { "start": { "line": 30, "column": 2 }, "end": { "line": 30, "column": 20 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 372, "end": 390, "loc": { "start": { "line": 30, "column": 2 }, "end": { "line": 30, "column": 20 }, "identifierName": "propsEnumStringify" }, "name": "propsEnumStringify" }, "value": { "type": "Identifier", "start": 372, "end": 390, "loc": { "start": { "line": 30, "column": 2 }, "end": { "line": 30, "column": 20 }, "identifierName": "propsEnumStringify" }, "name": "propsEnumStringify" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 395, "end": 410, "loc": { "start": { "line": 31, "column": 2 }, "end": { "line": 31, "column": 17 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 395, "end": 410, "loc": { "start": { "line": 31, "column": 2 }, "end": { "line": 31, "column": 17 }, "identifierName": "angleDifference" }, "name": "angleDifference" }, "value": { "type": "Identifier", "start": 395, "end": 410, "loc": { "start": { "line": 31, "column": 2 }, "end": { "line": 31, "column": 17 }, "identifierName": "angleDifference" }, "name": "angleDifference" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 415, "end": 445, "loc": { "start": { "line": 32, "column": 2 }, "end": { "line": 32, "column": 32 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 415, "end": 445, "loc": { "start": { "line": 32, "column": 2 }, "end": { "line": 32, "column": 32 }, "identifierName": "convertGlobalPointToLocalPoint" }, "name": "convertGlobalPointToLocalPoint" }, "value": { "type": "Identifier", "start": 415, "end": 445, "loc": { "start": { "line": 32, "column": 2 }, "end": { "line": 32, "column": 32 }, "identifierName": "convertGlobalPointToLocalPoint" }, "name": "convertGlobalPointToLocalPoint" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 450, "end": 480, "loc": { "start": { "line": 33, "column": 2 }, "end": { "line": 33, "column": 32 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 450, "end": 480, "loc": { "start": { "line": 33, "column": 2 }, "end": { "line": 33, "column": 32 }, "identifierName": "convertLocalPointToGlobalPoint" }, "name": "convertLocalPointToGlobalPoint" }, "value": { "type": "Identifier", "start": 450, "end": 480, "loc": { "start": { "line": 33, "column": 2 }, "end": { "line": 33, "column": 32 }, "identifierName": "convertLocalPointToGlobalPoint" }, "name": "convertLocalPointToGlobalPoint" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 485, "end": 517, "loc": { "start": { "line": 34, "column": 2 }, "end": { "line": 34, "column": 34 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 485, "end": 517, "loc": { "start": { "line": 34, "column": 2 }, "end": { "line": 34, "column": 34 }, "identifierName": "isGlobalPointInGlobalBoundingBox" }, "name": "isGlobalPointInGlobalBoundingBox" }, "value": { "type": "Identifier", "start": 485, "end": 517, "loc": { "start": { "line": 34, "column": 2 }, "end": { "line": 34, "column": 34 }, "identifierName": "isGlobalPointInGlobalBoundingBox" }, "name": "isGlobalPointInGlobalBoundingBox" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 522, "end": 552, "loc": { "start": { "line": 35, "column": 2 }, "end": { "line": 35, "column": 32 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 522, "end": 552, "loc": { "start": { "line": 35, "column": 2 }, "end": { "line": 35, "column": 32 }, "identifierName": "isLocalPointInLocalBoundingBox" }, "name": "isLocalPointInLocalBoundingBox" }, "value": { "type": "Identifier", "start": 522, "end": 552, "loc": { "start": { "line": 35, "column": 2 }, "end": { "line": 35, "column": 32 }, "identifierName": "isLocalPointInLocalBoundingBox" }, "name": "isLocalPointInLocalBoundingBox" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 557, "end": 568, "loc": { "start": { "line": 36, "column": 2 }, "end": { "line": 36, "column": 13 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 557, "end": 568, "loc": { "start": { "line": 36, "column": 2 }, "end": { "line": 36, "column": 13 }, "identifierName": "bezierCubic" }, "name": "bezierCubic" }, "value": { "type": "Identifier", "start": 557, "end": 568, "loc": { "start": { "line": 36, "column": 2 }, "end": { "line": 36, "column": 13 }, "identifierName": "bezierCubic" }, "name": "bezierCubic" }, "extra": { "shorthand": true } }, { "type": "ObjectProperty", "start": 573, "end": 578, "loc": { "start": { "line": 37, "column": 2 }, "end": { "line": 37, "column": 7 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 573, "end": 578, "loc": { "start": { "line": 37, "column": 2 }, "end": { "line": 37, "column": 7 }, "identifierName": "isPOT" }, "name": "isPOT" }, "value": { "type": "Identifier", "start": 573, "end": 578, "loc": { "start": { "line": 37, "column": 2 }, "end": { "line": 37, "column": 7 }, "identifierName": "isPOT" }, "name": "isPOT" }, "extra": { "shorthand": true } }, {