diff --git a/fission/README.md b/fission/README.md index a2fae7aefe..2d8d0f3891 100644 --- a/fission/README.md +++ b/fission/README.md @@ -35,8 +35,8 @@ npm i | `lint` | Runs eslint on the project. | | `lint:fix` | Attempts to fix issues found with eslint. | | `prettier` | Runs prettier on the project as a check. | -| `prettier:fix` | Runs prettier on the project to fix any issues with formating. **DO NOT USE**, I don't like the current format it uses. | -| `format` | Runs `prettier:fix` and `lint:fix`. **Do not use** for the same reasons as `prettier:fix`. | +| `prettier:fix` | Runs prettier on the project to fix any issues with formating. | +| `format` | Runs `prettier:fix` and `lint:fix`. | | `assetpack` | Downloads the assetpack and unzips/installs it in the correct location. | ### Autodesk Platform Services diff --git a/fission/bun.lockb b/fission/bun.lockb index 8ca9f4a4ab..e8363f113e 100755 Binary files a/fission/bun.lockb and b/fission/bun.lockb differ diff --git a/fission/package-lock.json b/fission/package-lock.json index 779dc7dd15..df1f06cede 100644 --- a/fission/package-lock.json +++ b/fission/package-lock.json @@ -9,6 +9,9 @@ "version": "0.0.1", "dependencies": { "@barclah/jolt-physics": "^0.19.3", + "@mui/base": "^5.0.0-beta.40", + "@mui/icons-material": "^5.15.20", + "@mui/system": "^5.15.20", "@react-three/drei": "^9.96.5", "@react-three/fiber": "^8.15.15", "@vitest/coverage-v8": "^1.6.0", @@ -85,7 +88,7 @@ "version": "7.24.6", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.6.tgz", "integrity": "sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/highlight": "^7.24.6", "picocolors": "^1.0.0" @@ -226,7 +229,7 @@ "version": "7.24.6", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.6.tgz", "integrity": "sha512-a26dmxFJBF62rRO9mmpgrfTLsAuyHk4e1hKTUkD/fcMfynt8gvEKwQPQDVxWhca8dHoDck+55DFt42zV0QMw5g==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/types": "^7.24.6" }, @@ -328,7 +331,7 @@ "version": "7.24.6", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.6.tgz", "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/helper-validator-identifier": "^7.24.6", "chalk": "^2.4.2", @@ -454,7 +457,7 @@ "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", "integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/helper-module-imports": "^7.16.7", "@babel/runtime": "^7.18.3", @@ -473,7 +476,6 @@ "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==", - "dev": true, "dependencies": { "@emotion/memoize": "^0.8.1", "@emotion/sheet": "^1.2.2", @@ -486,13 +488,13 @@ "version": "0.9.1", "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==", - "dev": true + "devOptional": true }, "node_modules/@emotion/is-prop-valid": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", "integrity": "sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==", - "dev": true, + "devOptional": true, "dependencies": { "@emotion/memoize": "^0.8.1" } @@ -500,14 +502,13 @@ "node_modules/@emotion/memoize": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", - "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==", - "dev": true + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" }, "node_modules/@emotion/react": { "version": "11.11.4", "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.4.tgz", "integrity": "sha512-t8AjMlF0gHpvvxk5mAtCqR4vmxiGHCeJBaQO6gncUSdklELOgtwjerNY2yuJNfwnc6vi16U/+uMF+afIawJ9iw==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", @@ -531,7 +532,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.4.tgz", "integrity": "sha512-RIN04MBT8g+FnDwgvIUi8czvr1LU1alUMI05LekWB5DGyTm8cCBMCRpq3GqaiyEDRptEXOyXnvZ58GZYu4kBxQ==", - "dev": true, + "devOptional": true, "dependencies": { "@emotion/hash": "^0.9.1", "@emotion/memoize": "^0.8.1", @@ -543,14 +544,13 @@ "node_modules/@emotion/sheet": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz", - "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==", - "dev": true + "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==" }, "node_modules/@emotion/styled": { "version": "11.11.5", "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.11.5.tgz", "integrity": "sha512-/ZjjnaNKvuMPxcIiUkf/9SHoG4Q196DRl1w82hQ3WCsjo1IUR8uaGWrC6a87CrYAW0Kb/pK7hk8BnLgLRi9KoQ==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", @@ -573,13 +573,13 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==", - "dev": true + "devOptional": true }, "node_modules/@emotion/use-insertion-effect-with-fallbacks": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.1.tgz", "integrity": "sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==", - "dev": true, + "devOptional": true, "peerDependencies": { "react": ">=16.8.0" } @@ -587,14 +587,12 @@ "node_modules/@emotion/utils": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz", - "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==", - "dev": true + "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==" }, "node_modules/@emotion/weak-memoize": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz", - "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==", - "dev": true + "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.2", @@ -1038,7 +1036,6 @@ "version": "1.6.2", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.2.tgz", "integrity": "sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==", - "dev": true, "dependencies": { "@floating-ui/utils": "^0.2.0" } @@ -1047,7 +1044,6 @@ "version": "1.6.5", "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.5.tgz", "integrity": "sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==", - "dev": true, "dependencies": { "@floating-ui/core": "^1.0.0", "@floating-ui/utils": "^0.2.0" @@ -1057,7 +1053,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.0.tgz", "integrity": "sha512-lNzj5EQmEKn5FFKc04+zasr09h/uX8RtJRNj5gUXsSQIXHVWTVh+hVAg1vOMCexkX8EgvemMvIFpQfkosnVNyA==", - "dev": true, "dependencies": { "@floating-ui/dom": "^1.0.0" }, @@ -1069,8 +1064,7 @@ "node_modules/@floating-ui/utils": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.2.tgz", - "integrity": "sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==", - "dev": true + "integrity": "sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==" }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", @@ -1266,7 +1260,6 @@ "version": "5.0.0-beta.40", "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.40.tgz", "integrity": "sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==", - "dev": true, "dependencies": { "@babel/runtime": "^7.23.9", "@floating-ui/react-dom": "^2.0.8", @@ -1298,17 +1291,41 @@ "version": "5.15.18", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.18.tgz", "integrity": "sha512-/9pVk+Al8qxAjwFUADv4BRZgMpZM4m5E+2Q/20qhVPuIJWqKp4Ie4tGExac6zu93rgPTYVQGgu+1vjiT0E+cEw==", - "dev": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" } }, + "node_modules/@mui/icons-material": { + "version": "5.15.20", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.15.20.tgz", + "integrity": "sha512-oGcKmCuHaYbAAoLN67WKSXtHmEgyWcJToT1uRtmPyxMj9N5uqwc/mRtEnst4Wj/eGr+zYH2FiZQ79v9k7kSk1Q==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.9" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@mui/material": "^5.0.0", + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/@mui/material": { "version": "5.15.18", "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.15.18.tgz", "integrity": "sha512-n+/dsiqux74fFfcRUJjok+ieNQ7+BEk6/OwX9cLcLvriZrZb+/7Y8+Fd2HlUUbn5N0CDurgAHm0VH1DqyJ9HAw==", - "dev": true, "dependencies": { "@babel/runtime": "^7.23.9", "@mui/base": "5.0.0-beta.40", @@ -1350,13 +1367,13 @@ } }, "node_modules/@mui/private-theming": { - "version": "5.15.14", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.15.14.tgz", - "integrity": "sha512-UH0EiZckOWcxiXLX3Jbb0K7rC8mxTr9L9l6QhOZxYc4r8FHUkefltV9VDGLrzCaWh30SQiJvAEd7djX3XXY6Xw==", - "dev": true, + "version": "5.15.20", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.15.20.tgz", + "integrity": "sha512-BK8F94AIqSrnaPYXf2KAOjGZJgWfvqAVQ2gVR3EryvQFtuBnG6RwodxrCvd3B48VuMy6Wsk897+lQMUxJyk+6g==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", - "@mui/utils": "^5.15.14", + "@mui/utils": "^5.15.20", "prop-types": "^15.8.1" }, "engines": { @@ -1380,7 +1397,6 @@ "version": "5.15.14", "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.15.14.tgz", "integrity": "sha512-RILkuVD8gY6PvjZjqnWhz8fu68dVkqhM5+jYWfB5yhlSQKg+2rHkmEwm75XIeAqI3qwOndK6zELK5H6Zxn4NHw==", - "dev": true, "dependencies": { "@babel/runtime": "^7.23.9", "@emotion/cache": "^11.11.0", @@ -1409,16 +1425,16 @@ } }, "node_modules/@mui/system": { - "version": "5.15.15", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.15.15.tgz", - "integrity": "sha512-aulox6N1dnu5PABsfxVGOZffDVmlxPOVgj56HrUnJE8MCSh8lOvvkd47cebIVQQYAjpwieXQXiDPj5pwM40jTQ==", - "dev": true, + "version": "5.15.20", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.15.20.tgz", + "integrity": "sha512-LoMq4IlAAhxzL2VNUDBTQxAb4chnBe8JvRINVNDiMtHE2PiPOoHlhOPutSxEbaL5mkECPVWSv6p8JEV+uykwIA==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", - "@mui/private-theming": "^5.15.14", + "@mui/private-theming": "^5.15.20", "@mui/styled-engine": "^5.15.14", "@mui/types": "^7.2.14", - "@mui/utils": "^5.15.14", + "@mui/utils": "^5.15.20", "clsx": "^2.1.0", "csstype": "^3.1.3", "prop-types": "^15.8.1" @@ -1452,7 +1468,6 @@ "version": "7.2.14", "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.14.tgz", "integrity": "sha512-MZsBZ4q4HfzBsywtXgM1Ksj6HDThtiwmOKUXH1pKYISI9gAVXCNHNpo7TlGoGrBaYWZTdNoirIN7JsQcQUjmQQ==", - "dev": true, "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0" }, @@ -1463,10 +1478,10 @@ } }, "node_modules/@mui/utils": { - "version": "5.15.14", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.14.tgz", - "integrity": "sha512-0lF/7Hh/ezDv5X7Pry6enMsbYyGKjADzvHyo3Qrc/SSlTsQ1VkbDMbH0m2t3OR5iIVLwMoxwM7yGd+6FCMtTFA==", - "dev": true, + "version": "5.15.20", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.20.tgz", + "integrity": "sha512-mAbYx0sovrnpAu1zHc3MDIhPqL8RPVC5W5xcO1b7PiSCJPtckIZmBkp8hefamAvUiAV8gpfMOM6Zb+eSisbI2A==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.9", "@types/prop-types": "^15.7.11", @@ -1539,7 +1554,6 @@ "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "dev": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -2294,7 +2308,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==", - "dev": true + "devOptional": true }, "node_modules/@types/prop-types": { "version": "15.7.12", @@ -2331,7 +2345,6 @@ "version": "4.4.10", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", "integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==", - "dev": true, "dependencies": { "@types/react": "*" } @@ -2781,7 +2794,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "devOptional": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -3030,7 +3043,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/runtime": "^7.12.5", "cosmiconfig": "^7.0.0", @@ -3205,7 +3218,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, + "devOptional": true, "engines": { "node": ">=6" } @@ -3292,7 +3305,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, + "devOptional": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -3306,7 +3319,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.8.0" } @@ -3362,7 +3375,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "dev": true, "engines": { "node": ">=6" } @@ -3371,7 +3383,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, + "devOptional": true, "dependencies": { "color-name": "1.1.3" } @@ -3380,7 +3392,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "devOptional": true }, "node_modules/colord": { "version": "2.9.3", @@ -3423,13 +3435,13 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true + "devOptional": true }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", - "dev": true, + "devOptional": true, "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", @@ -3885,7 +3897,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", - "dev": true, "dependencies": { "@babel/runtime": "^7.8.7", "csstype": "^3.0.2" @@ -3985,7 +3996,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, + "devOptional": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -4180,7 +4191,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=10" }, @@ -4870,7 +4881,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", - "dev": true + "devOptional": true }, "node_modules/find-up": { "version": "5.0.0", @@ -5022,7 +5033,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, + "devOptional": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5256,7 +5267,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, + "devOptional": true, "engines": { "node": ">=4" } @@ -5320,7 +5331,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, + "devOptional": true, "dependencies": { "function-bind": "^1.1.2" }, @@ -5337,7 +5348,7 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, + "devOptional": true, "dependencies": { "react-is": "^16.7.0" } @@ -5346,7 +5357,7 @@ "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true + "devOptional": true }, "node_modules/html-encoding-sniffer": { "version": "4.0.0", @@ -5453,7 +5464,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, + "devOptional": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -5525,7 +5536,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true + "devOptional": true }, "node_modules/is-bigint": { "version": "1.0.4", @@ -5586,7 +5597,7 @@ "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", - "dev": true, + "devOptional": true, "dependencies": { "hasown": "^2.0.0" }, @@ -6076,7 +6087,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true + "devOptional": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", @@ -6157,7 +6168,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true + "devOptional": true }, "node_modules/linkify-it": { "version": "5.0.0", @@ -6774,7 +6785,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, + "devOptional": true, "dependencies": { "callsites": "^3.0.0" }, @@ -6786,7 +6797,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, + "devOptional": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -6842,7 +6853,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "devOptional": true }, "node_modules/path-scurry": { "version": "1.11.1", @@ -6873,7 +6884,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8" } @@ -7844,7 +7855,6 @@ "version": "4.4.5", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", - "dev": true, "dependencies": { "@babel/runtime": "^7.5.5", "dom-helpers": "^5.0.1", @@ -7941,7 +7951,7 @@ "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dev": true, + "devOptional": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -7958,7 +7968,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, + "devOptional": true, "engines": { "node": ">=4" } @@ -8283,7 +8293,7 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -8545,8 +8555,7 @@ "node_modules/stylis": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", - "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==", - "dev": true + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==" }, "node_modules/sucrase": { "version": "3.35.0", @@ -8605,7 +8614,7 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, + "devOptional": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -8617,7 +8626,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, + "devOptional": true, "engines": { "node": ">= 0.4" }, @@ -9710,9 +9719,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", - "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "devOptional": true, "license": "MIT", "engines": { @@ -9764,7 +9773,7 @@ "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true, + "devOptional": true, "engines": { "node": ">= 6" } diff --git a/fission/package.json b/fission/package.json index 176620737b..126efa86f7 100644 --- a/fission/package.json +++ b/fission/package.json @@ -20,6 +20,9 @@ }, "dependencies": { "@barclah/jolt-physics": "^0.19.3", + "@mui/base": "^5.0.0-beta.40", + "@mui/icons-material": "^5.15.20", + "@mui/system": "^5.15.20", "@react-three/drei": "^9.96.5", "@react-three/fiber": "^8.15.15", "@vitest/coverage-v8": "^1.6.0", diff --git a/fission/prettier.config.js b/fission/prettier.config.js index 3300a59e04..11920b1227 100644 --- a/fission/prettier.config.js +++ b/fission/prettier.config.js @@ -9,6 +9,7 @@ const config = { bracketSpacing: true, bracketSameLine: false, arrowParens: "avoid", + printWidth: 120 } export default config; diff --git a/fission/src/Synthesis.tsx b/fission/src/Synthesis.tsx index f3569c5598..261efc1615 100644 --- a/fission/src/Synthesis.tsx +++ b/fission/src/Synthesis.tsx @@ -4,7 +4,7 @@ import { LoadMirabufRemote } from './mirabuf/MirabufLoader.ts'; import { mirabuf } from './proto/mirabuf'; import MirabufParser, { ParseErrorSeverity } from './mirabuf/MirabufParser.ts'; import MirabufInstance from './mirabuf/MirabufInstance.ts'; -import { AnimatePresence, motion } from "framer-motion" +import { AnimatePresence } from "framer-motion" import { ReactElement, useEffect } from "react" import { ModalControlProvider, useModalManager } from "@/ui/ModalContext" import { PanelControlProvider, usePanelManager } from "@/ui/PanelContext" @@ -54,21 +54,18 @@ import World from '@/systems/World.ts'; import { AddRobotsModal, AddFieldsModal, SpawningModal } from '@/modals/spawning/SpawningModals.tsx'; import ImportMirabufModal from '@/modals/mirabuf/ImportMirabufModal.tsx'; -const DEFAULT_MIRA_PATH = '/api/mira/Robots/Team 2471 (2018)_v7.mira'; +const DEFAULT_MIRA_PATH = "/api/mira/Robots/Team 2471 (2018)_v7.mira" function Synthesis() { - - const urlParams = new URLSearchParams(document.location.search); - if (urlParams.has('code')) { - const code = urlParams.get('code') + const urlParams = new URLSearchParams(document.location.search) + if (urlParams.has("code")) { + const code = urlParams.get("code") window.opener?.setAuthCode(code) window.close() } - - const { openModal, closeModal, getActiveModalElement } = - useModalManager(initialModals) - const { openPanel, closePanel, closeAllPanels, getActivePanelElements } = - usePanelManager(initialPanels) + + const { openModal, closeModal, getActiveModalElement } = useModalManager(initialModals) + const { openPanel, closePanel, closeAllPanels, getActivePanelElements } = usePanelManager(initialPanels) const { showTooltip } = useTooltipManager() const { currentTheme, applyTheme } = useTheme() @@ -77,141 +74,64 @@ function Synthesis() { applyTheme(currentTheme) }, [currentTheme, applyTheme]) - const panelElements = getActivePanelElements() - - const motionPanelElements = panelElements.map((el, i) => ( - - {el} - - )) - const modalElement = getActiveModalElement() - const motionModalElement = - modalElement == null ? null : ( - - {getActiveModalElement()} - - ) - - - useEffect(() => { - - World.InitWorld(); + useEffect(() => { + World.InitWorld() - let mira_path = DEFAULT_MIRA_PATH; + let mira_path = DEFAULT_MIRA_PATH - const urlParams = new URLSearchParams(document.location.search); + const urlParams = new URLSearchParams(document.location.search) if (urlParams.has("mira")) { - mira_path = `test_mira/${urlParams.get("mira")!}`; - console.debug(`Selected Mirabuf File: ${mira_path}`); + mira_path = `test_mira/${urlParams.get("mira")!}` + console.debug(`Selected Mirabuf File: ${mira_path}`) } console.log(urlParams) - const setup = async () => { - - const miraAssembly = await LoadMirabufRemote(mira_path) - .catch( - _ => LoadMirabufRemote(DEFAULT_MIRA_PATH) - ).catch(console.error); + const setup = async () => { + const miraAssembly = await LoadMirabufRemote(mira_path) + .catch(_ => LoadMirabufRemote(DEFAULT_MIRA_PATH)) + .catch(console.error) await (async () => { if (!miraAssembly || !(miraAssembly instanceof mirabuf.Assembly)) { - return; + return } - - const parser = new MirabufParser(miraAssembly); + + const parser = new MirabufParser(miraAssembly) if (parser.maxErrorSeverity >= ParseErrorSeverity.Unimportable) { - console.error(`Assembly Parser produced significant errors for '${miraAssembly.info!.name!}'`); - return; + console.error(`Assembly Parser produced significant errors for '${miraAssembly.info!.name!}'`) + return } - - const mirabufSceneObject = new MirabufSceneObject(new MirabufInstance(parser)); - World.SceneRenderer.RegisterSceneObject(mirabufSceneObject); - })(); - }; - setup(); - let mainLoopHandle = 0; - const mainLoop = () => { - mainLoopHandle = requestAnimationFrame(mainLoop); - - World.UpdateWorld(); - }; - mainLoop(); + const mirabufSceneObject = new MirabufSceneObject(new MirabufInstance(parser)) + World.SceneRenderer.RegisterSceneObject(mirabufSceneObject) + })() + } + setup() + + let mainLoopHandle = 0 + const mainLoop = () => { + mainLoopHandle = requestAnimationFrame(mainLoop) + + World.UpdateWorld() + } + mainLoop() // Cleanup return () => { // TODO: Teardown literally everything - cancelAnimationFrame(mainLoopHandle); - World.DestroyWorld(); + cancelAnimationFrame(mainLoopHandle) + World.DestroyWorld() // World.SceneRenderer.RemoveAllSceneObjects(); - }; - }, []); + } + }, []) return ( { + showTooltip={(type: TooltipType, controls?: TooltipControl[], duration: number = TOOLTIP_DURATION) => { showTooltip(type, controls, duration) }} > @@ -229,11 +149,10 @@ function Synthesis() { }} > - + - {motionPanelElements.length > 0 && - motionPanelElements} - {motionModalElement && motionModalElement} + {panelElements.length > 0 && panelElements} + {modalElement &&
{modalElement}
}
@@ -276,7 +195,7 @@ const initialModals = [ ] const initialPanels: ReactElement[] = [ - , + , , , , @@ -286,4 +205,4 @@ const initialPanels: ReactElement[] = [ , ] -export default Synthesis; +export default Synthesis diff --git a/fission/src/Window.d.ts b/fission/src/Window.d.ts index 4fab77b53a..89e3c41f21 100644 --- a/fission/src/Window.d.ts +++ b/fission/src/Window.d.ts @@ -1,3 +1,3 @@ declare interface Window { - setAuthCode(code: string): void; -} \ No newline at end of file + setAuthCode(code: string): void +} diff --git a/fission/src/aps/APS.ts b/fission/src/aps/APS.ts index 233fc2099a..065c976e9d 100644 --- a/fission/src/aps/APS.ts +++ b/fission/src/aps/APS.ts @@ -1,40 +1,39 @@ import { MainHUD_AddToast } from "@/components/MainHUD" import { Random } from "@/util/Random" -const APS_AUTH_KEY = 'aps_auth' -const APS_USER_INFO_KEY = 'aps_user_info' +const APS_AUTH_KEY = "aps_auth" +const APS_USER_INFO_KEY = "aps_user_info" -export const APS_USER_INFO_UPDATE_EVENT = 'aps_user_info_update' +export const APS_USER_INFO_UPDATE_EVENT = "aps_user_info_update" const delay = 1000 const authCodeTimeout = 200000 -const CLIENT_ID = 'GCxaewcLjsYlK8ud7Ka9AKf9dPwMR3e4GlybyfhAK2zvl3tU' -const CHARACTERS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' +const CLIENT_ID = "GCxaewcLjsYlK8ud7Ka9AKf9dPwMR3e4GlybyfhAK2zvl3tU" +const CHARACTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" let lastCall = Date.now() interface APSAuth { - access_token: string; - refresh_token: string; - expires_in: number; - token_type: number; + access_token: string + refresh_token: string + expires_in: number + token_type: number } interface APSUserInfo { - name: string; - picture: string; - givenName: string; + name: string + picture: string + givenName: string } class APS { - static authCode: string | undefined = undefined static get auth(): APSAuth | undefined { const res = window.localStorage.getItem(APS_AUTH_KEY) try { - return res ? JSON.parse(res) as APSAuth : undefined + return res ? (JSON.parse(res) as APSAuth) : undefined } catch (e) { console.warn(`Failed to parse stored APS auth data: ${e}`) return undefined @@ -53,7 +52,7 @@ class APS { const res = window.localStorage.getItem(APS_USER_INFO_KEY) try { - return res ? JSON.parse(res) as APSUserInfo : undefined + return res ? (JSON.parse(res) as APSUserInfo) : undefined } catch (e) { console.warn(`Failed to parse stored APS user info: ${e}`) return undefined @@ -80,32 +79,32 @@ class APS { ? `http://localhost:3000${import.meta.env.BASE_URL}` : `https://synthesis.autodesk.com${import.meta.env.BASE_URL}` - const [ codeVerifier, codeChallenge ] = await this.codeChallenge(); + const [codeVerifier, codeChallenge] = await this.codeChallenge() const dataParams = [ - ['response_type', 'code'], - ['client_id', CLIENT_ID], - ['redirect_uri', callbackUrl], - ['scope', 'data:read'], - ['nonce', Date.now().toString()], - ['prompt', 'login'], - ['code_challenge', codeChallenge], - ['code_challenge_method', 'S256'] + ["response_type", "code"], + ["client_id", CLIENT_ID], + ["redirect_uri", callbackUrl], + ["scope", "data:read"], + ["nonce", Date.now().toString()], + ["prompt", "login"], + ["code_challenge", codeChallenge], + ["code_challenge_method", "S256"], ] - const data = dataParams.map(x => `${x[0]}=${encodeURIComponent(x[1])}`).join('&') + const data = dataParams.map(x => `${x[0]}=${encodeURIComponent(x[1])}`).join("&") window.open(`https://developer.api.autodesk.com/authentication/v2/authorize?${data}`) - + const searchStart = Date.now() const func = () => { if (Date.now() - searchStart > authCodeTimeout) { - console.debug('Auth Code Timeout') + console.debug("Auth Code Timeout") return } if (this.authCode) { - const code = this.authCode; - this.authCode = undefined; + const code = this.authCode + this.authCode = undefined this.convertAuthToken(code, codeVerifier) } else { @@ -117,51 +116,57 @@ class APS { } static async convertAuthToken(code: string, codeVerifier: string) { - const authUrl = import.meta.env.DEV ? `http://localhost:3003/api/aps/code/` : `https://synthesis.autodesk.com/api/aps/code/` - fetch(`${authUrl}?code=${code}&code_verifier=${codeVerifier}`).then(x => x.json()).then(x => { - this.auth = x.response as APSAuth; - }).then(() => { - console.log('Preloading user info') - if (this.auth) { - this.loadUserInfo(this.auth!).then(async () => { - if (APS.userInfo) { - MainHUD_AddToast('info', 'ADSK Login', `Hello, ${APS.userInfo.givenName}`) - } - }) - } - }) + const authUrl = import.meta.env.DEV + ? `http://localhost:3003/api/aps/code/` + : `https://synthesis.autodesk.com/api/aps/code/` + fetch(`${authUrl}?code=${code}&code_verifier=${codeVerifier}`) + .then(x => x.json()) + .then(x => { + this.auth = x.response as APSAuth + }) + .then(() => { + console.log("Preloading user info") + if (this.auth) { + this.loadUserInfo(this.auth!).then(async () => { + if (APS.userInfo) { + MainHUD_AddToast("info", "ADSK Login", `Hello, ${APS.userInfo.givenName}`) + } + }) + } + }) } static async loadUserInfo(auth: APSAuth) { - console.log('Loading user information') - await fetch('https://api.userprofile.autodesk.com/userinfo', { - method: 'GET', + console.log("Loading user information") + await fetch("https://api.userprofile.autodesk.com/userinfo", { + method: "GET", headers: { - 'Authorization': auth.access_token - } - }).then(x => x.json()).then(x => { - - const info: APSUserInfo = { - name: x.name, - givenName: x.given_name, - picture: x.picture - } - - this.userInfo = info; + Authorization: auth.access_token, + }, }) + .then(x => x.json()) + .then(x => { + const info: APSUserInfo = { + name: x.name, + givenName: x.given_name, + picture: x.picture, + } + + this.userInfo = info + }) } static async codeChallenge() { const codeVerifier = this.genRandomString(50) - - const msgBuffer = new TextEncoder().encode(codeVerifier); - const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer); - - let str = ''; - (new Uint8Array(hashBuffer)).forEach(x => str = str + String.fromCharCode(x)) - const codeChallenge = btoa(str).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '') - - return [ codeVerifier, codeChallenge ] + + const msgBuffer = new TextEncoder().encode(codeVerifier) + const hashBuffer = await crypto.subtle.digest("SHA-256", msgBuffer) + + let str = "" + new Uint8Array(hashBuffer).forEach(x => (str = str + String.fromCharCode(x))) + const codeChallenge = btoa(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "") + + return [codeVerifier, codeChallenge] } static genRandomString(len: number): string { @@ -170,8 +175,8 @@ class APS { const c = CHARACTERS.charAt(Math.abs(Random() * 10000) % CHARACTERS.length) s.push(c) } - - return s.join('') + + return s.join("") } } @@ -179,4 +184,4 @@ Window.prototype.setAuthCode = (code: string) => { APS.authCode = code } -export default APS \ No newline at end of file +export default APS diff --git a/fission/src/aps/APSDataManagement.ts b/fission/src/aps/APSDataManagement.ts index 264f095872..0c6c4a6cec 100644 --- a/fission/src/aps/APSDataManagement.ts +++ b/fission/src/aps/APSDataManagement.ts @@ -1,18 +1,18 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import APS from "./APS"; +import APS from "./APS" -export const FOLDER_DATA_TYPE = 'folders' -export const ITEM_DATA_TYPE = 'items' +export const FOLDER_DATA_TYPE = "folders" +export const ITEM_DATA_TYPE = "items" export interface Hub { - id: string; - name: string; + id: string + name: string } export interface Project { - id: string; - name: string; - folder: Folder; + id: string + name: string + folder: Folder } export class Data { @@ -65,20 +65,24 @@ export async function getHubs(): Promise { } try { - return await fetch('https://developer.api.autodesk.com/project/v1/hubs', { - method: 'GET', + return await fetch("https://developer.api.autodesk.com/project/v1/hubs", { + method: "GET", headers: { - 'Authorization': `Bearer ${auth.access_token}` - } - }).then(x => x.json()).then(x => { - if ((x.data as any[]).length > 0) { - return (x.data as any[]).map(y => { return { id: y.id, name: y.attributes.name }}) - } else { - return undefined - } + Authorization: `Bearer ${auth.access_token}`, + }, }) + .then(x => x.json()) + .then(x => { + if ((x.data as any[]).length > 0) { + return (x.data as any[]).map(y => { + return { id: y.id, name: y.attributes.name } + }) + } else { + return undefined + } + }) } catch (e) { - console.error('Failed to get hubs') + console.error("Failed to get hubs") return undefined } } @@ -91,25 +95,27 @@ export async function getProjects(hub: Hub): Promise { try { return await fetch(`https://developer.api.autodesk.com/project/v1/hubs/${hub.id}/projects/`, { - method: 'GET', + method: "GET", headers: { - 'Authorization': `Bearer ${auth.access_token}` - } - }).then(x => x.json()).then(x => { - if ((x.data as any[]).length > 0) { - return (x.data as any[]).map(y => { - return { - id: y.id, - name: y.attributes.name, - folder: new Folder(y.relationships.rootFolder.data) - } - }) - } else { - return undefined - } + Authorization: `Bearer ${auth.access_token}`, + }, }) + .then(x => x.json()) + .then(x => { + if ((x.data as any[]).length > 0) { + return (x.data as any[]).map(y => { + return { + id: y.id, + name: y.attributes.name, + folder: new Folder(y.relationships.rootFolder.data), + } + }) + } else { + return undefined + } + }) } catch (e) { - console.error('Failed to get hubs') + console.error("Failed to get hubs") return undefined } } @@ -121,31 +127,36 @@ export async function getFolderData(project: Project, folder: Folder): Promise x.json()).then(x => { - console.log('Raw Folder Data') - console.log(x) - if ((x.data as any[]).length > 0) { - return (x.data as any[]).map(y => { - if (y.type == ITEM_DATA_TYPE) { - return new Item(y) - } else if (y.type == FOLDER_DATA_TYPE) { - return new Folder(y) - } else { - return new Data(y) - } - }) - } else { - console.log('No data in folder') - return undefined + return await fetch( + `https://developer.api.autodesk.com/data/v1/projects/${project.id}/folders/${folder.id}/contents`, + { + method: "GET", + headers: { + Authorization: `Bearer ${auth.access_token}`, + }, } - }) + ) + .then(x => x.json()) + .then(x => { + console.log("Raw Folder Data") + console.log(x) + if ((x.data as any[]).length > 0) { + return (x.data as any[]).map(y => { + if (y.type == ITEM_DATA_TYPE) { + return new Item(y) + } else if (y.type == FOLDER_DATA_TYPE) { + return new Folder(y) + } else { + return new Data(y) + } + }) + } else { + console.log("No data in folder") + return undefined + } + }) } catch (e) { - console.error('Failed to get folder data') + console.error("Failed to get folder data") return undefined } -} \ No newline at end of file +} diff --git a/fission/src/index.css b/fission/src/index.css index 3bb0c1be9f..eb75e17d81 100644 --- a/fission/src/index.css +++ b/fission/src/index.css @@ -3,71 +3,71 @@ @tailwind utilities; :root { - /* font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; */ - font-family: 'Artifakt'; - line-height: 1.5; - font-weight: 400; + /* font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; */ + font-family: "Artifakt"; + line-height: 1.5; + font-weight: 400; - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; + font-weight: 500; + color: #646cff; + text-decoration: inherit; } a:hover { - color: #535bf2; + color: #535bf2; } body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; } h1 { - font-size: 3.2em; - line-height: 1.1; + font-size: 3.2em; + line-height: 1.1; } button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; } button:hover { - border-color: #646cff; + border-color: #646cff; } button:focus, button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; + outline: 4px auto -webkit-focus-ring-color; } @media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } } diff --git a/fission/src/main.tsx b/fission/src/main.tsx index e8fc2b831f..df3510831d 100644 --- a/fission/src/main.tsx +++ b/fission/src/main.tsx @@ -5,24 +5,58 @@ import "./index.css" const initialThemeName = "Default" const defaultColors: Theme = { - InteractiveElementSolid: { color: { r: 250, g: 162, b: 27, a: 1 }, above: [] }, - InteractiveElementLeft: { color: { r: 224, g: 130, b: 65, a: 1 }, above: ['Background', 'BackgroundSecondary'] }, - InteractiveElementRight: { color: { r: 218, g: 102, b: 89, a: 1 }, above: ['Background', 'BackgroundSecondary'] }, + InteractiveElementSolid: { + color: { r: 250, g: 162, b: 27, a: 1 }, + above: [], + }, + InteractiveElementLeft: { + color: { r: 224, g: 130, b: 65, a: 1 }, + above: ["Background", "BackgroundSecondary"], + }, + InteractiveElementRight: { + color: { r: 218, g: 102, b: 89, a: 1 }, + above: ["Background", "BackgroundSecondary"], + }, Background: { color: { r: 0, g: 0, b: 0, a: 1 }, above: [] }, BackgroundSecondary: { color: { r: 30, g: 30, b: 30, a: 1 }, above: [] }, InteractiveBackground: { color: { r: 52, g: 58, b: 64, a: 1 }, above: [] }, - MainText: { color: { r: 255, g: 255, b: 255, a: 1 }, above: ['Background', 'BackgroundSecondary', 'BackgroundHUD', 'InteractiveBackground', 'InteractiveElementLeft', 'InteractiveElementRight'] }, + MainText: { + color: { r: 255, g: 255, b: 255, a: 1 }, + above: [ + "Background", + "BackgroundSecondary", + "BackgroundHUD", + "InteractiveBackground", + "InteractiveElementLeft", + "InteractiveElementRight", + ], + }, Scrollbar: { color: { r: 170, g: 170, b: 170, a: 1 }, above: [] }, AcceptButton: { color: { r: 71, g: 138, b: 226, a: 1 }, above: [] }, CancelButton: { color: { r: 231, g: 85, b: 81, a: 1 }, above: [] }, - InteractiveElementText: { color: { r: 255, g: 255, b: 255, a: 1 }, above: [] }, - AcceptCancelButtonText: { color: { r: 0, g: 0, b: 0, a: 1 }, above: ['AcceptButton', 'CancelButton'] }, + InteractiveElementText: { + color: { r: 255, g: 255, b: 255, a: 1 }, + above: [], + }, + AcceptCancelButtonText: { + color: { r: 0, g: 0, b: 0, a: 1 }, + above: ["AcceptButton", "CancelButton"], + }, BackgroundHUD: { color: { r: 23, g: 23, b: 23, a: 1 }, above: [] }, InteractiveHover: { color: { r: 150, g: 150, b: 150, a: 1 }, above: [] }, InteractiveSelect: { color: { r: 100, g: 100, b: 100, a: 1 }, above: [] }, - Icon: { color: { r: 255, g: 255, b: 255, a: 1 }, above: ['Background', 'BackgroundSecondary', 'InteractiveBackground'] }, - MainHUDIcon: { color: { r: 255, g: 255, b: 255, a: 1 }, above: ['BackgroundHUD'] }, - MainHUDCloseIcon: { color: { r: 0, g: 0, b: 0, a: 1 }, above: ['InteractiveElementRight', '#ffffff'] }, + Icon: { + color: { r: 255, g: 255, b: 255, a: 1 }, + above: ["Background", "BackgroundSecondary", "InteractiveBackground"], + }, + MainHUDIcon: { + color: { r: 255, g: 255, b: 255, a: 1 }, + above: ["BackgroundHUD"], + }, + MainHUDCloseIcon: { + color: { r: 0, g: 0, b: 0, a: 1 }, + above: ["InteractiveElementRight", "#ffffff"], + }, HighlightHover: { color: { r: 89, g: 255, b: 133, a: 1 }, above: [] }, HighlightSelect: { color: { r: 255, g: 89, b: 133, a: 1 }, above: [] }, SkyboxTop: { color: { r: 255, g: 255, b: 255, a: 1 }, above: [] }, @@ -39,11 +73,7 @@ const themes = { } ReactDOM.createRoot(document.getElementById("root")!).render( - + ) diff --git a/fission/src/mirabuf/MirabufInstance.ts b/fission/src/mirabuf/MirabufInstance.ts index 495f89c11e..83307eb6cb 100644 --- a/fission/src/mirabuf/MirabufInstance.ts +++ b/fission/src/mirabuf/MirabufInstance.ts @@ -1,204 +1,222 @@ -import * as THREE from 'three'; +import * as THREE from "three" import { mirabuf } from "../proto/mirabuf" -import MirabufParser, { ParseErrorSeverity } from './MirabufParser.ts'; -import World from '@/systems/World.ts'; +import MirabufParser, { ParseErrorSeverity } from "./MirabufParser.ts" +import World from "@/systems/World.ts" export enum MaterialStyle { Regular = 0, Normals = 1, - Toon = 2 + Toon = 2, } export const matToString = (mat: THREE.Matrix4) => { - const arr = mat.toArray(); - return `[\n${arr[0].toFixed(4)}, ${arr[4].toFixed(4)}, ${arr[8].toFixed(4)}, ${arr[12].toFixed(4)},\n` - + `${arr[1].toFixed(4)}, ${arr[5].toFixed(4)}, ${arr[9].toFixed(4)}, ${arr[13].toFixed(4)},\n` - + `${arr[2].toFixed(4)}, ${arr[6].toFixed(4)}, ${arr[10].toFixed(4)}, ${arr[14].toFixed(4)},\n` - + `${arr[3].toFixed(4)}, ${arr[7].toFixed(4)}, ${arr[11].toFixed(4)}, ${arr[15].toFixed(4)},\n]` + const arr = mat.toArray() + return ( + `[\n${arr[0].toFixed(4)}, ${arr[4].toFixed(4)}, ${arr[8].toFixed(4)}, ${arr[12].toFixed(4)},\n` + + `${arr[1].toFixed(4)}, ${arr[5].toFixed(4)}, ${arr[9].toFixed(4)}, ${arr[13].toFixed(4)},\n` + + `${arr[2].toFixed(4)}, ${arr[6].toFixed(4)}, ${arr[10].toFixed(4)}, ${arr[14].toFixed(4)},\n` + + `${arr[3].toFixed(4)}, ${arr[7].toFixed(4)}, ${arr[11].toFixed(4)}, ${arr[15].toFixed(4)},\n]` + ) } export const miraMatToString = (mat: mirabuf.ITransform) => { - const arr = mat.spatialMatrix!; - return `[\n${arr[0].toFixed(4)}, ${arr[1].toFixed(4)}, ${arr[2].toFixed(4)}, ${arr[3].toFixed(4)},\n` - + `${arr[4].toFixed(4)}, ${arr[5].toFixed(4)}, ${arr[6].toFixed(4)}, ${arr[7].toFixed(4)},\n` - + `${arr[8].toFixed(4)}, ${arr[9].toFixed(4)}, ${arr[10].toFixed(4)}, ${arr[11].toFixed(4)},\n` - + `${arr[12].toFixed(4)}, ${arr[13].toFixed(4)}, ${arr[14].toFixed(4)}, ${arr[15].toFixed(4)},\n]` + const arr = mat.spatialMatrix! + return ( + `[\n${arr[0].toFixed(4)}, ${arr[1].toFixed(4)}, ${arr[2].toFixed(4)}, ${arr[3].toFixed(4)},\n` + + `${arr[4].toFixed(4)}, ${arr[5].toFixed(4)}, ${arr[6].toFixed(4)}, ${arr[7].toFixed(4)},\n` + + `${arr[8].toFixed(4)}, ${arr[9].toFixed(4)}, ${arr[10].toFixed(4)}, ${arr[11].toFixed(4)},\n` + + `${arr[12].toFixed(4)}, ${arr[13].toFixed(4)}, ${arr[14].toFixed(4)}, ${arr[15].toFixed(4)},\n]` + ) } -let nextFillerMaterial = 0; +let nextFillerMaterial = 0 const fillerMaterials = [ new THREE.MeshToonMaterial({ - color: 0xe32b50 + color: 0xe32b50, }), new THREE.MeshToonMaterial({ - color: 0x4ccf57 + color: 0x4ccf57, }), new THREE.MeshToonMaterial({ - color: 0xcf4cca - }) + color: 0xcf4cca, + }), ] const transformVerts = (mesh: mirabuf.IMesh) => { - const newVerts = new Float32Array(mesh.verts!.length); + const newVerts = new Float32Array(mesh.verts!.length) for (let i = 0; i < mesh.verts!.length; i += 3) { - newVerts[i] = mesh.verts!.at(i)! / 100.0; - newVerts[i + 1] = mesh.verts!.at(i + 1)! / 100.0; - newVerts[i + 2] = mesh.verts!.at(i + 2)! / 100.0; + newVerts[i] = mesh.verts!.at(i)! / 100.0 + newVerts[i + 1] = mesh.verts!.at(i + 1)! / 100.0 + newVerts[i + 2] = mesh.verts!.at(i + 2)! / 100.0 } - return newVerts; + return newVerts } const transformNorms = (mesh: mirabuf.IMesh) => { - const newNorms = new Float32Array(mesh.normals!.length); + const newNorms = new Float32Array(mesh.normals!.length) for (let i = 0; i < mesh.normals!.length; i += 3) { - const normLength = Math.sqrt(mesh.normals!.at(i)! * mesh.normals!.at(i)! + - mesh.normals!.at(i + 1)! * mesh.normals!.at(i + 1)! + - mesh.normals!.at(i + 2)! * mesh.normals!.at(i + 2)! - ); - - newNorms[i] = mesh.normals!.at(i)! / normLength; - newNorms[i + 1] = mesh.normals!.at(i + 1)! / normLength; - newNorms[i + 2] = mesh.normals!.at(i + 2)! / normLength; + const normLength = Math.sqrt( + mesh.normals!.at(i)! * mesh.normals!.at(i)! + + mesh.normals!.at(i + 1)! * mesh.normals!.at(i + 1)! + + mesh.normals!.at(i + 2)! * mesh.normals!.at(i + 2)! + ) + + newNorms[i] = mesh.normals!.at(i)! / normLength + newNorms[i + 1] = mesh.normals!.at(i + 1)! / normLength + newNorms[i + 2] = mesh.normals!.at(i + 2)! / normLength } - return newNorms; + return newNorms } const transformGeometry = (geometry: THREE.BufferGeometry, mesh: mirabuf.IMesh) => { - const newVerts = transformVerts(mesh); - const newNorms = transformNorms(mesh); + const newVerts = transformVerts(mesh) + const newNorms = transformNorms(mesh) - geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(newVerts), 3)); - geometry.setAttribute('normal', new THREE.BufferAttribute(new Float32Array(newNorms), 3)); - geometry.setAttribute('uv', new THREE.BufferAttribute(new Float32Array(mesh.uv!), 2)); - geometry.setIndex(mesh.indices!); + geometry.setAttribute("position", new THREE.BufferAttribute(new Float32Array(newVerts), 3)) + geometry.setAttribute("normal", new THREE.BufferAttribute(new Float32Array(newNorms), 3)) + geometry.setAttribute("uv", new THREE.BufferAttribute(new Float32Array(mesh.uv!), 2)) + geometry.setIndex(mesh.indices!) } class MirabufInstance { - private _mirabufParser: MirabufParser; - private _materials: Map; - private _meshes: Map>; + private _mirabufParser: MirabufParser + private _materials: Map + private _meshes: Map> - public get parser() { return this._mirabufParser; } - public get materials() { return this._materials; } - public get meshes() { return this._meshes; } + public get parser() { + return this._mirabufParser + } + public get materials() { + return this._materials + } + public get meshes() { + return this._meshes + } public constructor(parser: MirabufParser, materialStyle?: MaterialStyle) { if (parser.errors.some(x => x[0] >= ParseErrorSeverity.Unimportable)) { - throw new Error('Parser has significant errors...'); + throw new Error("Parser has significant errors...") } - this._mirabufParser = parser; - this._materials = new Map(); - this._meshes = new Map(); + this._mirabufParser = parser + this._materials = new Map() + this._meshes = new Map() - this.LoadMaterials(materialStyle ?? MaterialStyle.Regular); - this.CreateMeshes(); + this.LoadMaterials(materialStyle ?? MaterialStyle.Regular) + this.CreateMeshes() } /** * Parses all mirabuf appearances into ThreeJs materials. */ private LoadMaterials(materialStyle: MaterialStyle) { - Object.entries(this._mirabufParser.assembly.data!.materials!.appearances!).forEach(([appearanceId, appearance]) => { - let hex = 0xe32b50; - if (appearance.albedo) { - const {A, B, G, R} = appearance.albedo; - if (A && B && G && R) - hex = A << 24 | R << 16 | G << 8 | B; - } + Object.entries(this._mirabufParser.assembly.data!.materials!.appearances!).forEach( + ([appearanceId, appearance]) => { + let hex = 0xe32b50 + if (appearance.albedo) { + const { A, B, G, R } = appearance.albedo + if (A && B && G && R) hex = (A << 24) | (R << 16) | (G << 8) | B + } - let material: THREE.Material; - if (materialStyle == MaterialStyle.Regular) { - material = new THREE.MeshPhongMaterial({ - color: hex, - shininess: 0.0, - }); - } else if (materialStyle == MaterialStyle.Normals) { - material = new THREE.MeshNormalMaterial(); - } else if (materialStyle == MaterialStyle.Toon) { - material = World.SceneRenderer.CreateToonMaterial(hex, 5); - console.debug('Toon Material'); - } + let material: THREE.Material + if (materialStyle == MaterialStyle.Regular) { + material = new THREE.MeshPhongMaterial({ + color: hex, + shininess: 0.0, + }) + } else if (materialStyle == MaterialStyle.Normals) { + material = new THREE.MeshNormalMaterial() + } else if (materialStyle == MaterialStyle.Toon) { + material = World.SceneRenderer.CreateToonMaterial(hex, 5) + console.debug("Toon Material") + } - this._materials.set( - appearanceId, - material! - ); - }); + this._materials.set(appearanceId, material!) + } + ) } /** * Creates ThreeJS meshes from the parsed mirabuf file. */ private CreateMeshes() { - const assembly = this._mirabufParser.assembly; - const instances = assembly.data!.parts!.partInstances!; + const assembly = this._mirabufParser.assembly + const instances = assembly.data!.parts!.partInstances! - let totalMeshCount = 0; + let totalMeshCount = 0 - for (const instance of Object.values(instances)/* .filter(x => x.info!.name!.startsWith('EyeBall')) */) { - const definition = assembly.data!.parts!.partDefinitions![instance.partDefinitionReference!]!; - const bodies = definition.bodies; - const meshes = new Array(); + for (const instance of Object.values(instances) /* .filter(x => x.info!.name!.startsWith('EyeBall')) */) { + const definition = assembly.data!.parts!.partDefinitions![instance.partDefinitionReference!]! + const bodies = definition.bodies + const meshes = new Array() if (bodies) { for (const body of bodies) { - if (!body) continue; - const mesh = body.triangleMesh; - const geometry = new THREE.BufferGeometry(); - if (mesh && mesh.mesh && mesh.mesh.verts && mesh.mesh.normals && mesh.mesh.uv && mesh.mesh.indices) { - transformGeometry(geometry, mesh.mesh!); - - const appearanceOverride = body.appearanceOverride; + if (!body) continue + const mesh = body.triangleMesh + const geometry = new THREE.BufferGeometry() + if ( + mesh && + mesh.mesh && + mesh.mesh.verts && + mesh.mesh.normals && + mesh.mesh.uv && + mesh.mesh.indices + ) { + transformGeometry(geometry, mesh.mesh!) + + const appearanceOverride = body.appearanceOverride const material: THREE.Material = appearanceOverride && this._materials.has(appearanceOverride) ? this._materials.get(appearanceOverride)! - : fillerMaterials[nextFillerMaterial++ % fillerMaterials.length]; + : fillerMaterials[nextFillerMaterial++ % fillerMaterials.length] // if (NORMAL_MATERIALS) { // material = new THREE.MeshNormalMaterial(); // } - const threeMesh = new THREE.Mesh( geometry, material ); - threeMesh.receiveShadow = true; - threeMesh.castShadow = true; + const threeMesh = new THREE.Mesh(geometry, material) + threeMesh.receiveShadow = true + threeMesh.castShadow = true + + meshes.push(threeMesh) - meshes.push(threeMesh); - - const mat = this._mirabufParser.globalTransforms.get(instance.info!.GUID!)!; - threeMesh.position.setFromMatrixPosition(mat); - threeMesh.rotation.setFromRotationMatrix(mat); + const mat = this._mirabufParser.globalTransforms.get(instance.info!.GUID!)! + threeMesh.position.setFromMatrixPosition(mat) + threeMesh.rotation.setFromRotationMatrix(mat) } } } - totalMeshCount += meshes.length; - this._meshes.set(instance.info!.GUID!, meshes); + totalMeshCount += meshes.length + this._meshes.set(instance.info!.GUID!, meshes) } - console.debug(`Created '${ totalMeshCount }' meshes for mira file '${this._mirabufParser.assembly.info!.name!}'`); + console.debug(`Created '${totalMeshCount}' meshes for mira file '${this._mirabufParser.assembly.info!.name!}'`) } /** * Adds all the meshes to the ThreeJs scene. - * - * @param scene + * + * @param scene */ public AddToScene(scene: THREE.Scene) { - this._meshes.forEach(x => x.forEach(y => scene.add(y))); + this._meshes.forEach(x => x.forEach(y => scene.add(y))) } /** * Disposes of all ThreeJs scenes and materials. */ public Dispose(scene: THREE.Scene) { - this._meshes.forEach(x => x.forEach(y => { - y.geometry.dispose(); - scene.remove(y); - })); - this._meshes.clear(); - - this._materials.forEach(x => x.dispose()); - this._materials.clear(); + this._meshes.forEach(x => + x.forEach(y => { + y.geometry.dispose() + scene.remove(y) + }) + ) + this._meshes.clear() + + this._materials.forEach(x => x.dispose()) + this._materials.clear() } } -export default MirabufInstance; +export default MirabufInstance diff --git a/fission/src/mirabuf/MirabufLoader.ts b/fission/src/mirabuf/MirabufLoader.ts index d7fd7f3f67..e4ef42ffab 100644 --- a/fission/src/mirabuf/MirabufLoader.ts +++ b/fission/src/mirabuf/MirabufLoader.ts @@ -1,21 +1,26 @@ -import { mirabuf } from "../proto/mirabuf"; -import Pako from "pako"; -import * as fs from 'fs'; +import { mirabuf } from "../proto/mirabuf" +import Pako from "pako" +import * as fs from "fs" export function UnzipMira(buff: Uint8Array): Uint8Array { if (buff[0] == 31 && buff[1] == 139) { - return Pako.ungzip(buff); + return Pako.ungzip(buff) } else { - return buff; + return buff } } -export async function LoadMirabufRemote(fetchLocation: string, useCache: boolean = true): Promise { - const miraBuff = await fetch(encodeURI(fetchLocation), useCache ? undefined : {cache: "no-store"}).then(x => x.blob()).then(x => x.arrayBuffer()); - const byteBuffer = UnzipMira(new Uint8Array(miraBuff)); - return mirabuf.Assembly.decode(byteBuffer); +export async function LoadMirabufRemote( + fetchLocation: string, + useCache: boolean = true +): Promise { + const miraBuff = await fetch(encodeURI(fetchLocation), useCache ? undefined : { cache: "no-store" }) + .then(x => x.blob()) + .then(x => x.arrayBuffer()) + const byteBuffer = UnzipMira(new Uint8Array(miraBuff)) + return mirabuf.Assembly.decode(byteBuffer) } export function LoadMirabufLocal(fileLocation: string): mirabuf.Assembly { - return mirabuf.Assembly.decode(UnzipMira(new Uint8Array(fs.readFileSync(fileLocation)))); -} \ No newline at end of file + return mirabuf.Assembly.decode(UnzipMira(new Uint8Array(fs.readFileSync(fileLocation)))) +} diff --git a/fission/src/mirabuf/MirabufParser.ts b/fission/src/mirabuf/MirabufParser.ts index f2be5033be..7936f8ca44 100644 --- a/fission/src/mirabuf/MirabufParser.ts +++ b/fission/src/mirabuf/MirabufParser.ts @@ -1,18 +1,18 @@ -import * as THREE from "three"; -import { mirabuf } from "../proto/mirabuf"; -import { MirabufTransform_ThreeMatrix4 } from "../util/TypeConversions"; +import * as THREE from "three" +import { mirabuf } from "../proto/mirabuf" +import { MirabufTransform_ThreeMatrix4 } from "../util/TypeConversions" export enum ParseErrorSeverity { Unimportable = 10, LikelyIssues = 6, ProbablyOkay = 5, - JustAWarning = 2 + JustAWarning = 2, } -export const GROUNDED_JOINT_ID = 'grounded'; -export const GAMEPIECE_SUFFIX = '_gp'; +export const GROUNDED_JOINT_ID = "grounded" +export const GAMEPIECE_SUFFIX = "_gp" -export type ParseError = [severity: ParseErrorSeverity, message: string]; +export type ParseError = [severity: ParseErrorSeverity, message: string] /** * TODO: @@ -20,354 +20,377 @@ export type ParseError = [severity: ParseErrorSeverity, message: string]; * 2. Gamepieces added to their own RigidNodes */ class MirabufParser { + private _nodeNameCounter: number = 0 - private _nodeNameCounter: number = 0; + private _assembly: mirabuf.Assembly + private _errors: Array + private _directedGraph: Graph + private _rootNode: string - private _assembly: mirabuf.Assembly; - private _errors: Array; - private _directedGraph: Graph; - private _rootNode: string; + protected _partTreeValues: Map = new Map() + private _designHierarchyRoot: mirabuf.INode = new mirabuf.Node() - protected _partTreeValues: Map = new Map(); - private _designHierarchyRoot: mirabuf.INode = new mirabuf.Node(); + protected _partToNodeMap: Map = new Map() + protected _rigidNodes: Array = [] + private _globalTransforms: Map - protected _partToNodeMap: Map = new Map(); - protected _rigidNodes: Array = []; - private _globalTransforms: Map; + private _groundedNode: RigidNode | undefined - private _groundedNode: RigidNode | undefined; - - public get errors() { return new Array(...this._errors); } - public get maxErrorSeverity() { return Math.max(...this._errors.map(x => x[0])); } - public get assembly() { return this._assembly; } - public get partTreeValues() { return this._partTreeValues; } - public get designHierarchyRoot() { return this._designHierarchyRoot; } - public get partToNodeMap() { return this._partToNodeMap; } - public get globalTransforms() { return this._globalTransforms; } - public get groundedNode() { return this._groundedNode ? new RigidNodeReadOnly(this._groundedNode) : undefined; } - public get rigidNodes(): Array { return this._rigidNodes.map(x => new RigidNodeReadOnly(x)); } - public get directedGraph() { return this._directedGraph; } - public get rootNode() { return this._rootNode; } + public get errors() { + return new Array(...this._errors) + } + public get maxErrorSeverity() { + return Math.max(...this._errors.map(x => x[0])) + } + public get assembly() { + return this._assembly + } + public get partTreeValues() { + return this._partTreeValues + } + public get designHierarchyRoot() { + return this._designHierarchyRoot + } + public get partToNodeMap() { + return this._partToNodeMap + } + public get globalTransforms() { + return this._globalTransforms + } + public get groundedNode() { + return this._groundedNode ? new RigidNodeReadOnly(this._groundedNode) : undefined + } + public get rigidNodes(): Array { + return this._rigidNodes.map(x => new RigidNodeReadOnly(x)) + } + public get directedGraph() { + return this._directedGraph + } + public get rootNode() { + return this._rootNode + } public constructor(assembly: mirabuf.Assembly) { - this._assembly = assembly; - this._errors = new Array(); - this._globalTransforms = new Map(); + this._assembly = assembly + this._errors = new Array() + this._globalTransforms = new Map() - this.GenerateTreeValues(); - this.LoadGlobalTransforms(); + this.GenerateTreeValues() + this.LoadGlobalTransforms() // eslint-disable-next-line @typescript-eslint/no-this-alias - const that = this; + const that = this - function traverseTree(nodes: mirabuf.INode[], op: ((node: mirabuf.INode) => void)) { + function traverseTree(nodes: mirabuf.INode[], op: (node: mirabuf.INode) => void) { nodes.forEach(x => { if (x.children) { - traverseTree(x.children, op); + traverseTree(x.children, op) } - op(x); - }); + op(x) + }) } // 1: Initial Rigidgroups from ancestorial breaks in joints - (Object.keys(assembly.data!.joints!.jointInstances!) as (string)[]).forEach(key => { + (Object.keys(assembly.data!.joints!.jointInstances!) as string[]).forEach(key => { if (key != GROUNDED_JOINT_ID) { - const jInst = assembly.data!.joints!.jointInstances![key]; - const [ancestorA, ancestorB] = this.FindAncestorialBreak(jInst.parentPart!, jInst.childPart!); - const parentRN = this.NewRigidNode(); - this.MovePartToRigidNode(ancestorA, parentRN); - this.MovePartToRigidNode(ancestorB, this.NewRigidNode()); + const jInst = assembly.data!.joints!.jointInstances![key] + const [ancestorA, ancestorB] = this.FindAncestorialBreak(jInst.parentPart!, jInst.childPart!) + const parentRN = this.NewRigidNode() + this.MovePartToRigidNode(ancestorA, parentRN) + this.MovePartToRigidNode(ancestorB, this.NewRigidNode()) if (jInst.parts && jInst.parts.nodes) - traverseTree(jInst.parts.nodes, x => this.MovePartToRigidNode(x.value!, parentRN)); + traverseTree(jInst.parts.nodes, x => this.MovePartToRigidNode(x.value!, parentRN)) } - }); + }) // this.DebugPrintHierarchy(1, ...this._designHierarchyRoot.children!); // Fields Only: Assign Game Piece rigid nodes if (!assembly.dynamic) { // Collect all definitions labelled as gamepieces (dynamic = true) - const gamepieceDefinitions: Set = new Set(); - (Object.values(assembly.data!.parts!.partDefinitions!) as mirabuf.IPartDefinition[]).forEach(def => { - if (def.dynamic) - gamepieceDefinitions.add(def.info!.GUID!); - }); - - // Create gamepiece rigid nodes from partinstances with corresponding definitons - (Object.values(assembly.data!.parts!.partInstances!) as mirabuf.IPartInstance[]).forEach(inst => { + const gamepieceDefinitions: Set = new Set() + + Object.values(assembly.data!.parts!.partDefinitions!).forEach((def: mirabuf.IPartDefinition) => { + if (def.dynamic) gamepieceDefinitions.add(def.info!.GUID!) + }) + + // Create gamepiece rigid nodes from partinstances with corresponding definitions + Object.values(assembly.data!.parts!.partInstances!).forEach((inst: mirabuf.IPartInstance) => { if (gamepieceDefinitions.has(inst.partDefinitionReference!)) { - const instNode = this.BinarySearchDesignTree(inst.info!.GUID!); + const instNode = this.BinarySearchDesignTree(inst.info!.GUID!) if (instNode) { - const gpRn = this.NewRigidNode(GAMEPIECE_SUFFIX); - this.MovePartToRigidNode(instNode!.value!, gpRn); - instNode.children && traverseTree(instNode.children, x => this.MovePartToRigidNode(x.value!, gpRn)); + const gpRn = this.NewRigidNode(GAMEPIECE_SUFFIX) + this.MovePartToRigidNode(instNode!.value!, gpRn) + instNode.children && + traverseTree(instNode.children, x => this.MovePartToRigidNode(x.value!, gpRn)) } else { - this._errors.push([ParseErrorSeverity.LikelyIssues, 'Failed to find Game piece in Design Tree']); + this._errors.push([ParseErrorSeverity.LikelyIssues, "Failed to find Game piece in Design Tree"]) } } - }); + }) } // 2: Grounded joint - const gInst = assembly.data!.joints!.jointInstances![GROUNDED_JOINT_ID]; - const gNode = this.NewRigidNode(); - this.MovePartToRigidNode(gInst.parts!.nodes!.at(0)!.value!, gNode); - + const gInst = assembly.data!.joints!.jointInstances![GROUNDED_JOINT_ID] + const gNode = this.NewRigidNode() + this.MovePartToRigidNode(gInst.parts!.nodes!.at(0)!.value!, gNode) + // traverseTree(gInst.parts!.nodes!, x => (!this._partToNodeMap.has(x.value!)) && this.MovePartToRigidNode(x.value!, gNode)); - + // this.DebugPrintHierarchy(1, ...this._designHierarchyRoot.children!); // 3: Traverse and round up const traverseNodeRoundup = (node: mirabuf.INode, parentNode: RigidNode) => { - const currentNode = that._partToNodeMap.get(node.value!); + const currentNode = that._partToNodeMap.get(node.value!) if (!currentNode) { - that.MovePartToRigidNode(node.value!, parentNode); + that.MovePartToRigidNode(node.value!, parentNode) } if (node.children) { - node.children!.forEach(x => traverseNodeRoundup(x, currentNode ? currentNode : parentNode)); + node.children!.forEach(x => traverseNodeRoundup(x, currentNode ? currentNode : parentNode)) } } - this._designHierarchyRoot.children?.forEach(x => traverseNodeRoundup(x, gNode)); + this._designHierarchyRoot.children?.forEach(x => traverseNodeRoundup(x, gNode)) // this.DebugPrintHierarchy(1, ...this._designHierarchyRoot.children!); // 4: Bandage via rigidgroups assembly.data!.joints!.rigidGroups!.forEach(rg => { - let rn: RigidNode | null = null; + let rn: RigidNode | null = null rg.occurrences!.forEach(y => { - const currentRn = this._partToNodeMap.get(y)!; + const currentRn = this._partToNodeMap.get(y)! if (!rn) { - rn = currentRn; + rn = currentRn } else if (currentRn.id != rn.id) { - rn = this.MergeRigidNodes(currentRn, rn); + rn = this.MergeRigidNodes(currentRn, rn) } - }); - }); + }) + }) // this.DebugPrintHierarchy(1, ...this._designHierarchyRoot.children!); // 5. Remove Empty RNs - this._rigidNodes = this._rigidNodes.filter(x => x.parts.size > 0); + this._rigidNodes = this._rigidNodes.filter(x => x.parts.size > 0) // 6. If field, find grounded node and set isDynamic to false. Also just find grounded node again - this._groundedNode = this.partToNodeMap.get(gInst.parts!.nodes!.at(0)!.value!); + this._groundedNode = this.partToNodeMap.get(gInst.parts!.nodes!.at(0)!.value!) if (!assembly.dynamic && this._groundedNode) { - this._groundedNode.isDynamic = false; + this._groundedNode.isDynamic = false } // 7. Update root RigidNode - const rootNode = this._partToNodeMap.get(gInst.parts!.nodes!.at(0)!.value!); + const rootNode = this._partToNodeMap.get(gInst.parts!.nodes!.at(0)!.value!) if (rootNode) { - rootNode.isRoot = true; - this._rootNode = rootNode.id; + rootNode.isRoot = true + this._rootNode = rootNode.id } else { - this._rootNode = this._rigidNodes[0].id; + this._rootNode = this._rigidNodes[0].id } // 8. Generate Rigid Node Graph // Build undirected graph - const graph = new Graph(); - graph.AddNode(rootNode ? rootNode.id : this._rigidNodes[0].id); - (Object.values(assembly.data!.joints!.jointInstances!) as mirabuf.joint.JointInstance[]).forEach(x => { - const rA = this._partToNodeMap.get(x.parentPart); - const rB = this._partToNodeMap.get(x.childPart); + const graph = new Graph() + graph.AddNode(rootNode ? rootNode.id : this._rigidNodes[0].id) + const jointInstances = (Object.values(assembly.data!.joints!.jointInstances!) as mirabuf.joint.JointInstance[]) + jointInstances.forEach((x: mirabuf.joint.JointInstance) => { + const rA = this._partToNodeMap.get(x.parentPart) + const rB = this._partToNodeMap.get(x.childPart) if (rA && rB && rA.id != rB.id) { - graph.AddNode(rA.id); - graph.AddNode(rB.id); - graph.AddEdgeUndirected(rA.id, rB.id); + graph.AddNode(rA.id) + graph.AddNode(rB.id) + graph.AddEdgeUndirected(rA.id, rB.id) } - }); - const directedGraph = new Graph(); - const whiteGreyBlackMap = new Map(); + }) + const directedGraph = new Graph() + const whiteGreyBlackMap = new Map() this._rigidNodes.forEach(x => { - whiteGreyBlackMap.set(x.id, false); - directedGraph.AddNode(x.id); - }); + whiteGreyBlackMap.set(x.id, false) + directedGraph.AddNode(x.id) + }) function directedRecursive(node: string) { graph.GetAdjacencyList(node).forEach(x => { if (whiteGreyBlackMap.has(x)) { - directedGraph.AddEdgeDirected(node, x); - whiteGreyBlackMap.delete(x); - directedRecursive(x); + directedGraph.AddEdgeDirected(node, x) + whiteGreyBlackMap.delete(x) + directedRecursive(x) } - }); + }) } if (rootNode) { - whiteGreyBlackMap.delete(rootNode.id); - directedRecursive(rootNode.id); + whiteGreyBlackMap.delete(rootNode.id) + directedRecursive(rootNode.id) } else { - whiteGreyBlackMap.delete(this._rigidNodes[0].id); - directedRecursive(this._rigidNodes[0].id); + whiteGreyBlackMap.delete(this._rigidNodes[0].id) + directedRecursive(this._rigidNodes[0].id) } - this._directedGraph = directedGraph; + this._directedGraph = directedGraph } private NewRigidNode(suffix?: string): RigidNode { - const node = new RigidNode(`${this._nodeNameCounter++}${suffix ? suffix : ''}`); - this._rigidNodes.push(node); - return node; + const node = new RigidNode(`${this._nodeNameCounter++}${suffix ? suffix : ""}`) + this._rigidNodes.push(node) + return node } private MergeRigidNodes(rnA: RigidNode, rnB: RigidNode) { - const newRn = this.NewRigidNode('merged'); - const allParts = new Set([...rnA.parts, ...rnB.parts]); - allParts.forEach(x => this.MovePartToRigidNode(x, newRn)); - return newRn; + const newRn = this.NewRigidNode("merged") + const allParts = new Set([...rnA.parts, ...rnB.parts]) + allParts.forEach(x => this.MovePartToRigidNode(x, newRn)) + return newRn } private MovePartToRigidNode(part: string, node: RigidNode) { - if (part.length < 1) - return; - - const original = this._partToNodeMap.get(part); + if (part.length < 1) return + + const original = this._partToNodeMap.get(part) if (original) { - if (original === node) - return; + if (original === node) return - original.parts.delete(part); - this._partToNodeMap.delete(part); + original.parts.delete(part) + this._partToNodeMap.delete(part) } - node.parts.add(part); - this._partToNodeMap.set(part, node); + node.parts.add(part) + this._partToNodeMap.set(part, node) } /** * Loads this._globalTransforms with the world space transformations of each part instance. */ private LoadGlobalTransforms() { - const root = this._designHierarchyRoot; - const partInstances = new Map(Object.entries(this._assembly.data!.parts!.partInstances!)); - const partDefinitions = this._assembly.data!.parts!.partDefinitions!; + const root = this._designHierarchyRoot + const partInstances = new Map( + Object.entries(this._assembly.data!.parts!.partInstances!) + ) + const partDefinitions = this._assembly.data!.parts!.partDefinitions! - this._globalTransforms.clear(); + this._globalTransforms.clear() const getTransforms = (node: mirabuf.INode, parent: THREE.Matrix4) => { for (const child of node.children!) { if (!partInstances.has(child.value!)) { - continue; + continue } - const partInstance = partInstances.get(child.value!)!; - - if (this._globalTransforms.has(child.value!)) continue; - const mat = MirabufTransform_ThreeMatrix4(partInstance.transform!)!; + const partInstance = partInstances.get(child.value!)! + + if (this._globalTransforms.has(child.value!)) continue + const mat = MirabufTransform_ThreeMatrix4(partInstance.transform!)! // console.log(`[${partInstance.info!.name!}] -> ${matToString(mat)}`); - this._globalTransforms.set(child.value!, mat.premultiply(parent)); - getTransforms(child, mat); + this._globalTransforms.set(child.value!, mat.premultiply(parent)) + getTransforms(child, mat) } } for (const child of root.children!) { - const partInstance = partInstances.get(child.value!)!; - let mat; + const partInstance = partInstances.get(child.value!)! + let mat if (!partInstance.transform) { - const def = partDefinitions[partInstances.get(child.value!)!.partDefinitionReference!]; + const def = partDefinitions[partInstances.get(child.value!)!.partDefinitionReference!] if (!def.baseTransform) { - mat = new THREE.Matrix4().identity(); + mat = new THREE.Matrix4().identity() } else { - mat = MirabufTransform_ThreeMatrix4(def.baseTransform); + mat = MirabufTransform_ThreeMatrix4(def.baseTransform) } } else { - mat = MirabufTransform_ThreeMatrix4(partInstance.transform); + mat = MirabufTransform_ThreeMatrix4(partInstance.transform) } // console.log(`[${partInstance.info!.name!}] -> ${matToString(mat!)}`); - this._globalTransforms.set(partInstance.info!.GUID!, mat!); - getTransforms(child, mat!); + this._globalTransforms.set(partInstance.info!.GUID!, mat!) + getTransforms(child, mat!) } } private FindAncestorialBreak(partA: string, partB: string): [string, string] { if (!this._partTreeValues.has(partA) || !this._partTreeValues.has(partB)) { - this._errors.push([ParseErrorSeverity.LikelyIssues, 'Part not found in tree.']); - return [partA, partB]; + this._errors.push([ParseErrorSeverity.LikelyIssues, "Part not found in tree."]) + return [partA, partB] } else if (partA == partB) { - this._errors.push([ParseErrorSeverity.LikelyIssues, 'Part A and B are the same.']); + this._errors.push([ParseErrorSeverity.LikelyIssues, "Part A and B are the same."]) } - const ptv = this._partTreeValues; - let pathA = this._designHierarchyRoot; - let pathB = this._designHierarchyRoot; - const valueA = ptv.get(partA)!; - const valueB = ptv.get(partB)!; + const ptv = this._partTreeValues + let pathA = this._designHierarchyRoot + let pathB = this._designHierarchyRoot + const valueA = ptv.get(partA)! + const valueB = ptv.get(partB)! while (pathA.value! == pathB.value! && pathA.value! != partA && pathB.value! != partB) { - const ancestorIndexA = this.BinarySearchIndex(valueA, pathA.children!); - const ancestorValueA = ptv.get(pathA.children![ancestorIndexA].value!)!; - pathA = pathA.children![ancestorIndexA + (ancestorValueA < valueA ? 1 : 0)]; + const ancestorIndexA = this.BinarySearchIndex(valueA, pathA.children!) + const ancestorValueA = ptv.get(pathA.children![ancestorIndexA].value!)! + pathA = pathA.children![ancestorIndexA + (ancestorValueA < valueA ? 1 : 0)] - const ancestorIndexB = this.BinarySearchIndex(valueB, pathB.children!); - const ancestorValueB = ptv.get(pathB.children![ancestorIndexB].value!)!; - pathB = pathB.children![ancestorIndexB + (ancestorValueB < valueB ? 1 : 0)]; + const ancestorIndexB = this.BinarySearchIndex(valueB, pathB.children!) + const ancestorValueB = ptv.get(pathB.children![ancestorIndexB].value!)! + pathB = pathB.children![ancestorIndexB + (ancestorValueB < valueB ? 1 : 0)] } if (pathA.value! == partA && pathA.value! == pathB.value!) { - const ancestorIndexB = this.BinarySearchIndex(valueB, pathB.children!); - const ancestorValueB = ptv.get(pathB.children![ancestorIndexB].value!)!; - pathB = pathB.children![ancestorIndexB + (ancestorValueB < valueB ? 1 : 0)]; + const ancestorIndexB = this.BinarySearchIndex(valueB, pathB.children!) + const ancestorValueB = ptv.get(pathB.children![ancestorIndexB].value!)! + pathB = pathB.children![ancestorIndexB + (ancestorValueB < valueB ? 1 : 0)] } else if (pathB.value! == partB && pathA.value! == pathB.value!) { - const ancestorIndexA = this.BinarySearchIndex(valueA, pathA.children!); - const ancestorValueA = ptv.get(pathA.children![ancestorIndexA].value!)!; - pathA = pathA.children![ancestorIndexA + (ancestorValueA < valueA ? 1 : 0)]; + const ancestorIndexA = this.BinarySearchIndex(valueA, pathA.children!) + const ancestorValueA = ptv.get(pathA.children![ancestorIndexA].value!)! + pathA = pathA.children![ancestorIndexA + (ancestorValueA < valueA ? 1 : 0)] } - return [pathA.value!, pathB.value!]; + return [pathA.value!, pathB.value!] } private BinarySearchIndex(target: number, children: mirabuf.INode[]): number { - let l = 0; - let h = children.length; + let l = 0 + let h = children.length while (h - l > 1) { - const i = Math.floor((h + l) / 2.0); - const iVal = this._partTreeValues.get(children[i].value!)!; + const i = Math.floor((h + l) / 2.0) + const iVal = this._partTreeValues.get(children[i].value!)! if (iVal > target) { - h = i; + h = i } else if (iVal < target) { - l = i + 1; + l = i + 1 } else { - return i; + return i } } - return Math.floor((h + l) / 2.0); + return Math.floor((h + l) / 2.0) } private BinarySearchDesignTree(target: string): mirabuf.INode | null { - let node = this._designHierarchyRoot; - const targetValue = this._partTreeValues.get(target)!; + let node = this._designHierarchyRoot + const targetValue = this._partTreeValues.get(target)! while (node.value != target && node.children) { - const i = this.BinarySearchIndex(targetValue, node.children!); - const iValue = this._partTreeValues.get(node.children![i].value!)!; - node = node.children![i + (iValue < targetValue ? 1 : 0)]; + const i = this.BinarySearchIndex(targetValue, node.children!) + const iValue = this._partTreeValues.get(node.children![i].value!)! + node = node.children![i + (iValue < targetValue ? 1 : 0)] } - return node.value! == target ? node : null; + return node.value! == target ? node : null } private GenerateTreeValues() { - let nextValue = 0; - const partTreeValues = new Map(); + let nextValue = 0 + const partTreeValues = new Map() const recursive = (partNode: mirabuf.INode) => { - partNode.children = partNode.children?.filter(x => x.value != null); - partNode.children?.forEach(x => recursive(x)); - partTreeValues.set(partNode.value!, nextValue++); + partNode.children = partNode.children?.filter(x => x.value != null) + partNode.children?.forEach(x => recursive(x)) + partTreeValues.set(partNode.value!, nextValue++) } - this._designHierarchyRoot = new mirabuf.Node(); - this._designHierarchyRoot.value = "Importer Generated Root"; - this._designHierarchyRoot.children = []; - this._designHierarchyRoot.children.push(...this._assembly.designHierarchy!.nodes!); + this._designHierarchyRoot = new mirabuf.Node() + this._designHierarchyRoot.value = "Importer Generated Root" + this._designHierarchyRoot.children = [] + this._designHierarchyRoot.children.push(...this._assembly.designHierarchy!.nodes!) - recursive(this._designHierarchyRoot); - this._partTreeValues = partTreeValues; + recursive(this._designHierarchyRoot) + this._partTreeValues = partTreeValues } } @@ -375,77 +398,77 @@ class MirabufParser { * Collection of mirabuf parts that are bound together */ class RigidNode { - public isRoot: boolean; - public id: string; - public parts: Set = new Set(); - public isDynamic: boolean; + public isRoot: boolean + public id: string + public parts: Set = new Set() + public isDynamic: boolean public constructor(id: string, isDynamic?: boolean) { - this.id = id; - this.isDynamic = isDynamic ?? true; - this.isRoot = false; + this.id = id + this.isDynamic = isDynamic ?? true + this.isRoot = false } } export class RigidNodeReadOnly { - private _original: RigidNode; - + private _original: RigidNode + public get id(): string { - return this._original.id; + return this._original.id } public get parts(): ReadonlySet { - return this._original.parts; + return this._original.parts } public get isDynamic(): boolean { - return this._original.isDynamic; + return this._original.isDynamic } - public get isRoot(): boolean { return this._original.isRoot; } + public get isRoot(): boolean { + return this._original.isRoot + } public constructor(original: RigidNode) { - this._original = original; + this._original = original } } export class Graph { - private _adjacencyMap: Map; + private _adjacencyMap: Map public get nodes() { - return this._adjacencyMap.keys(); + return this._adjacencyMap.keys() } public constructor() { - this._adjacencyMap = new Map(); + this._adjacencyMap = new Map() } public AddNode(node: string) { - if (!this._adjacencyMap.has(node)) - this._adjacencyMap.set(node, new Array()); + if (!this._adjacencyMap.has(node)) this._adjacencyMap.set(node, new Array()) } public AddEdgeUndirected(nodeA: string, nodeB: string) { - if (!this._adjacencyMap.has(nodeA) || !this._adjacencyMap.has(nodeB)) - throw new Error("Nodes aren't in graph"); + if (!this._adjacencyMap.has(nodeA) || !this._adjacencyMap.has(nodeB)) throw new Error("Nodes aren't in graph") - this._adjacencyMap.get(nodeA)!.push(nodeB); - this._adjacencyMap.get(nodeB)!.push(nodeA); + this._adjacencyMap.get(nodeA)!.push(nodeB) + this._adjacencyMap.get(nodeB)!.push(nodeA) } public AddEdgeDirected(nodeA: string, nodeB: string) { - if (!this._adjacencyMap.has(nodeA) || !this._adjacencyMap.has(nodeB)) - throw new Error("Nodes aren't in graph"); + if (!this._adjacencyMap.has(nodeA) || !this._adjacencyMap.has(nodeB)) throw new Error("Nodes aren't in graph") - this._adjacencyMap.get(nodeA)!.push(nodeB); + this._adjacencyMap.get(nodeA)!.push(nodeB) } public GetAdjacencyList(node: string) { - if (!this._adjacencyMap.has(node)) { // Don't remove this. Without this check initially, Map.get *randomly* fails. I have no clue why... - throw new Error(`Node '${node}' is not in adjacency list`); + if (!this._adjacencyMap.has(node)) { + // Don't remove this. Without this check initially, Map.get *randomly* fails. I have no clue why... + throw new Error(`Node '${node}' is not in adjacency list`) } - return this._adjacencyMap.get(node)!; + return this._adjacencyMap.get(node)! } } -export default MirabufParser; +export default MirabufParser diff --git a/fission/src/mirabuf/MirabufSceneObject.ts b/fission/src/mirabuf/MirabufSceneObject.ts index 34a98b539c..ef6f34fef9 100644 --- a/fission/src/mirabuf/MirabufSceneObject.ts +++ b/fission/src/mirabuf/MirabufSceneObject.ts @@ -1,31 +1,30 @@ -import { mirabuf } from "@/proto/mirabuf"; -import SceneObject from "../systems/scene/SceneObject"; -import MirabufInstance from "./MirabufInstance"; -import { LoadMirabufRemote } from "./MirabufLoader"; -import MirabufParser, { ParseErrorSeverity } from "./MirabufParser"; -import World from "@/systems/World"; -import Jolt from '@barclah/jolt-physics'; -import { JoltMat44_ThreeMatrix4 } from "@/util/TypeConversions"; -import * as THREE from 'three'; -import JOLT from "@/util/loading/JoltSyncLoader"; -import { LayerReserve } from "@/systems/physics/PhysicsSystem"; -import Mechanism from "@/systems/physics/Mechanism"; -import SynthesisBrain from "@/systems/simulation/synthesis_brain/SynthesisBrain"; - -const DEBUG_BODIES = true; +import { mirabuf } from "@/proto/mirabuf" +import SceneObject from "../systems/scene/SceneObject" +import MirabufInstance from "./MirabufInstance" +import { LoadMirabufRemote } from "./MirabufLoader" +import MirabufParser, { ParseErrorSeverity } from "./MirabufParser" +import World from "@/systems/World" +import Jolt from "@barclah/jolt-physics" +import { JoltMat44_ThreeMatrix4 } from "@/util/TypeConversions" +import * as THREE from "three" +import JOLT from "@/util/loading/JoltSyncLoader" +import { LayerReserve } from "@/systems/physics/PhysicsSystem" +import Mechanism from "@/systems/physics/Mechanism" +import SynthesisBrain from "@/systems/simulation/synthesis_brain/SynthesisBrain" + +const DEBUG_BODIES = true interface RnDebugMeshes { - colliderMesh: THREE.Mesh; - comMesh: THREE.Mesh; + colliderMesh: THREE.Mesh + comMesh: THREE.Mesh } class MirabufSceneObject extends SceneObject { + private _mirabufInstance: MirabufInstance + private _debugBodies: Map | null + private _physicsLayerReserve: LayerReserve | undefined = undefined - private _mirabufInstance: MirabufInstance; - private _debugBodies: Map | null; - private _physicsLayerReserve: LayerReserve | undefined = undefined; - - private _mechanism: Mechanism; + private _mechanism: Mechanism public constructor(mirabufInstance: MirabufInstance) { super() @@ -36,118 +35,137 @@ class MirabufSceneObject extends SceneObject { if (this._mechanism.layerReserve) { this._physicsLayerReserve = this._mechanism.layerReserve } - + this._debugBodies = null } public Setup(): void { // Rendering - this._mirabufInstance.AddToScene(World.SceneRenderer.scene); + this._mirabufInstance.AddToScene(World.SceneRenderer.scene) if (DEBUG_BODIES) { - this._debugBodies = new Map(); + this._debugBodies = new Map() this._mechanism.nodeToBody.forEach((bodyId, rnName) => { - - const body = World.PhysicsSystem.GetBody(bodyId); - - const colliderMesh = this.CreateMeshForShape(body.GetShape()); - const comMesh = World.SceneRenderer.CreateSphere(0.05); - World.SceneRenderer.scene.add(colliderMesh); - World.SceneRenderer.scene.add(comMesh); - (comMesh.material as THREE.Material).depthTest = false; - this._debugBodies!.set(rnName, { colliderMesh: colliderMesh, comMesh: comMesh }); - }); + const body = World.PhysicsSystem.GetBody(bodyId) + + const colliderMesh = this.CreateMeshForShape(body.GetShape()) + const comMesh = World.SceneRenderer.CreateSphere(0.05) + World.SceneRenderer.scene.add(colliderMesh) + World.SceneRenderer.scene.add(comMesh) + ;(comMesh.material as THREE.Material).depthTest = false + this._debugBodies!.set(rnName, { + colliderMesh: colliderMesh, + comMesh: comMesh, + }) + }) } // Simulation - World.SimulationSystem.RegisterMechanism(this._mechanism); - const simLayer = World.SimulationSystem.GetSimulationLayer(this._mechanism)!; - const brain = new SynthesisBrain(this._mechanism); - simLayer.SetBrain(brain); + World.SimulationSystem.RegisterMechanism(this._mechanism) + const simLayer = World.SimulationSystem.GetSimulationLayer(this._mechanism)! + const brain = new SynthesisBrain(this._mechanism) + simLayer.SetBrain(brain) } public Update(): void { this._mirabufInstance.parser.rigidNodes.forEach(rn => { - const body = World.PhysicsSystem.GetBody(this._mechanism.GetBodyByNodeId(rn.id)!); - const transform = JoltMat44_ThreeMatrix4(body.GetWorldTransform()); + const body = World.PhysicsSystem.GetBody(this._mechanism.GetBodyByNodeId(rn.id)!) + const transform = JoltMat44_ThreeMatrix4(body.GetWorldTransform()) rn.parts.forEach(part => { - const partTransform = this._mirabufInstance.parser.globalTransforms.get(part)!.clone().premultiply(transform); + const partTransform = this._mirabufInstance.parser.globalTransforms + .get(part)! + .clone() + .premultiply(transform) this._mirabufInstance.meshes.get(part)!.forEach(mesh => { - mesh.position.setFromMatrixPosition(partTransform); - mesh.rotation.setFromRotationMatrix(partTransform); - }); - }); + mesh.position.setFromMatrixPosition(partTransform) + mesh.rotation.setFromRotationMatrix(partTransform) + }) + }) if (isNaN(body.GetPosition().GetX())) { - const vel = body.GetLinearVelocity(); - const pos = body.GetPosition(); - console.warn(`Invalid Position.\nPosition => ${pos.GetX()}, ${pos.GetY()}, ${pos.GetZ()}\nVelocity => ${vel.GetX()}, ${vel.GetY()}, ${vel.GetZ()}`); + const vel = body.GetLinearVelocity() + const pos = body.GetPosition() + console.warn( + `Invalid Position.\nPosition => ${pos.GetX()}, ${pos.GetY()}, ${pos.GetZ()}\nVelocity => ${vel.GetX()}, ${vel.GetY()}, ${vel.GetZ()}` + ) } // console.debug(`POSITION: ${body.GetPosition().GetX()}, ${body.GetPosition().GetY()}, ${body.GetPosition().GetZ()}`) if (this._debugBodies) { - const { colliderMesh, comMesh } = this._debugBodies.get(rn.id)!; - colliderMesh.position.setFromMatrixPosition(transform); - colliderMesh.rotation.setFromRotationMatrix(transform); + const { colliderMesh, comMesh } = this._debugBodies.get(rn.id)! + colliderMesh.position.setFromMatrixPosition(transform) + colliderMesh.rotation.setFromRotationMatrix(transform) - const comTransform = JoltMat44_ThreeMatrix4(body.GetCenterOfMassTransform()); - comMesh.position.setFromMatrixPosition(comTransform); - comMesh.rotation.setFromRotationMatrix(comTransform); + const comTransform = JoltMat44_ThreeMatrix4(body.GetCenterOfMassTransform()) + comMesh.position.setFromMatrixPosition(comTransform) + comMesh.rotation.setFromRotationMatrix(comTransform) } - }); + }) } public Dispose(): void { World.SimulationSystem.UnregisterMechanism(this._mechanism) - World.PhysicsSystem.DestroyMechanism(this._mechanism); - this._mirabufInstance.Dispose(World.SceneRenderer.scene); + World.PhysicsSystem.DestroyMechanism(this._mechanism) + this._mirabufInstance.Dispose(World.SceneRenderer.scene) this._debugBodies?.forEach(x => { - World.SceneRenderer.scene.remove(x.colliderMesh, x.comMesh); - x.colliderMesh.geometry.dispose(); - x.comMesh.geometry.dispose(); - (x.colliderMesh.material as THREE.Material).dispose(); - (x.comMesh.material as THREE.Material).dispose(); - }); - this._debugBodies?.clear(); - this._physicsLayerReserve?.Release(); + World.SceneRenderer.scene.remove(x.colliderMesh, x.comMesh) + x.colliderMesh.geometry.dispose() + x.comMesh.geometry.dispose() + ;(x.colliderMesh.material as THREE.Material).dispose() + ;(x.comMesh.material as THREE.Material).dispose() + }) + this._debugBodies?.clear() + this._physicsLayerReserve?.Release() } private CreateMeshForShape(shape: Jolt.Shape): THREE.Mesh { - const scale = new JOLT.Vec3(1, 1, 1); - const triangleContext = new JOLT.ShapeGetTriangles(shape, JOLT.AABox.prototype.sBiggest(), shape.GetCenterOfMass(), JOLT.Quat.prototype.sIdentity(), scale); - JOLT.destroy(scale); - - const vertices = new Float32Array(JOLT.HEAP32.buffer, triangleContext.GetVerticesData(), triangleContext.GetVerticesSize() / Float32Array.BYTES_PER_ELEMENT); - const buffer = new THREE.BufferAttribute(vertices, 3).clone(); - JOLT.destroy(triangleContext); - - const geometry = new THREE.BufferGeometry(); - geometry.setAttribute('position', buffer); - geometry.computeVertexNormals(); - - const material = new THREE.MeshStandardMaterial({ color: 0x33ff33, wireframe: true }) - const mesh = new THREE.Mesh(geometry, material); - mesh.castShadow = true; - - return mesh; + const scale = new JOLT.Vec3(1, 1, 1) + const triangleContext = new JOLT.ShapeGetTriangles( + shape, + JOLT.AABox.prototype.sBiggest(), + shape.GetCenterOfMass(), + JOLT.Quat.prototype.sIdentity(), + scale + ) + JOLT.destroy(scale) + + const vertices = new Float32Array( + JOLT.HEAP32.buffer, + triangleContext.GetVerticesData(), + triangleContext.GetVerticesSize() / Float32Array.BYTES_PER_ELEMENT + ) + const buffer = new THREE.BufferAttribute(vertices, 3).clone() + JOLT.destroy(triangleContext) + + const geometry = new THREE.BufferGeometry() + geometry.setAttribute("position", buffer) + geometry.computeVertexNormals() + + const material = new THREE.MeshStandardMaterial({ + color: 0x33ff33, + wireframe: true, + }) + const mesh = new THREE.Mesh(geometry, material) + mesh.castShadow = true + + return mesh } } export async function CreateMirabufFromUrl(path: string): Promise { - const miraAssembly = await LoadMirabufRemote(path) - .catch(console.error); + const miraAssembly = await LoadMirabufRemote(path).catch(console.error) if (!miraAssembly || !(miraAssembly instanceof mirabuf.Assembly)) { - return; + return } - const parser = new MirabufParser(miraAssembly); + const parser = new MirabufParser(miraAssembly) if (parser.maxErrorSeverity >= ParseErrorSeverity.Unimportable) { - console.error(`Assembly Parser produced significant errors for '${miraAssembly.info!.name!}'`); - return; + console.error(`Assembly Parser produced significant errors for '${miraAssembly.info!.name!}'`) + return } - - return new MirabufSceneObject(new MirabufInstance(parser)); + + return new MirabufSceneObject(new MirabufInstance(parser)) } -export default MirabufSceneObject; \ No newline at end of file +export default MirabufSceneObject diff --git a/fission/src/proto/mirabuf.d.ts b/fission/src/proto/mirabuf.d.ts index a10e89a8f9..755e156046 100644 --- a/fission/src/proto/mirabuf.d.ts +++ b/fission/src/proto/mirabuf.d.ts @@ -1,34 +1,32 @@ -import * as $protobuf from "protobufjs"; -import Long = require("long"); +import * as $protobuf from "protobufjs" +import Long = require("long") /** Namespace mirabuf. */ export namespace mirabuf { - /** Properties of an Assembly. */ interface IAssembly { - /** Basic information (name, Author, etc) */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** All of the data in the assembly */ - data?: (mirabuf.IAssemblyData|null); + data?: mirabuf.IAssemblyData | null /** Can it be effected by the simulation dynamically */ - dynamic?: (boolean|null); + dynamic?: boolean | null /** Overall physical data of the assembly */ - physicalData?: (mirabuf.IPhysicalProperties|null); + physicalData?: mirabuf.IPhysicalProperties | null /** The Design hierarchy represented by Part Refs - The first object is a root container for all top level items */ - designHierarchy?: (mirabuf.IGraphContainer|null); + designHierarchy?: mirabuf.IGraphContainer | null /** The Joint hierarchy for compound shapes */ - jointHierarchy?: (mirabuf.IGraphContainer|null); + jointHierarchy?: mirabuf.IGraphContainer | null /** The Transform in space currently */ - transform?: (mirabuf.ITransform|null); + transform?: mirabuf.ITransform | null /** Optional thumbnail saved from Fusion 360 or scraped from previous configuration */ - thumbnail?: (mirabuf.IThumbnail|null); + thumbnail?: mirabuf.IThumbnail | null } /** @@ -37,43 +35,42 @@ export namespace mirabuf { * THIS IS THE CURRENT FILE EXPORTED */ class Assembly implements IAssembly { - /** * Constructs a new Assembly. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IAssembly); + constructor(properties?: mirabuf.IAssembly) /** Basic information (name, Author, etc) */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** All of the data in the assembly */ - public data?: (mirabuf.IAssemblyData|null); + public data?: mirabuf.IAssemblyData | null /** Can it be effected by the simulation dynamically */ - public dynamic: boolean; + public dynamic: boolean /** Overall physical data of the assembly */ - public physicalData?: (mirabuf.IPhysicalProperties|null); + public physicalData?: mirabuf.IPhysicalProperties | null /** The Design hierarchy represented by Part Refs - The first object is a root container for all top level items */ - public designHierarchy?: (mirabuf.IGraphContainer|null); + public designHierarchy?: mirabuf.IGraphContainer | null /** The Joint hierarchy for compound shapes */ - public jointHierarchy?: (mirabuf.IGraphContainer|null); + public jointHierarchy?: mirabuf.IGraphContainer | null /** The Transform in space currently */ - public transform?: (mirabuf.ITransform|null); + public transform?: mirabuf.ITransform | null /** Optional thumbnail saved from Fusion 360 or scraped from previous configuration */ - public thumbnail?: (mirabuf.IThumbnail|null); + public thumbnail?: mirabuf.IThumbnail | null /** * Creates a new Assembly instance using the specified properties. * @param [properties] Properties to set * @returns Assembly instance */ - public static create(properties?: mirabuf.IAssembly): mirabuf.Assembly; + public static create(properties?: mirabuf.IAssembly): mirabuf.Assembly /** * Encodes the specified Assembly message. Does not implicitly {@link mirabuf.Assembly.verify|verify} messages. @@ -81,7 +78,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IAssembly, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IAssembly, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Assembly message, length delimited. Does not implicitly {@link mirabuf.Assembly.verify|verify} messages. @@ -89,7 +86,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IAssembly, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IAssembly, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes an Assembly message from the specified reader or buffer. @@ -99,7 +96,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.Assembly; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.Assembly /** * Decodes an Assembly message from the specified reader or buffer, length delimited. @@ -108,21 +105,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.Assembly; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.Assembly /** * Verifies an Assembly message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates an Assembly message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Assembly */ - public static fromObject(object: { [k: string]: any }): mirabuf.Assembly; + public static fromObject(object: { [k: string]: any }): mirabuf.Assembly /** * Creates a plain object from an Assembly message. Also converts values to other types if specified. @@ -130,65 +127,63 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.Assembly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.Assembly, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this Assembly to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Assembly * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of an AssemblyData. */ interface IAssemblyData { - /** Meshes and Design Objects */ - parts?: (mirabuf.IParts|null); + parts?: mirabuf.IParts | null /** Joint Definition Set */ - joints?: (mirabuf.joint.IJoints|null); + joints?: mirabuf.joint.IJoints | null /** Appearance and Physical Material Set */ - materials?: (mirabuf.material.IMaterials|null); + materials?: mirabuf.material.IMaterials | null /** AssemblyData signals */ - signals?: (mirabuf.signal.ISignals|null); + signals?: mirabuf.signal.ISignals | null } /** Data used to construct the assembly */ class AssemblyData implements IAssemblyData { - /** * Constructs a new AssemblyData. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IAssemblyData); + constructor(properties?: mirabuf.IAssemblyData) /** Meshes and Design Objects */ - public parts?: (mirabuf.IParts|null); + public parts?: mirabuf.IParts | null /** Joint Definition Set */ - public joints?: (mirabuf.joint.IJoints|null); + public joints?: mirabuf.joint.IJoints | null /** Appearance and Physical Material Set */ - public materials?: (mirabuf.material.IMaterials|null); + public materials?: mirabuf.material.IMaterials | null /** AssemblyData signals. */ - public signals?: (mirabuf.signal.ISignals|null); + public signals?: mirabuf.signal.ISignals | null /** * Creates a new AssemblyData instance using the specified properties. * @param [properties] Properties to set * @returns AssemblyData instance */ - public static create(properties?: mirabuf.IAssemblyData): mirabuf.AssemblyData; + public static create(properties?: mirabuf.IAssemblyData): mirabuf.AssemblyData /** * Encodes the specified AssemblyData message. Does not implicitly {@link mirabuf.AssemblyData.verify|verify} messages. @@ -196,7 +191,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IAssemblyData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IAssemblyData, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified AssemblyData message, length delimited. Does not implicitly {@link mirabuf.AssemblyData.verify|verify} messages. @@ -204,7 +199,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IAssemblyData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IAssemblyData, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes an AssemblyData message from the specified reader or buffer. @@ -214,7 +209,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.AssemblyData; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.AssemblyData /** * Decodes an AssemblyData message from the specified reader or buffer, length delimited. @@ -223,21 +218,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.AssemblyData; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.AssemblyData /** * Verifies an AssemblyData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates an AssemblyData message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns AssemblyData */ - public static fromObject(object: { [k: string]: any }): mirabuf.AssemblyData; + public static fromObject(object: { [k: string]: any }): mirabuf.AssemblyData /** * Creates a plain object from an AssemblyData message. Also converts values to other types if specified. @@ -245,65 +240,66 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.AssemblyData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.AssemblyData, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this AssemblyData to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for AssemblyData * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Parts. */ interface IParts { - /** Part name, version, GUID */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Map of the Exported Part Definitions */ - partDefinitions?: ({ [k: string]: mirabuf.IPartDefinition }|null); + partDefinitions?: { [k: string]: mirabuf.IPartDefinition } | null /** Map of the Exported Parts that make up the object */ - partInstances?: ({ [k: string]: mirabuf.IPartInstance }|null); + partInstances?: { [k: string]: mirabuf.IPartInstance } | null /** other associated data that can be used */ - userData?: (mirabuf.IUserData|null); + userData?: mirabuf.IUserData | null } /** Represents a Parts. */ class Parts implements IParts { - /** * Constructs a new Parts. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IParts); + constructor(properties?: mirabuf.IParts) /** Part name, version, GUID */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Map of the Exported Part Definitions */ - public partDefinitions: { [k: string]: mirabuf.IPartDefinition }; + public partDefinitions: { [k: string]: mirabuf.IPartDefinition } /** Map of the Exported Parts that make up the object */ - public partInstances: { [k: string]: mirabuf.IPartInstance }; + public partInstances: { [k: string]: mirabuf.IPartInstance } /** other associated data that can be used */ - public userData?: (mirabuf.IUserData|null); + public userData?: mirabuf.IUserData | null /** * Creates a new Parts instance using the specified properties. * @param [properties] Properties to set * @returns Parts instance */ - public static create(properties?: mirabuf.IParts): mirabuf.Parts; + public static create(properties?: mirabuf.IParts): mirabuf.Parts /** * Encodes the specified Parts message. Does not implicitly {@link mirabuf.Parts.verify|verify} messages. @@ -311,7 +307,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IParts, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IParts, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Parts message, length delimited. Does not implicitly {@link mirabuf.Parts.verify|verify} messages. @@ -319,7 +315,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IParts, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IParts, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Parts message from the specified reader or buffer. @@ -329,7 +325,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.Parts; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.Parts /** * Decodes a Parts message from the specified reader or buffer, length delimited. @@ -338,21 +334,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.Parts; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.Parts /** * Verifies a Parts message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Parts message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Parts */ - public static fromObject(object: { [k: string]: any }): mirabuf.Parts; + public static fromObject(object: { [k: string]: any }): mirabuf.Parts /** * Creates a plain object from a Parts message. Also converts values to other types if specified. @@ -360,45 +356,44 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.Parts, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.Parts, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this Parts to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Parts * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a PartDefinition. */ interface IPartDefinition { - /** Information about version - id - name */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Physical data associated with Part */ - physicalData?: (mirabuf.IPhysicalProperties|null); + physicalData?: mirabuf.IPhysicalProperties | null /** Base Transform applied - Most Likely Identity Matrix */ - baseTransform?: (mirabuf.ITransform|null); + baseTransform?: mirabuf.ITransform | null /** Mesh Bodies to populate part */ - bodies?: (mirabuf.IBody[]|null); + bodies?: mirabuf.IBody[] | null /** Optional value to state whether an object is a dynamic object in a static assembly - all children are also considered overriden */ - dynamic?: (boolean|null); + dynamic?: boolean | null /** Optional value for overriding the friction value 0-1 */ - frictionOverride?: (number|null); + frictionOverride?: number | null /** Optional value for overriding an indiviaul object's mass */ - massOverride?: (number|null); + massOverride?: number | null } /** @@ -407,40 +402,39 @@ export namespace mirabuf { * Useful for keeping the object counter down in the scene. */ class PartDefinition implements IPartDefinition { - /** * Constructs a new PartDefinition. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IPartDefinition); + constructor(properties?: mirabuf.IPartDefinition) /** Information about version - id - name */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Physical data associated with Part */ - public physicalData?: (mirabuf.IPhysicalProperties|null); + public physicalData?: mirabuf.IPhysicalProperties | null /** Base Transform applied - Most Likely Identity Matrix */ - public baseTransform?: (mirabuf.ITransform|null); + public baseTransform?: mirabuf.ITransform | null /** Mesh Bodies to populate part */ - public bodies: mirabuf.IBody[]; + public bodies: mirabuf.IBody[] /** Optional value to state whether an object is a dynamic object in a static assembly - all children are also considered overriden */ - public dynamic: boolean; + public dynamic: boolean /** Optional value for overriding the friction value 0-1 */ - public frictionOverride: number; + public frictionOverride: number /** Optional value for overriding an indiviaul object's mass */ - public massOverride: number; + public massOverride: number /** * Creates a new PartDefinition instance using the specified properties. * @param [properties] Properties to set * @returns PartDefinition instance */ - public static create(properties?: mirabuf.IPartDefinition): mirabuf.PartDefinition; + public static create(properties?: mirabuf.IPartDefinition): mirabuf.PartDefinition /** * Encodes the specified PartDefinition message. Does not implicitly {@link mirabuf.PartDefinition.verify|verify} messages. @@ -448,7 +442,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IPartDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IPartDefinition, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified PartDefinition message, length delimited. Does not implicitly {@link mirabuf.PartDefinition.verify|verify} messages. @@ -456,7 +450,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IPartDefinition, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IPartDefinition, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a PartDefinition message from the specified reader or buffer. @@ -466,7 +460,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.PartDefinition; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.PartDefinition /** * Decodes a PartDefinition message from the specified reader or buffer, length delimited. @@ -475,21 +469,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.PartDefinition; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.PartDefinition /** * Verifies a PartDefinition message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a PartDefinition message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns PartDefinition */ - public static fromObject(object: { [k: string]: any }): mirabuf.PartDefinition; + public static fromObject(object: { [k: string]: any }): mirabuf.PartDefinition /** * Creates a plain object from a PartDefinition message. Also converts values to other types if specified. @@ -497,89 +491,90 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.PartDefinition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.PartDefinition, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this PartDefinition to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for PartDefinition * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a PartInstance. */ interface IPartInstance { - /** PartInstance info */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Reference to the Part Definition defined in Assembly Data */ - partDefinitionReference?: (string|null); + partDefinitionReference?: string | null /** Overriding the object transform (moves the part from the def) - in design hierarchy context */ - transform?: (mirabuf.ITransform|null); + transform?: mirabuf.ITransform | null /** Position transform from a global scope */ - globalTransform?: (mirabuf.ITransform|null); + globalTransform?: mirabuf.ITransform | null /** Joints that interact with this element */ - joints?: (string[]|null); + joints?: string[] | null /** PartInstance appearance */ - appearance?: (string|null); + appearance?: string | null /** Physical Material Reference to link to `Materials->PhysicalMaterial->Info->id` */ - physicalMaterial?: (string|null); + physicalMaterial?: string | null /** Flag that if enabled indicates we should skip generating a collider, defaults to FALSE or undefined */ - skipCollider?: (boolean|null); + skipCollider?: boolean | null } /** Represents a PartInstance. */ class PartInstance implements IPartInstance { - /** * Constructs a new PartInstance. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IPartInstance); + constructor(properties?: mirabuf.IPartInstance) /** PartInstance info. */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Reference to the Part Definition defined in Assembly Data */ - public partDefinitionReference: string; + public partDefinitionReference: string /** Overriding the object transform (moves the part from the def) - in design hierarchy context */ - public transform?: (mirabuf.ITransform|null); + public transform?: mirabuf.ITransform | null /** Position transform from a global scope */ - public globalTransform?: (mirabuf.ITransform|null); + public globalTransform?: mirabuf.ITransform | null /** Joints that interact with this element */ - public joints: string[]; + public joints: string[] /** PartInstance appearance. */ - public appearance: string; + public appearance: string /** Physical Material Reference to link to `Materials->PhysicalMaterial->Info->id` */ - public physicalMaterial: string; + public physicalMaterial: string /** Flag that if enabled indicates we should skip generating a collider, defaults to FALSE or undefined */ - public skipCollider: boolean; + public skipCollider: boolean /** * Creates a new PartInstance instance using the specified properties. * @param [properties] Properties to set * @returns PartInstance instance */ - public static create(properties?: mirabuf.IPartInstance): mirabuf.PartInstance; + public static create(properties?: mirabuf.IPartInstance): mirabuf.PartInstance /** * Encodes the specified PartInstance message. Does not implicitly {@link mirabuf.PartInstance.verify|verify} messages. @@ -587,7 +582,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IPartInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IPartInstance, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified PartInstance message, length delimited. Does not implicitly {@link mirabuf.PartInstance.verify|verify} messages. @@ -595,7 +590,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IPartInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IPartInstance, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a PartInstance message from the specified reader or buffer. @@ -605,7 +600,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.PartInstance; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.PartInstance /** * Decodes a PartInstance message from the specified reader or buffer, length delimited. @@ -614,21 +609,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.PartInstance; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.PartInstance /** * Verifies a PartInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a PartInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns PartInstance */ - public static fromObject(object: { [k: string]: any }): mirabuf.PartInstance; + public static fromObject(object: { [k: string]: any }): mirabuf.PartInstance /** * Creates a plain object from a PartInstance message. Also converts values to other types if specified. @@ -636,65 +631,66 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.PartInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.PartInstance, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this PartInstance to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for PartInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Body. */ interface IBody { - /** Body info */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Reference to Part Definition */ - part?: (string|null); + part?: string | null /** Triangle Mesh for rendering */ - triangleMesh?: (mirabuf.ITriangleMesh|null); + triangleMesh?: mirabuf.ITriangleMesh | null /** Override Visual Appearance for the body */ - appearanceOverride?: (string|null); + appearanceOverride?: string | null } /** Represents a Body. */ class Body implements IBody { - /** * Constructs a new Body. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IBody); + constructor(properties?: mirabuf.IBody) /** Body info. */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Reference to Part Definition */ - public part: string; + public part: string /** Triangle Mesh for rendering */ - public triangleMesh?: (mirabuf.ITriangleMesh|null); + public triangleMesh?: mirabuf.ITriangleMesh | null /** Override Visual Appearance for the body */ - public appearanceOverride: string; + public appearanceOverride: string /** * Creates a new Body instance using the specified properties. * @param [properties] Properties to set * @returns Body instance */ - public static create(properties?: mirabuf.IBody): mirabuf.Body; + public static create(properties?: mirabuf.IBody): mirabuf.Body /** * Encodes the specified Body message. Does not implicitly {@link mirabuf.Body.verify|verify} messages. @@ -702,7 +698,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IBody, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IBody, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Body message, length delimited. Does not implicitly {@link mirabuf.Body.verify|verify} messages. @@ -710,7 +706,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IBody, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IBody, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Body message from the specified reader or buffer. @@ -720,7 +716,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.Body; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.Body /** * Decodes a Body message from the specified reader or buffer, length delimited. @@ -729,21 +725,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.Body; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.Body /** * Verifies a Body message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Body message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Body */ - public static fromObject(object: { [k: string]: any }): mirabuf.Body; + public static fromObject(object: { [k: string]: any }): mirabuf.Body /** * Creates a plain object from a Body message. Also converts values to other types if specified. @@ -751,74 +747,72 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.Body, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.Body, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this Body to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Body * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a TriangleMesh. */ interface ITriangleMesh { - /** TriangleMesh info */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Is this object a Plane ? (Does it have volume) */ - hasVolume?: (boolean|null); + hasVolume?: boolean | null /** Rendered Appearance properties referenced from Assembly Data */ - materialReference?: (string|null); + materialReference?: string | null /** Stored as true types, inidicies, verts, uv */ - mesh?: (mirabuf.IMesh|null); + mesh?: mirabuf.IMesh | null /** Stored as binary data in bytes */ - bmesh?: (mirabuf.IBinaryMesh|null); + bmesh?: mirabuf.IBinaryMesh | null } /** Traingle Mesh for Storing Display Mesh data */ class TriangleMesh implements ITriangleMesh { - /** * Constructs a new TriangleMesh. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.ITriangleMesh); + constructor(properties?: mirabuf.ITriangleMesh) /** TriangleMesh info. */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Is this object a Plane ? (Does it have volume) */ - public hasVolume: boolean; + public hasVolume: boolean /** Rendered Appearance properties referenced from Assembly Data */ - public materialReference: string; + public materialReference: string /** Stored as true types, inidicies, verts, uv */ - public mesh?: (mirabuf.IMesh|null); + public mesh?: mirabuf.IMesh | null /** Stored as binary data in bytes */ - public bmesh?: (mirabuf.IBinaryMesh|null); + public bmesh?: mirabuf.IBinaryMesh | null /** What kind of Mesh Data exists in this Triangle Mesh */ - public meshType?: ("mesh"|"bmesh"); + public meshType?: "mesh" | "bmesh" /** * Creates a new TriangleMesh instance using the specified properties. * @param [properties] Properties to set * @returns TriangleMesh instance */ - public static create(properties?: mirabuf.ITriangleMesh): mirabuf.TriangleMesh; + public static create(properties?: mirabuf.ITriangleMesh): mirabuf.TriangleMesh /** * Encodes the specified TriangleMesh message. Does not implicitly {@link mirabuf.TriangleMesh.verify|verify} messages. @@ -826,7 +820,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.ITriangleMesh, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.ITriangleMesh, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified TriangleMesh message, length delimited. Does not implicitly {@link mirabuf.TriangleMesh.verify|verify} messages. @@ -834,7 +828,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.ITriangleMesh, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.ITriangleMesh, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a TriangleMesh message from the specified reader or buffer. @@ -844,7 +838,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.TriangleMesh; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.TriangleMesh /** * Decodes a TriangleMesh message from the specified reader or buffer, length delimited. @@ -853,21 +847,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.TriangleMesh; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.TriangleMesh /** * Verifies a TriangleMesh message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a TriangleMesh message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns TriangleMesh */ - public static fromObject(object: { [k: string]: any }): mirabuf.TriangleMesh; + public static fromObject(object: { [k: string]: any }): mirabuf.TriangleMesh /** * Creates a plain object from a TriangleMesh message. Also converts values to other types if specified. @@ -875,65 +869,66 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.TriangleMesh, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.TriangleMesh, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this TriangleMesh to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for TriangleMesh * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Mesh. */ interface IMesh { - /** Tri Mesh Verts vec3 */ - verts?: (number[]|null); + verts?: number[] | null /** Tri Mesh Normals vec3 */ - normals?: (number[]|null); + normals?: number[] | null /** Tri Mesh uv Mapping vec2 */ - uv?: (number[]|null); + uv?: number[] | null /** Tri Mesh indicies (Vert Map) */ - indices?: (number[]|null); + indices?: number[] | null } /** Mesh Data stored as generic Data Structure */ class Mesh implements IMesh { - /** * Constructs a new Mesh. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IMesh); + constructor(properties?: mirabuf.IMesh) /** Tri Mesh Verts vec3 */ - public verts: number[]; + public verts: number[] /** Tri Mesh Normals vec3 */ - public normals: number[]; + public normals: number[] /** Tri Mesh uv Mapping vec2 */ - public uv: number[]; + public uv: number[] /** Tri Mesh indicies (Vert Map) */ - public indices: number[]; + public indices: number[] /** * Creates a new Mesh instance using the specified properties. * @param [properties] Properties to set * @returns Mesh instance */ - public static create(properties?: mirabuf.IMesh): mirabuf.Mesh; + public static create(properties?: mirabuf.IMesh): mirabuf.Mesh /** * Encodes the specified Mesh message. Does not implicitly {@link mirabuf.Mesh.verify|verify} messages. @@ -941,7 +936,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IMesh, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IMesh, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Mesh message, length delimited. Does not implicitly {@link mirabuf.Mesh.verify|verify} messages. @@ -949,7 +944,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IMesh, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IMesh, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Mesh message from the specified reader or buffer. @@ -959,7 +954,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.Mesh; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.Mesh /** * Decodes a Mesh message from the specified reader or buffer, length delimited. @@ -968,21 +963,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.Mesh; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.Mesh /** * Verifies a Mesh message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Mesh message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Mesh */ - public static fromObject(object: { [k: string]: any }): mirabuf.Mesh; + public static fromObject(object: { [k: string]: any }): mirabuf.Mesh /** * Creates a plain object from a Mesh message. Also converts values to other types if specified. @@ -990,47 +985,45 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.Mesh, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.Mesh, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this Mesh to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Mesh * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a BinaryMesh. */ interface IBinaryMesh { - /** BEWARE of ENDIANESS */ - data?: (Uint8Array|null); + data?: Uint8Array | null } /** Mesh used for more effective file transfers */ class BinaryMesh implements IBinaryMesh { - /** * Constructs a new BinaryMesh. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IBinaryMesh); + constructor(properties?: mirabuf.IBinaryMesh) /** BEWARE of ENDIANESS */ - public data: Uint8Array; + public data: Uint8Array /** * Creates a new BinaryMesh instance using the specified properties. * @param [properties] Properties to set * @returns BinaryMesh instance */ - public static create(properties?: mirabuf.IBinaryMesh): mirabuf.BinaryMesh; + public static create(properties?: mirabuf.IBinaryMesh): mirabuf.BinaryMesh /** * Encodes the specified BinaryMesh message. Does not implicitly {@link mirabuf.BinaryMesh.verify|verify} messages. @@ -1038,7 +1031,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IBinaryMesh, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IBinaryMesh, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified BinaryMesh message, length delimited. Does not implicitly {@link mirabuf.BinaryMesh.verify|verify} messages. @@ -1046,7 +1039,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IBinaryMesh, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IBinaryMesh, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a BinaryMesh message from the specified reader or buffer. @@ -1056,7 +1049,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.BinaryMesh; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.BinaryMesh /** * Decodes a BinaryMesh message from the specified reader or buffer, length delimited. @@ -1065,21 +1058,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.BinaryMesh; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.BinaryMesh /** * Verifies a BinaryMesh message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a BinaryMesh message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns BinaryMesh */ - public static fromObject(object: { [k: string]: any }): mirabuf.BinaryMesh; + public static fromObject(object: { [k: string]: any }): mirabuf.BinaryMesh /** * Creates a plain object from a BinaryMesh message. Also converts values to other types if specified. @@ -1087,59 +1080,60 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.BinaryMesh, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.BinaryMesh, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this BinaryMesh to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for BinaryMesh * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Node. */ interface INode { - /** the reference ID for whatever kind of graph this is */ - value?: (string|null); + value?: string | null /** the children for the given leaf */ - children?: (mirabuf.INode[]|null); + children?: mirabuf.INode[] | null /** other associated data that can be used */ - userData?: (mirabuf.IUserData|null); + userData?: mirabuf.IUserData | null } /** Represents a Node. */ class Node implements INode { - /** * Constructs a new Node. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.INode); + constructor(properties?: mirabuf.INode) /** the reference ID for whatever kind of graph this is */ - public value: string; + public value: string /** the children for the given leaf */ - public children: mirabuf.INode[]; + public children: mirabuf.INode[] /** other associated data that can be used */ - public userData?: (mirabuf.IUserData|null); + public userData?: mirabuf.IUserData | null /** * Creates a new Node instance using the specified properties. * @param [properties] Properties to set * @returns Node instance */ - public static create(properties?: mirabuf.INode): mirabuf.Node; + public static create(properties?: mirabuf.INode): mirabuf.Node /** * Encodes the specified Node message. Does not implicitly {@link mirabuf.Node.verify|verify} messages. @@ -1147,7 +1141,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.INode, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.INode, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Node message, length delimited. Does not implicitly {@link mirabuf.Node.verify|verify} messages. @@ -1155,7 +1149,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.INode, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.INode, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Node message from the specified reader or buffer. @@ -1165,7 +1159,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.Node; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.Node /** * Decodes a Node message from the specified reader or buffer, length delimited. @@ -1174,21 +1168,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.Node; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.Node /** * Verifies a Node message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Node message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Node */ - public static fromObject(object: { [k: string]: any }): mirabuf.Node; + public static fromObject(object: { [k: string]: any }): mirabuf.Node /** * Creates a plain object from a Node message. Also converts values to other types if specified. @@ -1196,47 +1190,45 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.Node, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.Node, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this Node to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Node * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a GraphContainer. */ interface IGraphContainer { - /** GraphContainer nodes */ - nodes?: (mirabuf.INode[]|null); + nodes?: mirabuf.INode[] | null } /** Represents a GraphContainer. */ class GraphContainer implements IGraphContainer { - /** * Constructs a new GraphContainer. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IGraphContainer); + constructor(properties?: mirabuf.IGraphContainer) /** GraphContainer nodes. */ - public nodes: mirabuf.INode[]; + public nodes: mirabuf.INode[] /** * Creates a new GraphContainer instance using the specified properties. * @param [properties] Properties to set * @returns GraphContainer instance */ - public static create(properties?: mirabuf.IGraphContainer): mirabuf.GraphContainer; + public static create(properties?: mirabuf.IGraphContainer): mirabuf.GraphContainer /** * Encodes the specified GraphContainer message. Does not implicitly {@link mirabuf.GraphContainer.verify|verify} messages. @@ -1244,7 +1236,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IGraphContainer, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IGraphContainer, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified GraphContainer message, length delimited. Does not implicitly {@link mirabuf.GraphContainer.verify|verify} messages. @@ -1252,7 +1244,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IGraphContainer, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IGraphContainer, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a GraphContainer message from the specified reader or buffer. @@ -1262,7 +1254,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.GraphContainer; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.GraphContainer /** * Decodes a GraphContainer message from the specified reader or buffer, length delimited. @@ -1271,21 +1263,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.GraphContainer; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.GraphContainer /** * Verifies a GraphContainer message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a GraphContainer message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns GraphContainer */ - public static fromObject(object: { [k: string]: any }): mirabuf.GraphContainer; + public static fromObject(object: { [k: string]: any }): mirabuf.GraphContainer /** * Creates a plain object from a GraphContainer message. Also converts values to other types if specified. @@ -1293,27 +1285,29 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.GraphContainer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.GraphContainer, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this GraphContainer to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for GraphContainer * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a UserData. */ interface IUserData { - /** e.g. data["wheel"] = "yes" */ - data?: ({ [k: string]: string }|null); + data?: { [k: string]: string } | null } /** @@ -1322,22 +1316,21 @@ export namespace mirabuf { * Arbitrary data to append to a given message in map form */ class UserData implements IUserData { - /** * Constructs a new UserData. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IUserData); + constructor(properties?: mirabuf.IUserData) /** e.g. data["wheel"] = "yes" */ - public data: { [k: string]: string }; + public data: { [k: string]: string } /** * Creates a new UserData instance using the specified properties. * @param [properties] Properties to set * @returns UserData instance */ - public static create(properties?: mirabuf.IUserData): mirabuf.UserData; + public static create(properties?: mirabuf.IUserData): mirabuf.UserData /** * Encodes the specified UserData message. Does not implicitly {@link mirabuf.UserData.verify|verify} messages. @@ -1345,7 +1338,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IUserData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IUserData, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified UserData message, length delimited. Does not implicitly {@link mirabuf.UserData.verify|verify} messages. @@ -1353,7 +1346,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IUserData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IUserData, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a UserData message from the specified reader or buffer. @@ -1363,7 +1356,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.UserData; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.UserData /** * Decodes a UserData message from the specified reader or buffer, length delimited. @@ -1372,21 +1365,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.UserData; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.UserData /** * Verifies a UserData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a UserData message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns UserData */ - public static fromObject(object: { [k: string]: any }): mirabuf.UserData; + public static fromObject(object: { [k: string]: any }): mirabuf.UserData /** * Creates a plain object from a UserData message. Also converts values to other types if specified. @@ -1394,59 +1387,57 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.UserData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.UserData, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this UserData to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for UserData * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Vector3. */ interface IVector3 { - /** Vector3 x */ - x?: (number|null); + x?: number | null /** Vector3 y */ - y?: (number|null); + y?: number | null /** Vector3 z */ - z?: (number|null); + z?: number | null } /** Represents a Vector3. */ class Vector3 implements IVector3 { - /** * Constructs a new Vector3. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IVector3); + constructor(properties?: mirabuf.IVector3) /** Vector3 x. */ - public x: number; + public x: number /** Vector3 y. */ - public y: number; + public y: number /** Vector3 z. */ - public z: number; + public z: number /** * Creates a new Vector3 instance using the specified properties. * @param [properties] Properties to set * @returns Vector3 instance */ - public static create(properties?: mirabuf.IVector3): mirabuf.Vector3; + public static create(properties?: mirabuf.IVector3): mirabuf.Vector3 /** * Encodes the specified Vector3 message. Does not implicitly {@link mirabuf.Vector3.verify|verify} messages. @@ -1454,7 +1445,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IVector3, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IVector3, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Vector3 message, length delimited. Does not implicitly {@link mirabuf.Vector3.verify|verify} messages. @@ -1462,7 +1453,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IVector3, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IVector3, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Vector3 message from the specified reader or buffer. @@ -1472,7 +1463,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.Vector3; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.Vector3 /** * Decodes a Vector3 message from the specified reader or buffer, length delimited. @@ -1481,21 +1472,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.Vector3; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.Vector3 /** * Verifies a Vector3 message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Vector3 message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Vector3 */ - public static fromObject(object: { [k: string]: any }): mirabuf.Vector3; + public static fromObject(object: { [k: string]: any }): mirabuf.Vector3 /** * Creates a plain object from a Vector3 message. Also converts values to other types if specified. @@ -1503,71 +1494,69 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.Vector3, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.Vector3, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this Vector3 to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Vector3 * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a PhysicalProperties. */ interface IPhysicalProperties { - /** kg per cubic cm kg/(cm^3) */ - density?: (number|null); + density?: number | null /** kg */ - mass?: (number|null); + mass?: number | null /** cm^3 */ - volume?: (number|null); + volume?: number | null /** cm^2 */ - area?: (number|null); + area?: number | null /** non-negative? Vec3 */ - com?: (mirabuf.IVector3|null); + com?: mirabuf.IVector3 | null } /** Represents a PhysicalProperties. */ class PhysicalProperties implements IPhysicalProperties { - /** * Constructs a new PhysicalProperties. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IPhysicalProperties); + constructor(properties?: mirabuf.IPhysicalProperties) /** kg per cubic cm kg/(cm^3) */ - public density: number; + public density: number /** kg */ - public mass: number; + public mass: number /** cm^3 */ - public volume: number; + public volume: number /** cm^2 */ - public area: number; + public area: number /** non-negative? Vec3 */ - public com?: (mirabuf.IVector3|null); + public com?: mirabuf.IVector3 | null /** * Creates a new PhysicalProperties instance using the specified properties. * @param [properties] Properties to set * @returns PhysicalProperties instance */ - public static create(properties?: mirabuf.IPhysicalProperties): mirabuf.PhysicalProperties; + public static create(properties?: mirabuf.IPhysicalProperties): mirabuf.PhysicalProperties /** * Encodes the specified PhysicalProperties message. Does not implicitly {@link mirabuf.PhysicalProperties.verify|verify} messages. @@ -1575,7 +1564,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IPhysicalProperties, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IPhysicalProperties, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified PhysicalProperties message, length delimited. Does not implicitly {@link mirabuf.PhysicalProperties.verify|verify} messages. @@ -1583,7 +1572,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IPhysicalProperties, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IPhysicalProperties, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a PhysicalProperties message from the specified reader or buffer. @@ -1593,7 +1582,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.PhysicalProperties; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.PhysicalProperties /** * Decodes a PhysicalProperties message from the specified reader or buffer, length delimited. @@ -1602,21 +1591,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.PhysicalProperties; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.PhysicalProperties /** * Verifies a PhysicalProperties message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a PhysicalProperties message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns PhysicalProperties */ - public static fromObject(object: { [k: string]: any }): mirabuf.PhysicalProperties; + public static fromObject(object: { [k: string]: any }): mirabuf.PhysicalProperties /** * Creates a plain object from a PhysicalProperties message. Also converts values to other types if specified. @@ -1624,27 +1613,29 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.PhysicalProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.PhysicalProperties, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this PhysicalProperties to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for PhysicalProperties * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Transform. */ interface ITransform { - /** Transform spatialMatrix */ - spatialMatrix?: (number[]|null); + spatialMatrix?: number[] | null } /** @@ -1653,22 +1644,21 @@ export namespace mirabuf { * Data needed to apply scale, position, and rotational changes */ class Transform implements ITransform { - /** * Constructs a new Transform. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.ITransform); + constructor(properties?: mirabuf.ITransform) /** Transform spatialMatrix. */ - public spatialMatrix: number[]; + public spatialMatrix: number[] /** * Creates a new Transform instance using the specified properties. * @param [properties] Properties to set * @returns Transform instance */ - public static create(properties?: mirabuf.ITransform): mirabuf.Transform; + public static create(properties?: mirabuf.ITransform): mirabuf.Transform /** * Encodes the specified Transform message. Does not implicitly {@link mirabuf.Transform.verify|verify} messages. @@ -1676,7 +1666,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.ITransform, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.ITransform, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Transform message, length delimited. Does not implicitly {@link mirabuf.Transform.verify|verify} messages. @@ -1684,7 +1674,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.ITransform, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.ITransform, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Transform message from the specified reader or buffer. @@ -1694,7 +1684,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.Transform; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.Transform /** * Decodes a Transform message from the specified reader or buffer, length delimited. @@ -1703,21 +1693,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.Transform; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.Transform /** * Verifies a Transform message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Transform message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Transform */ - public static fromObject(object: { [k: string]: any }): mirabuf.Transform; + public static fromObject(object: { [k: string]: any }): mirabuf.Transform /** * Creates a plain object from a Transform message. Also converts values to other types if specified. @@ -1725,65 +1715,63 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.Transform, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.Transform, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this Transform to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Transform * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Color. */ interface IColor { - /** Color R */ - R?: (number|null); + R?: number | null /** Color G */ - G?: (number|null); + G?: number | null /** Color B */ - B?: (number|null); + B?: number | null /** Color A */ - A?: (number|null); + A?: number | null } /** Represents a Color. */ class Color implements IColor { - /** * Constructs a new Color. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IColor); + constructor(properties?: mirabuf.IColor) /** Color R. */ - public R: number; + public R: number /** Color G. */ - public G: number; + public G: number /** Color B. */ - public B: number; + public B: number /** Color A. */ - public A: number; + public A: number /** * Creates a new Color instance using the specified properties. * @param [properties] Properties to set * @returns Color instance */ - public static create(properties?: mirabuf.IColor): mirabuf.Color; + public static create(properties?: mirabuf.IColor): mirabuf.Color /** * Encodes the specified Color message. Does not implicitly {@link mirabuf.Color.verify|verify} messages. @@ -1791,7 +1779,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IColor, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Color message, length delimited. Does not implicitly {@link mirabuf.Color.verify|verify} messages. @@ -1799,7 +1787,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IColor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IColor, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Color message from the specified reader or buffer. @@ -1809,7 +1797,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.Color; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.Color /** * Decodes a Color message from the specified reader or buffer, length delimited. @@ -1818,21 +1806,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.Color; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.Color /** * Verifies a Color message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Color message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Color */ - public static fromObject(object: { [k: string]: any }): mirabuf.Color; + public static fromObject(object: { [k: string]: any }): mirabuf.Color /** * Creates a plain object from a Color message. Also converts values to other types if specified. @@ -1840,40 +1828,39 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.Color, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.Color, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this Color to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Color * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Axis enum. */ enum Axis { X = 0, Y = 1, - Z = 2 + Z = 2, } /** Properties of an Info. */ interface IInfo { - /** Info GUID */ - GUID?: (string|null); + GUID?: string | null /** Info name */ - name?: (string|null); + name?: string | null /** Info version */ - version?: (number|null); + version?: number | null } /** @@ -1881,28 +1868,27 @@ export namespace mirabuf { * The location where you can access the GUID for a reference */ class Info implements IInfo { - /** * Constructs a new Info. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IInfo); + constructor(properties?: mirabuf.IInfo) /** Info GUID. */ - public GUID: string; + public GUID: string /** Info name. */ - public name: string; + public name: string /** Info version. */ - public version: number; + public version: number /** * Creates a new Info instance using the specified properties. * @param [properties] Properties to set * @returns Info instance */ - public static create(properties?: mirabuf.IInfo): mirabuf.Info; + public static create(properties?: mirabuf.IInfo): mirabuf.Info /** * Encodes the specified Info message. Does not implicitly {@link mirabuf.Info.verify|verify} messages. @@ -1910,7 +1896,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IInfo, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Info message, length delimited. Does not implicitly {@link mirabuf.Info.verify|verify} messages. @@ -1918,7 +1904,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IInfo, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes an Info message from the specified reader or buffer. @@ -1928,7 +1914,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.Info; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.Info /** * Decodes an Info message from the specified reader or buffer, length delimited. @@ -1937,21 +1923,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.Info; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.Info /** * Verifies an Info message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates an Info message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Info */ - public static fromObject(object: { [k: string]: any }): mirabuf.Info; + public static fromObject(object: { [k: string]: any }): mirabuf.Info /** * Creates a plain object from an Info message. Also converts values to other types if specified. @@ -1959,39 +1945,38 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.Info, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.Info, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this Info to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Info * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Thumbnail. */ interface IThumbnail { - /** Image Width */ - width?: (number|null); + width?: number | null /** Image Height */ - height?: (number|null); + height?: number | null /** Image Extension - ex. (.png, .bitmap, .jpeg) */ - extension?: (string|null); + extension?: string | null /** Transparency - true from fusion when correctly configured */ - transparent?: (boolean|null); + transparent?: boolean | null /** Data as read from the file in bytes[] form */ - data?: (Uint8Array|null); + data?: Uint8Array | null } /** @@ -1999,34 +1984,33 @@ export namespace mirabuf { * Most of the Time Fusion can encode the file with transparency as PNG not bitmap */ class Thumbnail implements IThumbnail { - /** * Constructs a new Thumbnail. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.IThumbnail); + constructor(properties?: mirabuf.IThumbnail) /** Image Width */ - public width: number; + public width: number /** Image Height */ - public height: number; + public height: number /** Image Extension - ex. (.png, .bitmap, .jpeg) */ - public extension: string; + public extension: string /** Transparency - true from fusion when correctly configured */ - public transparent: boolean; + public transparent: boolean /** Data as read from the file in bytes[] form */ - public data: Uint8Array; + public data: Uint8Array /** * Creates a new Thumbnail instance using the specified properties. * @param [properties] Properties to set * @returns Thumbnail instance */ - public static create(properties?: mirabuf.IThumbnail): mirabuf.Thumbnail; + public static create(properties?: mirabuf.IThumbnail): mirabuf.Thumbnail /** * Encodes the specified Thumbnail message. Does not implicitly {@link mirabuf.Thumbnail.verify|verify} messages. @@ -2034,7 +2018,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.IThumbnail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.IThumbnail, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Thumbnail message, length delimited. Does not implicitly {@link mirabuf.Thumbnail.verify|verify} messages. @@ -2042,7 +2026,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.IThumbnail, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.IThumbnail, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Thumbnail message from the specified reader or buffer. @@ -2052,7 +2036,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.Thumbnail; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.Thumbnail /** * Decodes a Thumbnail message from the specified reader or buffer, length delimited. @@ -2061,21 +2045,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.Thumbnail; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.Thumbnail /** * Verifies a Thumbnail message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Thumbnail message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Thumbnail */ - public static fromObject(object: { [k: string]: any }): mirabuf.Thumbnail; + public static fromObject(object: { [k: string]: any }): mirabuf.Thumbnail /** * Creates a plain object from a Thumbnail message. Also converts values to other types if specified. @@ -2083,42 +2067,42 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.Thumbnail, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: mirabuf.Thumbnail, options?: $protobuf.IConversionOptions): { [k: string]: any } /** * Converts this Thumbnail to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Thumbnail * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Namespace joint. */ namespace joint { - /** Properties of a Joints. */ interface IJoints { - /** name, version, uid */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Unique Joint Implementations */ - jointDefinitions?: ({ [k: string]: mirabuf.joint.IJoint }|null); + jointDefinitions?: { [k: string]: mirabuf.joint.IJoint } | null /** Instances of the Joint Implementations */ - jointInstances?: ({ [k: string]: mirabuf.joint.IJointInstance }|null); + jointInstances?: { + [k: string]: mirabuf.joint.IJointInstance + } | null /** Rigidgroups ? */ - rigidGroups?: (mirabuf.joint.IRigidGroup[]|null); + rigidGroups?: mirabuf.joint.IRigidGroup[] | null /** Collection of all Motors exported */ - motorDefinitions?: ({ [k: string]: mirabuf.motor.IMotor }|null); + motorDefinitions?: { [k: string]: mirabuf.motor.IMotor } | null } /** @@ -2126,34 +2110,33 @@ export namespace mirabuf { * A way to define the motion between various group connections */ class Joints implements IJoints { - /** * Constructs a new Joints. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.IJoints); + constructor(properties?: mirabuf.joint.IJoints) /** name, version, uid */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Unique Joint Implementations */ - public jointDefinitions: { [k: string]: mirabuf.joint.IJoint }; + public jointDefinitions: { [k: string]: mirabuf.joint.IJoint } /** Instances of the Joint Implementations */ - public jointInstances: { [k: string]: mirabuf.joint.IJointInstance }; + public jointInstances: { [k: string]: mirabuf.joint.IJointInstance } /** Rigidgroups ? */ - public rigidGroups: mirabuf.joint.IRigidGroup[]; + public rigidGroups: mirabuf.joint.IRigidGroup[] /** Collection of all Motors exported */ - public motorDefinitions: { [k: string]: mirabuf.motor.IMotor }; + public motorDefinitions: { [k: string]: mirabuf.motor.IMotor } /** * Creates a new Joints instance using the specified properties. * @param [properties] Properties to set * @returns Joints instance */ - public static create(properties?: mirabuf.joint.IJoints): mirabuf.joint.Joints; + public static create(properties?: mirabuf.joint.IJoints): mirabuf.joint.Joints /** * Encodes the specified Joints message. Does not implicitly {@link mirabuf.joint.Joints.verify|verify} messages. @@ -2161,7 +2144,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.IJoints, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.IJoints, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Joints message, length delimited. Does not implicitly {@link mirabuf.joint.Joints.verify|verify} messages. @@ -2169,7 +2152,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.IJoints, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.joint.IJoints, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Joints message from the specified reader or buffer. @@ -2179,7 +2162,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.Joints; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.Joints /** * Decodes a Joints message from the specified reader or buffer, length delimited. @@ -2188,21 +2171,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.Joints; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.Joints /** * Verifies a Joints message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Joints message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Joints */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.Joints; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.Joints /** * Creates a plain object from a Joints message. Also converts values to other types if specified. @@ -2210,20 +2193,23 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.Joints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.Joints, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Joints to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Joints * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** JointMotion enum. */ @@ -2235,38 +2221,37 @@ export namespace mirabuf { PINSLOT = 4, PLANAR = 5, BALL = 6, - CUSTOM = 7 + CUSTOM = 7, } /** Properties of a JointInstance. */ interface IJointInstance { - /** JointInstance info */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** JointInstance isEndEffector */ - isEndEffector?: (boolean|null); + isEndEffector?: boolean | null /** JointInstance parentPart */ - parentPart?: (string|null); + parentPart?: string | null /** JointInstance childPart */ - childPart?: (string|null); + childPart?: string | null /** JointInstance jointReference */ - jointReference?: (string|null); + jointReference?: string | null /** JointInstance offset */ - offset?: (mirabuf.IVector3|null); + offset?: mirabuf.IVector3 | null /** JointInstance parts */ - parts?: (mirabuf.IGraphContainer|null); + parts?: mirabuf.IGraphContainer | null /** JointInstance signalReference */ - signalReference?: (string|null); + signalReference?: string | null /** JointInstance motionLink */ - motionLink?: (mirabuf.joint.IMotionLink[]|null); + motionLink?: mirabuf.joint.IMotionLink[] | null } /** @@ -2274,46 +2259,45 @@ export namespace mirabuf { * Instancing helps with identifiy closed loop systems. */ class JointInstance implements IJointInstance { - /** * Constructs a new JointInstance. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.IJointInstance); + constructor(properties?: mirabuf.joint.IJointInstance) /** JointInstance info. */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** JointInstance isEndEffector. */ - public isEndEffector: boolean; + public isEndEffector: boolean /** JointInstance parentPart. */ - public parentPart: string; + public parentPart: string /** JointInstance childPart. */ - public childPart: string; + public childPart: string /** JointInstance jointReference. */ - public jointReference: string; + public jointReference: string /** JointInstance offset. */ - public offset?: (mirabuf.IVector3|null); + public offset?: mirabuf.IVector3 | null /** JointInstance parts. */ - public parts?: (mirabuf.IGraphContainer|null); + public parts?: mirabuf.IGraphContainer | null /** JointInstance signalReference. */ - public signalReference: string; + public signalReference: string /** JointInstance motionLink. */ - public motionLink: mirabuf.joint.IMotionLink[]; + public motionLink: mirabuf.joint.IMotionLink[] /** * Creates a new JointInstance instance using the specified properties. * @param [properties] Properties to set * @returns JointInstance instance */ - public static create(properties?: mirabuf.joint.IJointInstance): mirabuf.joint.JointInstance; + public static create(properties?: mirabuf.joint.IJointInstance): mirabuf.joint.JointInstance /** * Encodes the specified JointInstance message. Does not implicitly {@link mirabuf.joint.JointInstance.verify|verify} messages. @@ -2321,7 +2305,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.IJointInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.IJointInstance, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified JointInstance message, length delimited. Does not implicitly {@link mirabuf.joint.JointInstance.verify|verify} messages. @@ -2329,7 +2313,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.IJointInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.joint.IJointInstance, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a JointInstance message from the specified reader or buffer. @@ -2339,7 +2326,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.JointInstance; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.JointInstance /** * Decodes a JointInstance message from the specified reader or buffer, length delimited. @@ -2348,21 +2335,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.JointInstance; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.JointInstance /** * Verifies a JointInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a JointInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns JointInstance */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.JointInstance; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.JointInstance /** * Creates a plain object from a JointInstance message. Also converts values to other types if specified. @@ -2370,33 +2357,35 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.JointInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.JointInstance, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this JointInstance to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for JointInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a MotionLink. */ interface IMotionLink { - /** MotionLink jointInstance */ - jointInstance?: (string|null); + jointInstance?: string | null /** MotionLink ratio */ - ratio?: (number|null); + ratio?: number | null /** MotionLink reversed */ - reversed?: (boolean|null); + reversed?: boolean | null } /** @@ -2405,28 +2394,27 @@ export namespace mirabuf { * This is useful for moving parts restricted by belts and gears */ class MotionLink implements IMotionLink { - /** * Constructs a new MotionLink. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.IMotionLink); + constructor(properties?: mirabuf.joint.IMotionLink) /** MotionLink jointInstance. */ - public jointInstance: string; + public jointInstance: string /** MotionLink ratio. */ - public ratio: number; + public ratio: number /** MotionLink reversed. */ - public reversed: boolean; + public reversed: boolean /** * Creates a new MotionLink instance using the specified properties. * @param [properties] Properties to set * @returns MotionLink instance */ - public static create(properties?: mirabuf.joint.IMotionLink): mirabuf.joint.MotionLink; + public static create(properties?: mirabuf.joint.IMotionLink): mirabuf.joint.MotionLink /** * Encodes the specified MotionLink message. Does not implicitly {@link mirabuf.joint.MotionLink.verify|verify} messages. @@ -2434,7 +2422,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.IMotionLink, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.IMotionLink, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified MotionLink message, length delimited. Does not implicitly {@link mirabuf.joint.MotionLink.verify|verify} messages. @@ -2442,7 +2430,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.IMotionLink, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.joint.IMotionLink, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a MotionLink message from the specified reader or buffer. @@ -2452,7 +2443,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.MotionLink; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.MotionLink /** * Decodes a MotionLink message from the specified reader or buffer, length delimited. @@ -2461,21 +2452,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.MotionLink; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.MotionLink /** * Verifies a MotionLink message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a MotionLink message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns MotionLink */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.MotionLink; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.MotionLink /** * Creates a plain object from a MotionLink message. Also converts values to other types if specified. @@ -2483,51 +2474,53 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.MotionLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.MotionLink, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this MotionLink to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for MotionLink * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Joint. */ interface IJoint { - /** Joint name, ID, version, etc */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Joint origin */ - origin?: (mirabuf.IVector3|null); + origin?: mirabuf.IVector3 | null /** Joint jointMotionType */ - jointMotionType?: (mirabuf.joint.JointMotion|null); + jointMotionType?: mirabuf.joint.JointMotion | null /** Joint breakMagnitude */ - breakMagnitude?: (number|null); + breakMagnitude?: number | null /** ONEOF rotational joint */ - rotational?: (mirabuf.joint.IRotationalJoint|null); + rotational?: mirabuf.joint.IRotationalJoint | null /** ONEOF prismatic joint */ - prismatic?: (mirabuf.joint.IPrismaticJoint|null); + prismatic?: mirabuf.joint.IPrismaticJoint | null /** ONEOF custom joint */ - custom?: (mirabuf.joint.ICustomJoint|null); + custom?: mirabuf.joint.ICustomJoint | null /** Additional information someone can query or store relative to your joint. */ - userData?: (mirabuf.IUserData|null); + userData?: mirabuf.IUserData | null /** Motor definition reference to lookup in joints collection */ - motorReference?: (string|null); + motorReference?: string | null } /** @@ -2536,49 +2529,48 @@ export namespace mirabuf { * NOTE: A spring motion is a joint with no driver */ class Joint implements IJoint { - /** * Constructs a new Joint. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.IJoint); + constructor(properties?: mirabuf.joint.IJoint) /** Joint name, ID, version, etc */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Joint origin. */ - public origin?: (mirabuf.IVector3|null); + public origin?: mirabuf.IVector3 | null /** Joint jointMotionType. */ - public jointMotionType: mirabuf.joint.JointMotion; + public jointMotionType: mirabuf.joint.JointMotion /** Joint breakMagnitude. */ - public breakMagnitude: number; + public breakMagnitude: number /** ONEOF rotational joint */ - public rotational?: (mirabuf.joint.IRotationalJoint|null); + public rotational?: mirabuf.joint.IRotationalJoint | null /** ONEOF prismatic joint */ - public prismatic?: (mirabuf.joint.IPrismaticJoint|null); + public prismatic?: mirabuf.joint.IPrismaticJoint | null /** ONEOF custom joint */ - public custom?: (mirabuf.joint.ICustomJoint|null); + public custom?: mirabuf.joint.ICustomJoint | null /** Additional information someone can query or store relative to your joint. */ - public userData?: (mirabuf.IUserData|null); + public userData?: mirabuf.IUserData | null /** Motor definition reference to lookup in joints collection */ - public motorReference: string; + public motorReference: string /** Joint JointMotion. */ - public JointMotion?: ("rotational"|"prismatic"|"custom"); + public JointMotion?: "rotational" | "prismatic" | "custom" /** * Creates a new Joint instance using the specified properties. * @param [properties] Properties to set * @returns Joint instance */ - public static create(properties?: mirabuf.joint.IJoint): mirabuf.joint.Joint; + public static create(properties?: mirabuf.joint.IJoint): mirabuf.joint.Joint /** * Encodes the specified Joint message. Does not implicitly {@link mirabuf.joint.Joint.verify|verify} messages. @@ -2586,7 +2578,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.IJoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.IJoint, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Joint message, length delimited. Does not implicitly {@link mirabuf.joint.Joint.verify|verify} messages. @@ -2594,7 +2586,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.IJoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.joint.IJoint, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Joint message from the specified reader or buffer. @@ -2604,7 +2596,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.Joint; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.Joint /** * Decodes a Joint message from the specified reader or buffer, length delimited. @@ -2613,21 +2605,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.Joint; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.Joint /** * Verifies a Joint message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Joint message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Joint */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.Joint; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.Joint /** * Creates a plain object from a Joint message. Also converts values to other types if specified. @@ -2635,53 +2627,54 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.Joint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.Joint, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Joint to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Joint * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Dynamics. */ interface IDynamics { - /** Damping effect on a given joint motion */ - damping?: (number|null); + damping?: number | null /** Friction effect on a given joint motion */ - friction?: (number|null); + friction?: number | null } /** Dynamics specify the mechanical effects on the motion. */ class Dynamics implements IDynamics { - /** * Constructs a new Dynamics. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.IDynamics); + constructor(properties?: mirabuf.joint.IDynamics) /** Damping effect on a given joint motion */ - public damping: number; + public damping: number /** Friction effect on a given joint motion */ - public friction: number; + public friction: number /** * Creates a new Dynamics instance using the specified properties. * @param [properties] Properties to set * @returns Dynamics instance */ - public static create(properties?: mirabuf.joint.IDynamics): mirabuf.joint.Dynamics; + public static create(properties?: mirabuf.joint.IDynamics): mirabuf.joint.Dynamics /** * Encodes the specified Dynamics message. Does not implicitly {@link mirabuf.joint.Dynamics.verify|verify} messages. @@ -2689,7 +2682,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.IDynamics, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.IDynamics, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Dynamics message, length delimited. Does not implicitly {@link mirabuf.joint.Dynamics.verify|verify} messages. @@ -2697,7 +2690,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.IDynamics, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.joint.IDynamics, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Dynamics message from the specified reader or buffer. @@ -2707,7 +2700,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.Dynamics; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.Dynamics /** * Decodes a Dynamics message from the specified reader or buffer, length delimited. @@ -2716,21 +2709,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.Dynamics; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.Dynamics /** * Verifies a Dynamics message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Dynamics message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Dynamics */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.Dynamics; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.Dynamics /** * Creates a plain object from a Dynamics message. Also converts values to other types if specified. @@ -2738,36 +2731,38 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.Dynamics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.Dynamics, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Dynamics to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Dynamics * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Limits. */ interface ILimits { - /** Lower Limit corresponds to default displacement */ - lower?: (number|null); + lower?: number | null /** Upper Limit is the joint extent */ - upper?: (number|null); + upper?: number | null /** Velocity Max in m/s^2 (angular for rotational) */ - velocity?: (number|null); + velocity?: number | null /** Effort is the absolute force a joint can apply for a given instant - ROS has a great article on it http://wiki.ros.org/pr2_controller_manager/safety_limits */ - effort?: (number|null); + effort?: number | null } /** @@ -2776,31 +2771,30 @@ export namespace mirabuf { * TODO: Add units */ class Limits implements ILimits { - /** * Constructs a new Limits. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.ILimits); + constructor(properties?: mirabuf.joint.ILimits) /** Lower Limit corresponds to default displacement */ - public lower: number; + public lower: number /** Upper Limit is the joint extent */ - public upper: number; + public upper: number /** Velocity Max in m/s^2 (angular for rotational) */ - public velocity: number; + public velocity: number /** Effort is the absolute force a joint can apply for a given instant - ROS has a great article on it http://wiki.ros.org/pr2_controller_manager/safety_limits */ - public effort: number; + public effort: number /** * Creates a new Limits instance using the specified properties. * @param [properties] Properties to set * @returns Limits instance */ - public static create(properties?: mirabuf.joint.ILimits): mirabuf.joint.Limits; + public static create(properties?: mirabuf.joint.ILimits): mirabuf.joint.Limits /** * Encodes the specified Limits message. Does not implicitly {@link mirabuf.joint.Limits.verify|verify} messages. @@ -2808,7 +2802,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.ILimits, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.ILimits, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Limits message, length delimited. Does not implicitly {@link mirabuf.joint.Limits.verify|verify} messages. @@ -2816,7 +2810,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.ILimits, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.joint.ILimits, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Limits message from the specified reader or buffer. @@ -2826,7 +2820,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.Limits; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.Limits /** * Decodes a Limits message from the specified reader or buffer, length delimited. @@ -2835,21 +2829,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.Limits; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.Limits /** * Verifies a Limits message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Limits message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Limits */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.Limits; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.Limits /** * Creates a plain object from a Limits message. Also converts values to other types if specified. @@ -2857,36 +2851,38 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.Limits, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.Limits, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Limits to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Limits * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Safety. */ interface ISafety { - /** Lower software limit */ - lowerLimit?: (number|null); + lowerLimit?: number | null /** Upper Software limit */ - upperLimit?: (number|null); + upperLimit?: number | null /** Relation between position and velocity limit */ - kPosition?: (number|null); + kPosition?: number | null /** Relation between effort and velocity limit */ - kVelocity?: (number|null); + kVelocity?: number | null } /** @@ -2898,31 +2894,30 @@ export namespace mirabuf { * http://wiki.ros.org/pr2_controller_manager/safety_limits */ class Safety implements ISafety { - /** * Constructs a new Safety. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.ISafety); + constructor(properties?: mirabuf.joint.ISafety) /** Lower software limit */ - public lowerLimit: number; + public lowerLimit: number /** Upper Software limit */ - public upperLimit: number; + public upperLimit: number /** Relation between position and velocity limit */ - public kPosition: number; + public kPosition: number /** Relation between effort and velocity limit */ - public kVelocity: number; + public kVelocity: number /** * Creates a new Safety instance using the specified properties. * @param [properties] Properties to set * @returns Safety instance */ - public static create(properties?: mirabuf.joint.ISafety): mirabuf.joint.Safety; + public static create(properties?: mirabuf.joint.ISafety): mirabuf.joint.Safety /** * Encodes the specified Safety message. Does not implicitly {@link mirabuf.joint.Safety.verify|verify} messages. @@ -2930,7 +2925,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.ISafety, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.ISafety, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Safety message, length delimited. Does not implicitly {@link mirabuf.joint.Safety.verify|verify} messages. @@ -2938,7 +2933,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.ISafety, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.joint.ISafety, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Safety message from the specified reader or buffer. @@ -2948,7 +2943,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.Safety; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.Safety /** * Decodes a Safety message from the specified reader or buffer, length delimited. @@ -2957,21 +2952,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.Safety; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.Safety /** * Verifies a Safety message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Safety message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Safety */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.Safety; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.Safety /** * Creates a plain object from a Safety message. Also converts values to other types if specified. @@ -2979,77 +2974,78 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.Safety, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.Safety, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Safety to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Safety * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a DOF. */ interface IDOF { - /** In case you want to name this degree of freedom */ - name?: (string|null); + name?: string | null /** Axis the degree of freedom is pivoting by */ - axis?: (mirabuf.IVector3|null); + axis?: mirabuf.IVector3 | null /** Direction the axis vector is offset from - this has an incorrect naming scheme */ - pivotDirection?: (mirabuf.Axis|null); + pivotDirection?: mirabuf.Axis | null /** Dynamic properties of this joint pivot */ - dynamics?: (mirabuf.joint.IDynamics|null); + dynamics?: mirabuf.joint.IDynamics | null /** Limits of this freedom */ - limits?: (mirabuf.joint.ILimits|null); + limits?: mirabuf.joint.ILimits | null /** Current value of the DOF */ - value?: (number|null); + value?: number | null } /** DOF - representing the construction of a joint motion */ class DOF implements IDOF { - /** * Constructs a new DOF. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.IDOF); + constructor(properties?: mirabuf.joint.IDOF) /** In case you want to name this degree of freedom */ - public name: string; + public name: string /** Axis the degree of freedom is pivoting by */ - public axis?: (mirabuf.IVector3|null); + public axis?: mirabuf.IVector3 | null /** Direction the axis vector is offset from - this has an incorrect naming scheme */ - public pivotDirection: mirabuf.Axis; + public pivotDirection: mirabuf.Axis /** Dynamic properties of this joint pivot */ - public dynamics?: (mirabuf.joint.IDynamics|null); + public dynamics?: mirabuf.joint.IDynamics | null /** Limits of this freedom */ - public limits?: (mirabuf.joint.ILimits|null); + public limits?: mirabuf.joint.ILimits | null /** Current value of the DOF */ - public value: number; + public value: number /** * Creates a new DOF instance using the specified properties. * @param [properties] Properties to set * @returns DOF instance */ - public static create(properties?: mirabuf.joint.IDOF): mirabuf.joint.DOF; + public static create(properties?: mirabuf.joint.IDOF): mirabuf.joint.DOF /** * Encodes the specified DOF message. Does not implicitly {@link mirabuf.joint.DOF.verify|verify} messages. @@ -3057,7 +3053,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.IDOF, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.IDOF, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified DOF message, length delimited. Does not implicitly {@link mirabuf.joint.DOF.verify|verify} messages. @@ -3065,7 +3061,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.IDOF, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.joint.IDOF, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a DOF message from the specified reader or buffer. @@ -3075,7 +3071,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.DOF; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.DOF /** * Decodes a DOF message from the specified reader or buffer, length delimited. @@ -3084,21 +3080,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.DOF; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.DOF /** * Verifies a DOF message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a DOF message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns DOF */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.DOF; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.DOF /** * Creates a plain object from a DOF message. Also converts values to other types if specified. @@ -3106,27 +3102,29 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.DOF, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.DOF, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this DOF to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for DOF * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a CustomJoint. */ interface ICustomJoint { - /** A list of degrees of freedom that the joint can contain */ - dofs?: (mirabuf.joint.IDOF[]|null); + dofs?: mirabuf.joint.IDOF[] | null } /** @@ -3134,22 +3132,21 @@ export namespace mirabuf { * There should be input validation to handle max freedom case. */ class CustomJoint implements ICustomJoint { - /** * Constructs a new CustomJoint. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.ICustomJoint); + constructor(properties?: mirabuf.joint.ICustomJoint) /** A list of degrees of freedom that the joint can contain */ - public dofs: mirabuf.joint.IDOF[]; + public dofs: mirabuf.joint.IDOF[] /** * Creates a new CustomJoint instance using the specified properties. * @param [properties] Properties to set * @returns CustomJoint instance */ - public static create(properties?: mirabuf.joint.ICustomJoint): mirabuf.joint.CustomJoint; + public static create(properties?: mirabuf.joint.ICustomJoint): mirabuf.joint.CustomJoint /** * Encodes the specified CustomJoint message. Does not implicitly {@link mirabuf.joint.CustomJoint.verify|verify} messages. @@ -3157,7 +3154,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.ICustomJoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.ICustomJoint, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified CustomJoint message, length delimited. Does not implicitly {@link mirabuf.joint.CustomJoint.verify|verify} messages. @@ -3165,7 +3162,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.ICustomJoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.joint.ICustomJoint, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a CustomJoint message from the specified reader or buffer. @@ -3175,7 +3175,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.CustomJoint; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.CustomJoint /** * Decodes a CustomJoint message from the specified reader or buffer, length delimited. @@ -3184,21 +3184,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.CustomJoint; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.CustomJoint /** * Verifies a CustomJoint message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a CustomJoint message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns CustomJoint */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.CustomJoint; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.CustomJoint /** * Creates a plain object from a CustomJoint message. Also converts values to other types if specified. @@ -3206,27 +3206,29 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.CustomJoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.CustomJoint, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this CustomJoint to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for CustomJoint * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a RotationalJoint. */ interface IRotationalJoint { - /** RotationalJoint rotationalFreedom */ - rotationalFreedom?: (mirabuf.joint.IDOF|null); + rotationalFreedom?: mirabuf.joint.IDOF | null } /** @@ -3234,22 +3236,21 @@ export namespace mirabuf { * This is the exact same as prismatic for now. */ class RotationalJoint implements IRotationalJoint { - /** * Constructs a new RotationalJoint. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.IRotationalJoint); + constructor(properties?: mirabuf.joint.IRotationalJoint) /** RotationalJoint rotationalFreedom. */ - public rotationalFreedom?: (mirabuf.joint.IDOF|null); + public rotationalFreedom?: mirabuf.joint.IDOF | null /** * Creates a new RotationalJoint instance using the specified properties. * @param [properties] Properties to set * @returns RotationalJoint instance */ - public static create(properties?: mirabuf.joint.IRotationalJoint): mirabuf.joint.RotationalJoint; + public static create(properties?: mirabuf.joint.IRotationalJoint): mirabuf.joint.RotationalJoint /** * Encodes the specified RotationalJoint message. Does not implicitly {@link mirabuf.joint.RotationalJoint.verify|verify} messages. @@ -3257,7 +3258,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.IRotationalJoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.IRotationalJoint, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified RotationalJoint message, length delimited. Does not implicitly {@link mirabuf.joint.RotationalJoint.verify|verify} messages. @@ -3265,7 +3266,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.IRotationalJoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.joint.IRotationalJoint, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a RotationalJoint message from the specified reader or buffer. @@ -3275,7 +3279,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.RotationalJoint; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.RotationalJoint /** * Decodes a RotationalJoint message from the specified reader or buffer, length delimited. @@ -3284,21 +3288,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.RotationalJoint; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.RotationalJoint /** * Verifies a RotationalJoint message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a RotationalJoint message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns RotationalJoint */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.RotationalJoint; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.RotationalJoint /** * Creates a plain object from a RotationalJoint message. Also converts values to other types if specified. @@ -3306,59 +3310,60 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.RotationalJoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.RotationalJoint, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this RotationalJoint to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for RotationalJoint * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a BallJoint. */ interface IBallJoint { - /** BallJoint yaw */ - yaw?: (mirabuf.joint.IDOF|null); + yaw?: mirabuf.joint.IDOF | null /** BallJoint pitch */ - pitch?: (mirabuf.joint.IDOF|null); + pitch?: mirabuf.joint.IDOF | null /** BallJoint rotation */ - rotation?: (mirabuf.joint.IDOF|null); + rotation?: mirabuf.joint.IDOF | null } /** Represents a BallJoint. */ class BallJoint implements IBallJoint { - /** * Constructs a new BallJoint. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.IBallJoint); + constructor(properties?: mirabuf.joint.IBallJoint) /** BallJoint yaw. */ - public yaw?: (mirabuf.joint.IDOF|null); + public yaw?: mirabuf.joint.IDOF | null /** BallJoint pitch. */ - public pitch?: (mirabuf.joint.IDOF|null); + public pitch?: mirabuf.joint.IDOF | null /** BallJoint rotation. */ - public rotation?: (mirabuf.joint.IDOF|null); + public rotation?: mirabuf.joint.IDOF | null /** * Creates a new BallJoint instance using the specified properties. * @param [properties] Properties to set * @returns BallJoint instance */ - public static create(properties?: mirabuf.joint.IBallJoint): mirabuf.joint.BallJoint; + public static create(properties?: mirabuf.joint.IBallJoint): mirabuf.joint.BallJoint /** * Encodes the specified BallJoint message. Does not implicitly {@link mirabuf.joint.BallJoint.verify|verify} messages. @@ -3366,7 +3371,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.IBallJoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.IBallJoint, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified BallJoint message, length delimited. Does not implicitly {@link mirabuf.joint.BallJoint.verify|verify} messages. @@ -3374,7 +3379,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.IBallJoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.joint.IBallJoint, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a BallJoint message from the specified reader or buffer. @@ -3384,7 +3392,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.BallJoint; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.BallJoint /** * Decodes a BallJoint message from the specified reader or buffer, length delimited. @@ -3393,21 +3401,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.BallJoint; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.BallJoint /** * Verifies a BallJoint message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a BallJoint message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns BallJoint */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.BallJoint; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.BallJoint /** * Creates a plain object from a BallJoint message. Also converts values to other types if specified. @@ -3415,47 +3423,48 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.BallJoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.BallJoint, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this BallJoint to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for BallJoint * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a PrismaticJoint. */ interface IPrismaticJoint { - /** PrismaticJoint prismaticFreedom */ - prismaticFreedom?: (mirabuf.joint.IDOF|null); + prismaticFreedom?: mirabuf.joint.IDOF | null } /** Prismatic Joint describes a motion that translates the position in a single axis */ class PrismaticJoint implements IPrismaticJoint { - /** * Constructs a new PrismaticJoint. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.IPrismaticJoint); + constructor(properties?: mirabuf.joint.IPrismaticJoint) /** PrismaticJoint prismaticFreedom. */ - public prismaticFreedom?: (mirabuf.joint.IDOF|null); + public prismaticFreedom?: mirabuf.joint.IDOF | null /** * Creates a new PrismaticJoint instance using the specified properties. * @param [properties] Properties to set * @returns PrismaticJoint instance */ - public static create(properties?: mirabuf.joint.IPrismaticJoint): mirabuf.joint.PrismaticJoint; + public static create(properties?: mirabuf.joint.IPrismaticJoint): mirabuf.joint.PrismaticJoint /** * Encodes the specified PrismaticJoint message. Does not implicitly {@link mirabuf.joint.PrismaticJoint.verify|verify} messages. @@ -3463,7 +3472,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.IPrismaticJoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.IPrismaticJoint, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified PrismaticJoint message, length delimited. Does not implicitly {@link mirabuf.joint.PrismaticJoint.verify|verify} messages. @@ -3471,7 +3480,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.IPrismaticJoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.joint.IPrismaticJoint, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a PrismaticJoint message from the specified reader or buffer. @@ -3481,7 +3493,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.PrismaticJoint; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.PrismaticJoint /** * Decodes a PrismaticJoint message from the specified reader or buffer, length delimited. @@ -3490,21 +3502,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.PrismaticJoint; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.PrismaticJoint /** * Verifies a PrismaticJoint message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a PrismaticJoint message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns PrismaticJoint */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.PrismaticJoint; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.PrismaticJoint /** * Creates a plain object from a PrismaticJoint message. Also converts values to other types if specified. @@ -3512,53 +3524,54 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.PrismaticJoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.PrismaticJoint, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this PrismaticJoint to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for PrismaticJoint * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a RigidGroup. */ interface IRigidGroup { - /** RigidGroup name */ - name?: (string|null); + name?: string | null /** RigidGroup occurrences */ - occurrences?: (string[]|null); + occurrences?: string[] | null } /** Represents a RigidGroup. */ class RigidGroup implements IRigidGroup { - /** * Constructs a new RigidGroup. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.joint.IRigidGroup); + constructor(properties?: mirabuf.joint.IRigidGroup) /** RigidGroup name. */ - public name: string; + public name: string /** RigidGroup occurrences. */ - public occurrences: string[]; + public occurrences: string[] /** * Creates a new RigidGroup instance using the specified properties. * @param [properties] Properties to set * @returns RigidGroup instance */ - public static create(properties?: mirabuf.joint.IRigidGroup): mirabuf.joint.RigidGroup; + public static create(properties?: mirabuf.joint.IRigidGroup): mirabuf.joint.RigidGroup /** * Encodes the specified RigidGroup message. Does not implicitly {@link mirabuf.joint.RigidGroup.verify|verify} messages. @@ -3566,7 +3579,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.joint.IRigidGroup, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.joint.IRigidGroup, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified RigidGroup message, length delimited. Does not implicitly {@link mirabuf.joint.RigidGroup.verify|verify} messages. @@ -3574,7 +3587,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.joint.IRigidGroup, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.joint.IRigidGroup, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a RigidGroup message from the specified reader or buffer. @@ -3584,7 +3600,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.joint.RigidGroup; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.joint.RigidGroup /** * Decodes a RigidGroup message from the specified reader or buffer, length delimited. @@ -3593,21 +3609,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.joint.RigidGroup; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.joint.RigidGroup /** * Verifies a RigidGroup message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a RigidGroup message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns RigidGroup */ - public static fromObject(object: { [k: string]: any }): mirabuf.joint.RigidGroup; + public static fromObject(object: { [k: string]: any }): mirabuf.joint.RigidGroup /** * Creates a plain object from a RigidGroup message. Also converts values to other types if specified. @@ -3615,26 +3631,28 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.joint.RigidGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.joint.RigidGroup, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this RigidGroup to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for RigidGroup * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } } /** Namespace motor. */ namespace motor { - /** * Duty Cycles for electric motors * Affects the dynamic output of the motor @@ -3645,20 +3663,19 @@ export namespace mirabuf { CONTINUOUS_RUNNING = 0, SHORT_TIME = 1, INTERMITTENT_PERIODIC = 2, - CONTINUOUS_PERIODIC = 3 + CONTINUOUS_PERIODIC = 3, } /** Properties of a Motor. */ interface IMotor { - /** Motor info */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Motor dcMotor */ - dcMotor?: (mirabuf.motor.IDCMotor|null); + dcMotor?: mirabuf.motor.IDCMotor | null /** Motor simpleMotor */ - simpleMotor?: (mirabuf.motor.ISimpleMotor|null); + simpleMotor?: mirabuf.motor.ISimpleMotor | null } /** @@ -3666,31 +3683,30 @@ export namespace mirabuf { * Could represent something like a DC Motor relationship */ class Motor implements IMotor { - /** * Constructs a new Motor. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.motor.IMotor); + constructor(properties?: mirabuf.motor.IMotor) /** Motor info. */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Motor dcMotor. */ - public dcMotor?: (mirabuf.motor.IDCMotor|null); + public dcMotor?: mirabuf.motor.IDCMotor | null /** Motor simpleMotor. */ - public simpleMotor?: (mirabuf.motor.ISimpleMotor|null); + public simpleMotor?: mirabuf.motor.ISimpleMotor | null /** Motor motorType. */ - public motorType?: ("dcMotor"|"simpleMotor"); + public motorType?: "dcMotor" | "simpleMotor" /** * Creates a new Motor instance using the specified properties. * @param [properties] Properties to set * @returns Motor instance */ - public static create(properties?: mirabuf.motor.IMotor): mirabuf.motor.Motor; + public static create(properties?: mirabuf.motor.IMotor): mirabuf.motor.Motor /** * Encodes the specified Motor message. Does not implicitly {@link mirabuf.motor.Motor.verify|verify} messages. @@ -3698,7 +3714,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.motor.IMotor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.motor.IMotor, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Motor message, length delimited. Does not implicitly {@link mirabuf.motor.Motor.verify|verify} messages. @@ -3706,7 +3722,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.motor.IMotor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.motor.IMotor, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Motor message from the specified reader or buffer. @@ -3716,7 +3732,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.motor.Motor; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.motor.Motor /** * Decodes a Motor message from the specified reader or buffer, length delimited. @@ -3725,21 +3741,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.motor.Motor; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.motor.Motor /** * Verifies a Motor message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Motor message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Motor */ - public static fromObject(object: { [k: string]: any }): mirabuf.motor.Motor; + public static fromObject(object: { [k: string]: any }): mirabuf.motor.Motor /** * Creates a plain object from a Motor message. Also converts values to other types if specified. @@ -3747,33 +3763,35 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.motor.Motor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.motor.Motor, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Motor to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Motor * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a SimpleMotor. */ interface ISimpleMotor { - /** Torque at 0 rpm with a inverse linear relationship to max_velocity */ - stallTorque?: (number|null); + stallTorque?: number | null /** The target velocity in RPM, will use stall_torque relationship to reach each step */ - maxVelocity?: (number|null); + maxVelocity?: number | null /** (Optional) 0 - 1, the relationship of stall_torque used to perserve the position of this motor */ - brakingConstant?: (number|null); + brakingConstant?: number | null } /** @@ -3783,28 +3801,27 @@ export namespace mirabuf { * Assumes you are solving using a velocity constraint for a joint and not a acceleration constraint */ class SimpleMotor implements ISimpleMotor { - /** * Constructs a new SimpleMotor. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.motor.ISimpleMotor); + constructor(properties?: mirabuf.motor.ISimpleMotor) /** Torque at 0 rpm with a inverse linear relationship to max_velocity */ - public stallTorque: number; + public stallTorque: number /** The target velocity in RPM, will use stall_torque relationship to reach each step */ - public maxVelocity: number; + public maxVelocity: number /** (Optional) 0 - 1, the relationship of stall_torque used to perserve the position of this motor */ - public brakingConstant: number; + public brakingConstant: number /** * Creates a new SimpleMotor instance using the specified properties. * @param [properties] Properties to set * @returns SimpleMotor instance */ - public static create(properties?: mirabuf.motor.ISimpleMotor): mirabuf.motor.SimpleMotor; + public static create(properties?: mirabuf.motor.ISimpleMotor): mirabuf.motor.SimpleMotor /** * Encodes the specified SimpleMotor message. Does not implicitly {@link mirabuf.motor.SimpleMotor.verify|verify} messages. @@ -3812,7 +3829,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.motor.ISimpleMotor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.motor.ISimpleMotor, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified SimpleMotor message, length delimited. Does not implicitly {@link mirabuf.motor.SimpleMotor.verify|verify} messages. @@ -3820,7 +3837,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.motor.ISimpleMotor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.motor.ISimpleMotor, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a SimpleMotor message from the specified reader or buffer. @@ -3830,7 +3850,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.motor.SimpleMotor; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.motor.SimpleMotor /** * Decodes a SimpleMotor message from the specified reader or buffer, length delimited. @@ -3839,21 +3859,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.motor.SimpleMotor; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.motor.SimpleMotor /** * Verifies a SimpleMotor message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a SimpleMotor message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns SimpleMotor */ - public static fromObject(object: { [k: string]: any }): mirabuf.motor.SimpleMotor; + public static fromObject(object: { [k: string]: any }): mirabuf.motor.SimpleMotor /** * Creates a plain object from a SimpleMotor message. Also converts values to other types if specified. @@ -3861,48 +3881,50 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.motor.SimpleMotor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.motor.SimpleMotor, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this SimpleMotor to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for SimpleMotor * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a DCMotor. */ interface IDCMotor { - /** Reference for purchase page or spec sheet */ - referenceUrl?: (string|null); + referenceUrl?: string | null /** m-Nm/Amp */ - torqueConstant?: (number|null); + torqueConstant?: number | null /** mV/rad/sec */ - emfConstant?: (number|null); + emfConstant?: number | null /** Resistance of Motor - Optional if other values are known */ - resistance?: (number|null); + resistance?: number | null /** measure in percentage of 100 - generally around 60 - measured under optimal load */ - maximumEffeciency?: (number|null); + maximumEffeciency?: number | null /** measured in Watts */ - maximumPower?: (number|null); + maximumPower?: number | null /** Stated Duty Cycle of motor */ - dutyCycle?: (mirabuf.motor.DutyCycles|null); + dutyCycle?: mirabuf.motor.DutyCycles | null /** Optional data that can give a better relationship to the simulation */ - advanced?: (mirabuf.motor.DCMotor.IAdvanced|null); + advanced?: mirabuf.motor.DCMotor.IAdvanced | null } /** @@ -3911,43 +3933,42 @@ export namespace mirabuf { * Still needs some more but overall they are most of the parameters we can use */ class DCMotor implements IDCMotor { - /** * Constructs a new DCMotor. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.motor.IDCMotor); + constructor(properties?: mirabuf.motor.IDCMotor) /** Reference for purchase page or spec sheet */ - public referenceUrl: string; + public referenceUrl: string /** m-Nm/Amp */ - public torqueConstant: number; + public torqueConstant: number /** mV/rad/sec */ - public emfConstant: number; + public emfConstant: number /** Resistance of Motor - Optional if other values are known */ - public resistance: number; + public resistance: number /** measure in percentage of 100 - generally around 60 - measured under optimal load */ - public maximumEffeciency: number; + public maximumEffeciency: number /** measured in Watts */ - public maximumPower: number; + public maximumPower: number /** Stated Duty Cycle of motor */ - public dutyCycle: mirabuf.motor.DutyCycles; + public dutyCycle: mirabuf.motor.DutyCycles /** Optional data that can give a better relationship to the simulation */ - public advanced?: (mirabuf.motor.DCMotor.IAdvanced|null); + public advanced?: mirabuf.motor.DCMotor.IAdvanced | null /** * Creates a new DCMotor instance using the specified properties. * @param [properties] Properties to set * @returns DCMotor instance */ - public static create(properties?: mirabuf.motor.IDCMotor): mirabuf.motor.DCMotor; + public static create(properties?: mirabuf.motor.IDCMotor): mirabuf.motor.DCMotor /** * Encodes the specified DCMotor message. Does not implicitly {@link mirabuf.motor.DCMotor.verify|verify} messages. @@ -3955,7 +3976,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.motor.IDCMotor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.motor.IDCMotor, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified DCMotor message, length delimited. Does not implicitly {@link mirabuf.motor.DCMotor.verify|verify} messages. @@ -3963,7 +3984,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.motor.IDCMotor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.motor.IDCMotor, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a DCMotor message from the specified reader or buffer. @@ -3973,7 +3994,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.motor.DCMotor; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.motor.DCMotor /** * Decodes a DCMotor message from the specified reader or buffer, length delimited. @@ -3982,21 +4003,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.motor.DCMotor; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.motor.DCMotor /** * Verifies a DCMotor message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a DCMotor message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns DCMotor */ - public static fromObject(object: { [k: string]: any }): mirabuf.motor.DCMotor; + public static fromObject(object: { [k: string]: any }): mirabuf.motor.DCMotor /** * Creates a plain object from a DCMotor message. Also converts values to other types if specified. @@ -4004,79 +4025,79 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.motor.DCMotor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.motor.DCMotor, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this DCMotor to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for DCMotor * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } namespace DCMotor { - /** Properties of an Advanced. */ interface IAdvanced { - /** measured in AMPs */ - freeCurrent?: (number|null); + freeCurrent?: number | null /** measured in RPM */ - freeSpeed?: (number|null); + freeSpeed?: number | null /** measure in AMPs */ - stallCurrent?: (number|null); + stallCurrent?: number | null /** measured in Nm */ - stallTorque?: (number|null); + stallTorque?: number | null /** measured in Volts DC */ - inputVoltage?: (number|null); + inputVoltage?: number | null /** between (K * (N / 4)) and (K * ((N-2) / 4)) where N is number of poles - leave at 0 if unknown */ - resistanceVariation?: (number|null); + resistanceVariation?: number | null } /** Information usually found on datasheet */ class Advanced implements IAdvanced { - /** * Constructs a new Advanced. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.motor.DCMotor.IAdvanced); + constructor(properties?: mirabuf.motor.DCMotor.IAdvanced) /** measured in AMPs */ - public freeCurrent: number; + public freeCurrent: number /** measured in RPM */ - public freeSpeed: number; + public freeSpeed: number /** measure in AMPs */ - public stallCurrent: number; + public stallCurrent: number /** measured in Nm */ - public stallTorque: number; + public stallTorque: number /** measured in Volts DC */ - public inputVoltage: number; + public inputVoltage: number /** between (K * (N / 4)) and (K * ((N-2) / 4)) where N is number of poles - leave at 0 if unknown */ - public resistanceVariation: number; + public resistanceVariation: number /** * Creates a new Advanced instance using the specified properties. * @param [properties] Properties to set * @returns Advanced instance */ - public static create(properties?: mirabuf.motor.DCMotor.IAdvanced): mirabuf.motor.DCMotor.Advanced; + public static create(properties?: mirabuf.motor.DCMotor.IAdvanced): mirabuf.motor.DCMotor.Advanced /** * Encodes the specified Advanced message. Does not implicitly {@link mirabuf.motor.DCMotor.Advanced.verify|verify} messages. @@ -4084,7 +4105,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.motor.DCMotor.IAdvanced, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode( + message: mirabuf.motor.DCMotor.IAdvanced, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Encodes the specified Advanced message, length delimited. Does not implicitly {@link mirabuf.motor.DCMotor.Advanced.verify|verify} messages. @@ -4092,7 +4116,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.motor.DCMotor.IAdvanced, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.motor.DCMotor.IAdvanced, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes an Advanced message from the specified reader or buffer. @@ -4102,7 +4129,10 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.motor.DCMotor.Advanced; + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): mirabuf.motor.DCMotor.Advanced /** * Decodes an Advanced message from the specified reader or buffer, length delimited. @@ -4111,21 +4141,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.motor.DCMotor.Advanced; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.motor.DCMotor.Advanced /** * Verifies an Advanced message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates an Advanced message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Advanced */ - public static fromObject(object: { [k: string]: any }): mirabuf.motor.DCMotor.Advanced; + public static fromObject(object: { [k: string]: any }): mirabuf.motor.DCMotor.Advanced /** * Creates a plain object from an Advanced message. Also converts values to other types if specified. @@ -4133,38 +4163,41 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.motor.DCMotor.Advanced, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.motor.DCMotor.Advanced, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Advanced to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Advanced * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } } } /** Namespace material. */ namespace material { - /** Properties of a Materials. */ interface IMaterials { - /** Identifiable information (id, name, version) */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Map of Physical Materials */ - physicalMaterials?: ({ [k: string]: mirabuf.material.IPhysicalMaterial }|null); + physicalMaterials?: { + [k: string]: mirabuf.material.IPhysicalMaterial + } | null /** Map of Appearances that are purely visual */ - appearances?: ({ [k: string]: mirabuf.material.IAppearance }|null); + appearances?: { [k: string]: mirabuf.material.IAppearance } | null } /** @@ -4173,28 +4206,29 @@ export namespace mirabuf { * Can be Stored in AssemblyData */ class Materials implements IMaterials { - /** * Constructs a new Materials. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.material.IMaterials); + constructor(properties?: mirabuf.material.IMaterials) /** Identifiable information (id, name, version) */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Map of Physical Materials */ - public physicalMaterials: { [k: string]: mirabuf.material.IPhysicalMaterial }; + public physicalMaterials: { + [k: string]: mirabuf.material.IPhysicalMaterial + } /** Map of Appearances that are purely visual */ - public appearances: { [k: string]: mirabuf.material.IAppearance }; + public appearances: { [k: string]: mirabuf.material.IAppearance } /** * Creates a new Materials instance using the specified properties. * @param [properties] Properties to set * @returns Materials instance */ - public static create(properties?: mirabuf.material.IMaterials): mirabuf.material.Materials; + public static create(properties?: mirabuf.material.IMaterials): mirabuf.material.Materials /** * Encodes the specified Materials message. Does not implicitly {@link mirabuf.material.Materials.verify|verify} messages. @@ -4202,7 +4236,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.material.IMaterials, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.material.IMaterials, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Materials message, length delimited. Does not implicitly {@link mirabuf.material.Materials.verify|verify} messages. @@ -4210,7 +4244,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.material.IMaterials, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.material.IMaterials, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a Materials message from the specified reader or buffer. @@ -4220,7 +4257,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.material.Materials; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.material.Materials /** * Decodes a Materials message from the specified reader or buffer, length delimited. @@ -4229,21 +4266,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.material.Materials; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.material.Materials /** * Verifies a Materials message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Materials message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Materials */ - public static fromObject(object: { [k: string]: any }): mirabuf.material.Materials; + public static fromObject(object: { [k: string]: any }): mirabuf.material.Materials /** * Creates a plain object from a Materials message. Also converts values to other types if specified. @@ -4251,39 +4288,41 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.material.Materials, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.material.Materials, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Materials to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Materials * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of an Appearance. */ interface IAppearance { - /** Identfiable information (id, name, version) */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** albedo map RGBA 0-255 */ - albedo?: (mirabuf.IColor|null); + albedo?: mirabuf.IColor | null /** roughness value 0-1 */ - roughness?: (number|null); + roughness?: number | null /** metallic value 0-1 */ - metallic?: (number|null); + metallic?: number | null /** specular value 0-1 */ - specular?: (number|null); + specular?: number | null } /** @@ -4291,34 +4330,33 @@ export namespace mirabuf { * Limited to just color for now */ class Appearance implements IAppearance { - /** * Constructs a new Appearance. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.material.IAppearance); + constructor(properties?: mirabuf.material.IAppearance) /** Identfiable information (id, name, version) */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** albedo map RGBA 0-255 */ - public albedo?: (mirabuf.IColor|null); + public albedo?: mirabuf.IColor | null /** roughness value 0-1 */ - public roughness: number; + public roughness: number /** metallic value 0-1 */ - public metallic: number; + public metallic: number /** specular value 0-1 */ - public specular: number; + public specular: number /** * Creates a new Appearance instance using the specified properties. * @param [properties] Properties to set * @returns Appearance instance */ - public static create(properties?: mirabuf.material.IAppearance): mirabuf.material.Appearance; + public static create(properties?: mirabuf.material.IAppearance): mirabuf.material.Appearance /** * Encodes the specified Appearance message. Does not implicitly {@link mirabuf.material.Appearance.verify|verify} messages. @@ -4326,7 +4364,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.material.IAppearance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.material.IAppearance, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Appearance message, length delimited. Does not implicitly {@link mirabuf.material.Appearance.verify|verify} messages. @@ -4334,7 +4372,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.material.IAppearance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.material.IAppearance, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes an Appearance message from the specified reader or buffer. @@ -4344,7 +4385,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.material.Appearance; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.material.Appearance /** * Decodes an Appearance message from the specified reader or buffer, length delimited. @@ -4353,21 +4394,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.material.Appearance; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.material.Appearance /** * Verifies an Appearance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates an Appearance message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Appearance */ - public static fromObject(object: { [k: string]: any }): mirabuf.material.Appearance; + public static fromObject(object: { [k: string]: any }): mirabuf.material.Appearance /** * Creates a plain object from an Appearance message. Also converts values to other types if specified. @@ -4375,101 +4416,102 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.material.Appearance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.material.Appearance, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Appearance to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Appearance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a PhysicalMaterial. */ interface IPhysicalMaterial { - /** Identifiable information (id, name, version, etc) */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** short description of physical material */ - description?: (string|null); + description?: string | null /** Thermal Physical properties of the model OPTIONAL */ - thermal?: (mirabuf.material.PhysicalMaterial.IThermal|null); + thermal?: mirabuf.material.PhysicalMaterial.IThermal | null /** Mechanical properties of the model OPTIONAL */ - mechanical?: (mirabuf.material.PhysicalMaterial.IMechanical|null); + mechanical?: mirabuf.material.PhysicalMaterial.IMechanical | null /** Physical Strength properties of the model OPTIONAL */ - strength?: (mirabuf.material.PhysicalMaterial.IStrength|null); + strength?: mirabuf.material.PhysicalMaterial.IStrength | null /** Frictional force for dampening - Interpolate (0-1) */ - dynamicFriction?: (number|null); + dynamicFriction?: number | null /** Frictional force override at stop - Interpolate (0-1) */ - staticFriction?: (number|null); + staticFriction?: number | null /** Restitution of the object - Interpolate (0-1) */ - restitution?: (number|null); + restitution?: number | null /** should this object deform when encountering large forces - TODO: This needs a proper message and equation field */ - deformable?: (boolean|null); + deformable?: boolean | null /** generic type to assign some default params */ - matType?: (mirabuf.material.PhysicalMaterial.MaterialType|null); + matType?: mirabuf.material.PhysicalMaterial.MaterialType | null } /** Data to represent any given Physical Material */ class PhysicalMaterial implements IPhysicalMaterial { - /** * Constructs a new PhysicalMaterial. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.material.IPhysicalMaterial); + constructor(properties?: mirabuf.material.IPhysicalMaterial) /** Identifiable information (id, name, version, etc) */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** short description of physical material */ - public description: string; + public description: string /** Thermal Physical properties of the model OPTIONAL */ - public thermal?: (mirabuf.material.PhysicalMaterial.IThermal|null); + public thermal?: mirabuf.material.PhysicalMaterial.IThermal | null /** Mechanical properties of the model OPTIONAL */ - public mechanical?: (mirabuf.material.PhysicalMaterial.IMechanical|null); + public mechanical?: mirabuf.material.PhysicalMaterial.IMechanical | null /** Physical Strength properties of the model OPTIONAL */ - public strength?: (mirabuf.material.PhysicalMaterial.IStrength|null); + public strength?: mirabuf.material.PhysicalMaterial.IStrength | null /** Frictional force for dampening - Interpolate (0-1) */ - public dynamicFriction: number; + public dynamicFriction: number /** Frictional force override at stop - Interpolate (0-1) */ - public staticFriction: number; + public staticFriction: number /** Restitution of the object - Interpolate (0-1) */ - public restitution: number; + public restitution: number /** should this object deform when encountering large forces - TODO: This needs a proper message and equation field */ - public deformable: boolean; + public deformable: boolean /** generic type to assign some default params */ - public matType: mirabuf.material.PhysicalMaterial.MaterialType; + public matType: mirabuf.material.PhysicalMaterial.MaterialType /** * Creates a new PhysicalMaterial instance using the specified properties. * @param [properties] Properties to set * @returns PhysicalMaterial instance */ - public static create(properties?: mirabuf.material.IPhysicalMaterial): mirabuf.material.PhysicalMaterial; + public static create(properties?: mirabuf.material.IPhysicalMaterial): mirabuf.material.PhysicalMaterial /** * Encodes the specified PhysicalMaterial message. Does not implicitly {@link mirabuf.material.PhysicalMaterial.verify|verify} messages. @@ -4477,7 +4519,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.material.IPhysicalMaterial, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode( + message: mirabuf.material.IPhysicalMaterial, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Encodes the specified PhysicalMaterial message, length delimited. Does not implicitly {@link mirabuf.material.PhysicalMaterial.verify|verify} messages. @@ -4485,7 +4530,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.material.IPhysicalMaterial, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.material.IPhysicalMaterial, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a PhysicalMaterial message from the specified reader or buffer. @@ -4495,7 +4543,10 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.material.PhysicalMaterial; + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): mirabuf.material.PhysicalMaterial /** * Decodes a PhysicalMaterial message from the specified reader or buffer, length delimited. @@ -4504,21 +4555,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.material.PhysicalMaterial; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.material.PhysicalMaterial /** * Verifies a PhysicalMaterial message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a PhysicalMaterial message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns PhysicalMaterial */ - public static fromObject(object: { [k: string]: any }): mirabuf.material.PhysicalMaterial; + public static fromObject(object: { [k: string]: any }): mirabuf.material.PhysicalMaterial /** * Creates a plain object from a PhysicalMaterial message. Also converts values to other types if specified. @@ -4526,67 +4577,69 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.material.PhysicalMaterial, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.material.PhysicalMaterial, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this PhysicalMaterial to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for PhysicalMaterial * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } namespace PhysicalMaterial { - /** MaterialType enum. */ enum MaterialType { METAL = 0, - PLASTIC = 1 + PLASTIC = 1, } /** Properties of a Thermal. */ interface IThermal { - /** W/(m*K) */ - thermalConductivity?: (number|null); + thermalConductivity?: number | null /** J/(g*C) */ - specificHeat?: (number|null); + specificHeat?: number | null /** um/(m*C) */ - thermalExpansionCoefficient?: (number|null); + thermalExpansionCoefficient?: number | null } /** Thermal Properties Set Definition for Simulation. */ class Thermal implements IThermal { - /** * Constructs a new Thermal. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.material.PhysicalMaterial.IThermal); + constructor(properties?: mirabuf.material.PhysicalMaterial.IThermal) /** W/(m*K) */ - public thermalConductivity: number; + public thermalConductivity: number /** J/(g*C) */ - public specificHeat: number; + public specificHeat: number /** um/(m*C) */ - public thermalExpansionCoefficient: number; + public thermalExpansionCoefficient: number /** * Creates a new Thermal instance using the specified properties. * @param [properties] Properties to set * @returns Thermal instance */ - public static create(properties?: mirabuf.material.PhysicalMaterial.IThermal): mirabuf.material.PhysicalMaterial.Thermal; + public static create( + properties?: mirabuf.material.PhysicalMaterial.IThermal + ): mirabuf.material.PhysicalMaterial.Thermal /** * Encodes the specified Thermal message. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Thermal.verify|verify} messages. @@ -4594,7 +4647,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.material.PhysicalMaterial.IThermal, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode( + message: mirabuf.material.PhysicalMaterial.IThermal, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Encodes the specified Thermal message, length delimited. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Thermal.verify|verify} messages. @@ -4602,7 +4658,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.material.PhysicalMaterial.IThermal, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.material.PhysicalMaterial.IThermal, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a Thermal message from the specified reader or buffer. @@ -4612,7 +4671,10 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.material.PhysicalMaterial.Thermal; + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): mirabuf.material.PhysicalMaterial.Thermal /** * Decodes a Thermal message from the specified reader or buffer, length delimited. @@ -4621,21 +4683,23 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.material.PhysicalMaterial.Thermal; + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): mirabuf.material.PhysicalMaterial.Thermal /** * Verifies a Thermal message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Thermal message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Thermal */ - public static fromObject(object: { [k: string]: any }): mirabuf.material.PhysicalMaterial.Thermal; + public static fromObject(object: { [k: string]: any }): mirabuf.material.PhysicalMaterial.Thermal /** * Creates a plain object from a Thermal message. Also converts values to other types if specified. @@ -4643,71 +4707,74 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.material.PhysicalMaterial.Thermal, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.material.PhysicalMaterial.Thermal, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Thermal to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Thermal * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Mechanical. */ interface IMechanical { - /** GPa */ - youngMod?: (number|null); + youngMod?: number | null /** ? */ - poissonRatio?: (number|null); + poissonRatio?: number | null /** MPa */ - shearMod?: (number|null); + shearMod?: number | null /** g/cm^3 */ - density?: (number|null); + density?: number | null /** ? */ - dampingCoefficient?: (number|null); + dampingCoefficient?: number | null } /** Mechanical Properties Set Definition for Simulation. */ class Mechanical implements IMechanical { - /** * Constructs a new Mechanical. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.material.PhysicalMaterial.IMechanical); + constructor(properties?: mirabuf.material.PhysicalMaterial.IMechanical) /** GPa */ - public youngMod: number; + public youngMod: number /** ? */ - public poissonRatio: number; + public poissonRatio: number /** MPa */ - public shearMod: number; + public shearMod: number /** g/cm^3 */ - public density: number; + public density: number /** ? */ - public dampingCoefficient: number; + public dampingCoefficient: number /** * Creates a new Mechanical instance using the specified properties. * @param [properties] Properties to set * @returns Mechanical instance */ - public static create(properties?: mirabuf.material.PhysicalMaterial.IMechanical): mirabuf.material.PhysicalMaterial.Mechanical; + public static create( + properties?: mirabuf.material.PhysicalMaterial.IMechanical + ): mirabuf.material.PhysicalMaterial.Mechanical /** * Encodes the specified Mechanical message. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Mechanical.verify|verify} messages. @@ -4715,7 +4782,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.material.PhysicalMaterial.IMechanical, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode( + message: mirabuf.material.PhysicalMaterial.IMechanical, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Encodes the specified Mechanical message, length delimited. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Mechanical.verify|verify} messages. @@ -4723,7 +4793,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.material.PhysicalMaterial.IMechanical, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.material.PhysicalMaterial.IMechanical, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a Mechanical message from the specified reader or buffer. @@ -4733,7 +4806,10 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.material.PhysicalMaterial.Mechanical; + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): mirabuf.material.PhysicalMaterial.Mechanical /** * Decodes a Mechanical message from the specified reader or buffer, length delimited. @@ -4742,21 +4818,23 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.material.PhysicalMaterial.Mechanical; + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): mirabuf.material.PhysicalMaterial.Mechanical /** * Verifies a Mechanical message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Mechanical message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Mechanical */ - public static fromObject(object: { [k: string]: any }): mirabuf.material.PhysicalMaterial.Mechanical; + public static fromObject(object: { [k: string]: any }): mirabuf.material.PhysicalMaterial.Mechanical /** * Creates a plain object from a Mechanical message. Also converts values to other types if specified. @@ -4764,59 +4842,62 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.material.PhysicalMaterial.Mechanical, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.material.PhysicalMaterial.Mechanical, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Mechanical to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Mechanical * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** Properties of a Strength. */ interface IStrength { - /** MPa */ - yieldStrength?: (number|null); + yieldStrength?: number | null /** MPa */ - tensileStrength?: (number|null); + tensileStrength?: number | null /** yes / no */ - thermalTreatment?: (boolean|null); + thermalTreatment?: boolean | null } /** Strength Properties Set Definition for Simulation. */ class Strength implements IStrength { - /** * Constructs a new Strength. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.material.PhysicalMaterial.IStrength); + constructor(properties?: mirabuf.material.PhysicalMaterial.IStrength) /** MPa */ - public yieldStrength: number; + public yieldStrength: number /** MPa */ - public tensileStrength: number; + public tensileStrength: number /** yes / no */ - public thermalTreatment: boolean; + public thermalTreatment: boolean /** * Creates a new Strength instance using the specified properties. * @param [properties] Properties to set * @returns Strength instance */ - public static create(properties?: mirabuf.material.PhysicalMaterial.IStrength): mirabuf.material.PhysicalMaterial.Strength; + public static create( + properties?: mirabuf.material.PhysicalMaterial.IStrength + ): mirabuf.material.PhysicalMaterial.Strength /** * Encodes the specified Strength message. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Strength.verify|verify} messages. @@ -4824,7 +4905,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.material.PhysicalMaterial.IStrength, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode( + message: mirabuf.material.PhysicalMaterial.IStrength, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Encodes the specified Strength message, length delimited. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Strength.verify|verify} messages. @@ -4832,7 +4916,10 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.material.PhysicalMaterial.IStrength, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited( + message: mirabuf.material.PhysicalMaterial.IStrength, + writer?: $protobuf.Writer + ): $protobuf.Writer /** * Decodes a Strength message from the specified reader or buffer. @@ -4842,7 +4929,10 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.material.PhysicalMaterial.Strength; + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): mirabuf.material.PhysicalMaterial.Strength /** * Decodes a Strength message from the specified reader or buffer, length delimited. @@ -4851,21 +4941,23 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.material.PhysicalMaterial.Strength; + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): mirabuf.material.PhysicalMaterial.Strength /** * Verifies a Strength message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Strength message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Strength */ - public static fromObject(object: { [k: string]: any }): mirabuf.material.PhysicalMaterial.Strength; + public static fromObject(object: { [k: string]: any }): mirabuf.material.PhysicalMaterial.Strength /** * Creates a plain object from a Strength message. Also converts values to other types if specified. @@ -4873,58 +4965,58 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.material.PhysicalMaterial.Strength, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.material.PhysicalMaterial.Strength, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Strength to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Strength * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } } } /** Namespace signal. */ namespace signal { - /** Properties of a Signals. */ interface ISignals { - /** Has identifiable data (id, name, version) */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Contains a full collection of symbols */ - signalMap?: ({ [k: string]: mirabuf.signal.ISignal }|null); + signalMap?: { [k: string]: mirabuf.signal.ISignal } | null } /** Signals is a container for all of the potential signals. */ class Signals implements ISignals { - /** * Constructs a new Signals. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.signal.ISignals); + constructor(properties?: mirabuf.signal.ISignals) /** Has identifiable data (id, name, version) */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Contains a full collection of symbols */ - public signalMap: { [k: string]: mirabuf.signal.ISignal }; + public signalMap: { [k: string]: mirabuf.signal.ISignal } /** * Creates a new Signals instance using the specified properties. * @param [properties] Properties to set * @returns Signals instance */ - public static create(properties?: mirabuf.signal.ISignals): mirabuf.signal.Signals; + public static create(properties?: mirabuf.signal.ISignals): mirabuf.signal.Signals /** * Encodes the specified Signals message. Does not implicitly {@link mirabuf.signal.Signals.verify|verify} messages. @@ -4932,7 +5024,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.signal.ISignals, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.signal.ISignals, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Signals message, length delimited. Does not implicitly {@link mirabuf.signal.Signals.verify|verify} messages. @@ -4940,7 +5032,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.signal.ISignals, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.signal.ISignals, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Signals message from the specified reader or buffer. @@ -4950,7 +5042,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.signal.Signals; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.signal.Signals /** * Decodes a Signals message from the specified reader or buffer, length delimited. @@ -4959,21 +5051,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.signal.Signals; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.signal.Signals /** * Verifies a Signals message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Signals message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Signals */ - public static fromObject(object: { [k: string]: any }): mirabuf.signal.Signals; + public static fromObject(object: { [k: string]: any }): mirabuf.signal.Signals /** * Creates a plain object from a Signals message. Also converts values to other types if specified. @@ -4981,26 +5073,29 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.signal.Signals, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.signal.Signals, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Signals to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Signals * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } /** IOType is a way to specify Input or Output. */ enum IOType { INPUT = 0, - OUTPUT = 1 + OUTPUT = 1, } /** @@ -5013,26 +5108,25 @@ export namespace mirabuf { Analog = 2, I2C = 3, CANBUS = 4, - CUSTOM = 5 + CUSTOM = 5, } /** Properties of a Signal. */ interface ISignal { - /** Has identifiable data (id, name, version) */ - info?: (mirabuf.IInfo|null); + info?: mirabuf.IInfo | null /** Is this a Input or Output */ - io?: (mirabuf.signal.IOType|null); + io?: mirabuf.signal.IOType | null /** The name of a custom input type that is not listed as a device type */ - customType?: (string|null); + customType?: string | null /** ID for a given signal that exists... PWM 2, CANBUS 4 */ - signalId?: (number|null); + signalId?: number | null /** Enum for device type that should always be set */ - deviceType?: (mirabuf.signal.DeviceType|null); + deviceType?: mirabuf.signal.DeviceType | null } /** @@ -5042,34 +5136,33 @@ export namespace mirabuf { * TODO: Decide how this is linked to a exported object */ class Signal implements ISignal { - /** * Constructs a new Signal. * @param [properties] Properties to set */ - constructor(properties?: mirabuf.signal.ISignal); + constructor(properties?: mirabuf.signal.ISignal) /** Has identifiable data (id, name, version) */ - public info?: (mirabuf.IInfo|null); + public info?: mirabuf.IInfo | null /** Is this a Input or Output */ - public io: mirabuf.signal.IOType; + public io: mirabuf.signal.IOType /** The name of a custom input type that is not listed as a device type */ - public customType: string; + public customType: string /** ID for a given signal that exists... PWM 2, CANBUS 4 */ - public signalId: number; + public signalId: number /** Enum for device type that should always be set */ - public deviceType: mirabuf.signal.DeviceType; + public deviceType: mirabuf.signal.DeviceType /** * Creates a new Signal instance using the specified properties. * @param [properties] Properties to set * @returns Signal instance */ - public static create(properties?: mirabuf.signal.ISignal): mirabuf.signal.Signal; + public static create(properties?: mirabuf.signal.ISignal): mirabuf.signal.Signal /** * Encodes the specified Signal message. Does not implicitly {@link mirabuf.signal.Signal.verify|verify} messages. @@ -5077,7 +5170,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: mirabuf.signal.ISignal, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: mirabuf.signal.ISignal, writer?: $protobuf.Writer): $protobuf.Writer /** * Encodes the specified Signal message, length delimited. Does not implicitly {@link mirabuf.signal.Signal.verify|verify} messages. @@ -5085,7 +5178,7 @@ export namespace mirabuf { * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: mirabuf.signal.ISignal, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: mirabuf.signal.ISignal, writer?: $protobuf.Writer): $protobuf.Writer /** * Decodes a Signal message from the specified reader or buffer. @@ -5095,7 +5188,7 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): mirabuf.signal.Signal; + public static decode(reader: $protobuf.Reader | Uint8Array, length?: number): mirabuf.signal.Signal /** * Decodes a Signal message from the specified reader or buffer, length delimited. @@ -5104,21 +5197,21 @@ export namespace mirabuf { * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): mirabuf.signal.Signal; + public static decodeDelimited(reader: $protobuf.Reader | Uint8Array): mirabuf.signal.Signal /** * Verifies a Signal message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ - public static verify(message: { [k: string]: any }): (string|null); + public static verify(message: { [k: string]: any }): string | null /** * Creates a Signal message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Signal */ - public static fromObject(object: { [k: string]: any }): mirabuf.signal.Signal; + public static fromObject(object: { [k: string]: any }): mirabuf.signal.Signal /** * Creates a plain object from a Signal message. Also converts values to other types if specified. @@ -5126,20 +5219,23 @@ export namespace mirabuf { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: mirabuf.signal.Signal, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject( + message: mirabuf.signal.Signal, + options?: $protobuf.IConversionOptions + ): { [k: string]: any } /** * Converts this Signal to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; + public toJSON(): { [k: string]: any } /** * Gets the default type url for Signal * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ - public static getTypeUrl(typeUrlPrefix?: string): string; + public static getTypeUrl(typeUrlPrefix?: string): string } } } diff --git a/fission/src/proto/mirabuf.js b/fission/src/proto/mirabuf.js index d195e18832..e20f2223e2 100644 --- a/fission/src/proto/mirabuf.js +++ b/fission/src/proto/mirabuf.js @@ -1,23 +1,23 @@ /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -import * as $protobuf from "protobufjs/minimal"; +import * as $protobuf from "protobufjs/minimal" // Common aliases -const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; +const $Reader = $protobuf.Reader, + $Writer = $protobuf.Writer, + $util = $protobuf.util // Exported root namespace -const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); - -export const mirabuf = $root.mirabuf = (() => { +const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}) +export const mirabuf = ($root.mirabuf = (() => { /** * Namespace mirabuf. * @exports mirabuf * @namespace */ - const mirabuf = {}; - - mirabuf.Assembly = (function() { + const mirabuf = {} + mirabuf.Assembly = (function () { /** * Properties of an Assembly. * @memberof mirabuf @@ -45,8 +45,7 @@ export const mirabuf = $root.mirabuf = (() => { function Assembly(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -55,7 +54,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Assembly * @instance */ - Assembly.prototype.info = null; + Assembly.prototype.info = null /** * All of the data in the assembly @@ -63,7 +62,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Assembly * @instance */ - Assembly.prototype.data = null; + Assembly.prototype.data = null /** * Can it be effected by the simulation dynamically @@ -71,7 +70,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Assembly * @instance */ - Assembly.prototype.dynamic = false; + Assembly.prototype.dynamic = false /** * Overall physical data of the assembly @@ -79,7 +78,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Assembly * @instance */ - Assembly.prototype.physicalData = null; + Assembly.prototype.physicalData = null /** * The Design hierarchy represented by Part Refs - The first object is a root container for all top level items @@ -87,7 +86,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Assembly * @instance */ - Assembly.prototype.designHierarchy = null; + Assembly.prototype.designHierarchy = null /** * The Joint hierarchy for compound shapes @@ -95,7 +94,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Assembly * @instance */ - Assembly.prototype.jointHierarchy = null; + Assembly.prototype.jointHierarchy = null /** * The Transform in space currently @@ -103,7 +102,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Assembly * @instance */ - Assembly.prototype.transform = null; + Assembly.prototype.transform = null /** * Optional thumbnail saved from Fusion 360 or scraped from previous configuration @@ -111,7 +110,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Assembly * @instance */ - Assembly.prototype.thumbnail = null; + Assembly.prototype.thumbnail = null /** * Creates a new Assembly instance using the specified properties. @@ -122,8 +121,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Assembly} Assembly instance */ Assembly.create = function create(properties) { - return new Assembly(properties); - }; + return new Assembly(properties) + } /** * Encodes the specified Assembly message. Does not implicitly {@link mirabuf.Assembly.verify|verify} messages. @@ -135,26 +134,43 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Assembly.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.data != null && Object.hasOwnProperty.call(message, "data")) - $root.mirabuf.AssemblyData.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.mirabuf.AssemblyData.encode( + message.data, + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ).ldelim() if (message.dynamic != null && Object.hasOwnProperty.call(message, "dynamic")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dynamic); + writer.uint32(/* id 3, wireType 0 =*/ 24).bool(message.dynamic) if (message.physicalData != null && Object.hasOwnProperty.call(message, "physicalData")) - $root.mirabuf.PhysicalProperties.encode(message.physicalData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.mirabuf.PhysicalProperties.encode( + message.physicalData, + writer.uint32(/* id 4, wireType 2 =*/ 34).fork() + ).ldelim() if (message.designHierarchy != null && Object.hasOwnProperty.call(message, "designHierarchy")) - $root.mirabuf.GraphContainer.encode(message.designHierarchy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.mirabuf.GraphContainer.encode( + message.designHierarchy, + writer.uint32(/* id 5, wireType 2 =*/ 42).fork() + ).ldelim() if (message.jointHierarchy != null && Object.hasOwnProperty.call(message, "jointHierarchy")) - $root.mirabuf.GraphContainer.encode(message.jointHierarchy, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.mirabuf.GraphContainer.encode( + message.jointHierarchy, + writer.uint32(/* id 6, wireType 2 =*/ 50).fork() + ).ldelim() if (message.transform != null && Object.hasOwnProperty.call(message, "transform")) - $root.mirabuf.Transform.encode(message.transform, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.mirabuf.Transform.encode( + message.transform, + writer.uint32(/* id 7, wireType 2 =*/ 58).fork() + ).ldelim() if (message.thumbnail != null && Object.hasOwnProperty.call(message, "thumbnail")) - $root.mirabuf.Thumbnail.encode(message.thumbnail, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; + $root.mirabuf.Thumbnail.encode( + message.thumbnail, + writer.uint32(/* id 8, wireType 2 =*/ 66).fork() + ).ldelim() + return writer + } /** * Encodes the specified Assembly message, length delimited. Does not implicitly {@link mirabuf.Assembly.verify|verify} messages. @@ -166,8 +182,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Assembly.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes an Assembly message from the specified reader or buffer. @@ -181,51 +197,51 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Assembly.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.Assembly(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.Assembly() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.data = $root.mirabuf.AssemblyData.decode(reader, reader.uint32()); - break; + case 2: { + message.data = $root.mirabuf.AssemblyData.decode(reader, reader.uint32()) + break } - case 3: { - message.dynamic = reader.bool(); - break; + case 3: { + message.dynamic = reader.bool() + break } - case 4: { - message.physicalData = $root.mirabuf.PhysicalProperties.decode(reader, reader.uint32()); - break; + case 4: { + message.physicalData = $root.mirabuf.PhysicalProperties.decode(reader, reader.uint32()) + break } - case 5: { - message.designHierarchy = $root.mirabuf.GraphContainer.decode(reader, reader.uint32()); - break; + case 5: { + message.designHierarchy = $root.mirabuf.GraphContainer.decode(reader, reader.uint32()) + break } - case 6: { - message.jointHierarchy = $root.mirabuf.GraphContainer.decode(reader, reader.uint32()); - break; + case 6: { + message.jointHierarchy = $root.mirabuf.GraphContainer.decode(reader, reader.uint32()) + break } - case 7: { - message.transform = $root.mirabuf.Transform.decode(reader, reader.uint32()); - break; + case 7: { + message.transform = $root.mirabuf.Transform.decode(reader, reader.uint32()) + break } - case 8: { - message.thumbnail = $root.mirabuf.Thumbnail.decode(reader, reader.uint32()); - break; + case 8: { + message.thumbnail = $root.mirabuf.Thumbnail.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes an Assembly message from the specified reader or buffer, length delimited. @@ -238,10 +254,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Assembly.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies an Assembly message. @@ -252,48 +267,39 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Assembly.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.data != null && message.hasOwnProperty("data")) { - let error = $root.mirabuf.AssemblyData.verify(message.data); - if (error) - return "data." + error; + let error = $root.mirabuf.AssemblyData.verify(message.data) + if (error) return "data." + error } if (message.dynamic != null && message.hasOwnProperty("dynamic")) - if (typeof message.dynamic !== "boolean") - return "dynamic: boolean expected"; + if (typeof message.dynamic !== "boolean") return "dynamic: boolean expected" if (message.physicalData != null && message.hasOwnProperty("physicalData")) { - let error = $root.mirabuf.PhysicalProperties.verify(message.physicalData); - if (error) - return "physicalData." + error; + let error = $root.mirabuf.PhysicalProperties.verify(message.physicalData) + if (error) return "physicalData." + error } if (message.designHierarchy != null && message.hasOwnProperty("designHierarchy")) { - let error = $root.mirabuf.GraphContainer.verify(message.designHierarchy); - if (error) - return "designHierarchy." + error; + let error = $root.mirabuf.GraphContainer.verify(message.designHierarchy) + if (error) return "designHierarchy." + error } if (message.jointHierarchy != null && message.hasOwnProperty("jointHierarchy")) { - let error = $root.mirabuf.GraphContainer.verify(message.jointHierarchy); - if (error) - return "jointHierarchy." + error; + let error = $root.mirabuf.GraphContainer.verify(message.jointHierarchy) + if (error) return "jointHierarchy." + error } if (message.transform != null && message.hasOwnProperty("transform")) { - let error = $root.mirabuf.Transform.verify(message.transform); - if (error) - return "transform." + error; + let error = $root.mirabuf.Transform.verify(message.transform) + if (error) return "transform." + error } if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) { - let error = $root.mirabuf.Thumbnail.verify(message.thumbnail); - if (error) - return "thumbnail." + error; + let error = $root.mirabuf.Thumbnail.verify(message.thumbnail) + if (error) return "thumbnail." + error } - return null; - }; + return null + } /** * Creates an Assembly message from a plain object. Also converts values to their respective internal types. @@ -304,48 +310,44 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Assembly} Assembly */ Assembly.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.Assembly) - return object; - let message = new $root.mirabuf.Assembly(); + if (object instanceof $root.mirabuf.Assembly) return object + let message = new $root.mirabuf.Assembly() if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".mirabuf.Assembly.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + if (typeof object.info !== "object") throw TypeError(".mirabuf.Assembly.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } if (object.data != null) { - if (typeof object.data !== "object") - throw TypeError(".mirabuf.Assembly.data: object expected"); - message.data = $root.mirabuf.AssemblyData.fromObject(object.data); + if (typeof object.data !== "object") throw TypeError(".mirabuf.Assembly.data: object expected") + message.data = $root.mirabuf.AssemblyData.fromObject(object.data) } - if (object.dynamic != null) - message.dynamic = Boolean(object.dynamic); + if (object.dynamic != null) message.dynamic = Boolean(object.dynamic) if (object.physicalData != null) { if (typeof object.physicalData !== "object") - throw TypeError(".mirabuf.Assembly.physicalData: object expected"); - message.physicalData = $root.mirabuf.PhysicalProperties.fromObject(object.physicalData); + throw TypeError(".mirabuf.Assembly.physicalData: object expected") + message.physicalData = $root.mirabuf.PhysicalProperties.fromObject(object.physicalData) } if (object.designHierarchy != null) { if (typeof object.designHierarchy !== "object") - throw TypeError(".mirabuf.Assembly.designHierarchy: object expected"); - message.designHierarchy = $root.mirabuf.GraphContainer.fromObject(object.designHierarchy); + throw TypeError(".mirabuf.Assembly.designHierarchy: object expected") + message.designHierarchy = $root.mirabuf.GraphContainer.fromObject(object.designHierarchy) } if (object.jointHierarchy != null) { if (typeof object.jointHierarchy !== "object") - throw TypeError(".mirabuf.Assembly.jointHierarchy: object expected"); - message.jointHierarchy = $root.mirabuf.GraphContainer.fromObject(object.jointHierarchy); + throw TypeError(".mirabuf.Assembly.jointHierarchy: object expected") + message.jointHierarchy = $root.mirabuf.GraphContainer.fromObject(object.jointHierarchy) } if (object.transform != null) { if (typeof object.transform !== "object") - throw TypeError(".mirabuf.Assembly.transform: object expected"); - message.transform = $root.mirabuf.Transform.fromObject(object.transform); + throw TypeError(".mirabuf.Assembly.transform: object expected") + message.transform = $root.mirabuf.Transform.fromObject(object.transform) } if (object.thumbnail != null) { if (typeof object.thumbnail !== "object") - throw TypeError(".mirabuf.Assembly.thumbnail: object expected"); - message.thumbnail = $root.mirabuf.Thumbnail.fromObject(object.thumbnail); + throw TypeError(".mirabuf.Assembly.thumbnail: object expected") + message.thumbnail = $root.mirabuf.Thumbnail.fromObject(object.thumbnail) } - return message; - }; + return message + } /** * Creates a plain object from an Assembly message. Also converts values to other types if specified. @@ -357,37 +359,35 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Assembly.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.info = null; - object.data = null; - object.dynamic = false; - object.physicalData = null; - object.designHierarchy = null; - object.jointHierarchy = null; - object.transform = null; - object.thumbnail = null; + object.info = null + object.data = null + object.dynamic = false + object.physicalData = null + object.designHierarchy = null + object.jointHierarchy = null + object.transform = null + object.thumbnail = null } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); + object.info = $root.mirabuf.Info.toObject(message.info, options) if (message.data != null && message.hasOwnProperty("data")) - object.data = $root.mirabuf.AssemblyData.toObject(message.data, options); - if (message.dynamic != null && message.hasOwnProperty("dynamic")) - object.dynamic = message.dynamic; + object.data = $root.mirabuf.AssemblyData.toObject(message.data, options) + if (message.dynamic != null && message.hasOwnProperty("dynamic")) object.dynamic = message.dynamic if (message.physicalData != null && message.hasOwnProperty("physicalData")) - object.physicalData = $root.mirabuf.PhysicalProperties.toObject(message.physicalData, options); + object.physicalData = $root.mirabuf.PhysicalProperties.toObject(message.physicalData, options) if (message.designHierarchy != null && message.hasOwnProperty("designHierarchy")) - object.designHierarchy = $root.mirabuf.GraphContainer.toObject(message.designHierarchy, options); + object.designHierarchy = $root.mirabuf.GraphContainer.toObject(message.designHierarchy, options) if (message.jointHierarchy != null && message.hasOwnProperty("jointHierarchy")) - object.jointHierarchy = $root.mirabuf.GraphContainer.toObject(message.jointHierarchy, options); + object.jointHierarchy = $root.mirabuf.GraphContainer.toObject(message.jointHierarchy, options) if (message.transform != null && message.hasOwnProperty("transform")) - object.transform = $root.mirabuf.Transform.toObject(message.transform, options); + object.transform = $root.mirabuf.Transform.toObject(message.transform, options) if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) - object.thumbnail = $root.mirabuf.Thumbnail.toObject(message.thumbnail, options); - return object; - }; + object.thumbnail = $root.mirabuf.Thumbnail.toObject(message.thumbnail, options) + return object + } /** * Converts this Assembly to JSON. @@ -397,8 +397,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Assembly.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Assembly @@ -410,16 +410,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Assembly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.Assembly"; - }; - - return Assembly; - })(); + return typeUrlPrefix + "/mirabuf.Assembly" + } - mirabuf.AssemblyData = (function() { + return Assembly + })() + mirabuf.AssemblyData = (function () { /** * Properties of an AssemblyData. * @memberof mirabuf @@ -441,8 +440,7 @@ export const mirabuf = $root.mirabuf = (() => { function AssemblyData(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -451,7 +449,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.AssemblyData * @instance */ - AssemblyData.prototype.parts = null; + AssemblyData.prototype.parts = null /** * Joint Definition Set @@ -459,7 +457,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.AssemblyData * @instance */ - AssemblyData.prototype.joints = null; + AssemblyData.prototype.joints = null /** * Appearance and Physical Material Set @@ -467,7 +465,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.AssemblyData * @instance */ - AssemblyData.prototype.materials = null; + AssemblyData.prototype.materials = null /** * AssemblyData signals. @@ -475,7 +473,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.AssemblyData * @instance */ - AssemblyData.prototype.signals = null; + AssemblyData.prototype.signals = null /** * Creates a new AssemblyData instance using the specified properties. @@ -486,8 +484,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.AssemblyData} AssemblyData instance */ AssemblyData.create = function create(properties) { - return new AssemblyData(properties); - }; + return new AssemblyData(properties) + } /** * Encodes the specified AssemblyData message. Does not implicitly {@link mirabuf.AssemblyData.verify|verify} messages. @@ -499,18 +497,26 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ AssemblyData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.parts != null && Object.hasOwnProperty.call(message, "parts")) - $root.mirabuf.Parts.encode(message.parts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Parts.encode(message.parts, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.joints != null && Object.hasOwnProperty.call(message, "joints")) - $root.mirabuf.joint.Joints.encode(message.joints, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.mirabuf.joint.Joints.encode( + message.joints, + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ).ldelim() if (message.materials != null && Object.hasOwnProperty.call(message, "materials")) - $root.mirabuf.material.Materials.encode(message.materials, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.mirabuf.material.Materials.encode( + message.materials, + writer.uint32(/* id 3, wireType 2 =*/ 26).fork() + ).ldelim() if (message.signals != null && Object.hasOwnProperty.call(message, "signals")) - $root.mirabuf.signal.Signals.encode(message.signals, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + $root.mirabuf.signal.Signals.encode( + message.signals, + writer.uint32(/* id 4, wireType 2 =*/ 34).fork() + ).ldelim() + return writer + } /** * Encodes the specified AssemblyData message, length delimited. Does not implicitly {@link mirabuf.AssemblyData.verify|verify} messages. @@ -522,8 +528,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ AssemblyData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes an AssemblyData message from the specified reader or buffer. @@ -537,35 +543,35 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AssemblyData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.AssemblyData(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.AssemblyData() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.parts = $root.mirabuf.Parts.decode(reader, reader.uint32()); - break; + case 1: { + message.parts = $root.mirabuf.Parts.decode(reader, reader.uint32()) + break } - case 2: { - message.joints = $root.mirabuf.joint.Joints.decode(reader, reader.uint32()); - break; + case 2: { + message.joints = $root.mirabuf.joint.Joints.decode(reader, reader.uint32()) + break } - case 3: { - message.materials = $root.mirabuf.material.Materials.decode(reader, reader.uint32()); - break; + case 3: { + message.materials = $root.mirabuf.material.Materials.decode(reader, reader.uint32()) + break } - case 4: { - message.signals = $root.mirabuf.signal.Signals.decode(reader, reader.uint32()); - break; + case 4: { + message.signals = $root.mirabuf.signal.Signals.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes an AssemblyData message from the specified reader or buffer, length delimited. @@ -578,10 +584,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ AssemblyData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies an AssemblyData message. @@ -592,30 +597,25 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ AssemblyData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.parts != null && message.hasOwnProperty("parts")) { - let error = $root.mirabuf.Parts.verify(message.parts); - if (error) - return "parts." + error; + let error = $root.mirabuf.Parts.verify(message.parts) + if (error) return "parts." + error } if (message.joints != null && message.hasOwnProperty("joints")) { - let error = $root.mirabuf.joint.Joints.verify(message.joints); - if (error) - return "joints." + error; + let error = $root.mirabuf.joint.Joints.verify(message.joints) + if (error) return "joints." + error } if (message.materials != null && message.hasOwnProperty("materials")) { - let error = $root.mirabuf.material.Materials.verify(message.materials); - if (error) - return "materials." + error; + let error = $root.mirabuf.material.Materials.verify(message.materials) + if (error) return "materials." + error } if (message.signals != null && message.hasOwnProperty("signals")) { - let error = $root.mirabuf.signal.Signals.verify(message.signals); - if (error) - return "signals." + error; + let error = $root.mirabuf.signal.Signals.verify(message.signals) + if (error) return "signals." + error } - return null; - }; + return null + } /** * Creates an AssemblyData message from a plain object. Also converts values to their respective internal types. @@ -626,31 +626,28 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.AssemblyData} AssemblyData */ AssemblyData.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.AssemblyData) - return object; - let message = new $root.mirabuf.AssemblyData(); + if (object instanceof $root.mirabuf.AssemblyData) return object + let message = new $root.mirabuf.AssemblyData() if (object.parts != null) { - if (typeof object.parts !== "object") - throw TypeError(".mirabuf.AssemblyData.parts: object expected"); - message.parts = $root.mirabuf.Parts.fromObject(object.parts); + if (typeof object.parts !== "object") throw TypeError(".mirabuf.AssemblyData.parts: object expected") + message.parts = $root.mirabuf.Parts.fromObject(object.parts) } if (object.joints != null) { - if (typeof object.joints !== "object") - throw TypeError(".mirabuf.AssemblyData.joints: object expected"); - message.joints = $root.mirabuf.joint.Joints.fromObject(object.joints); + if (typeof object.joints !== "object") throw TypeError(".mirabuf.AssemblyData.joints: object expected") + message.joints = $root.mirabuf.joint.Joints.fromObject(object.joints) } if (object.materials != null) { if (typeof object.materials !== "object") - throw TypeError(".mirabuf.AssemblyData.materials: object expected"); - message.materials = $root.mirabuf.material.Materials.fromObject(object.materials); + throw TypeError(".mirabuf.AssemblyData.materials: object expected") + message.materials = $root.mirabuf.material.Materials.fromObject(object.materials) } if (object.signals != null) { if (typeof object.signals !== "object") - throw TypeError(".mirabuf.AssemblyData.signals: object expected"); - message.signals = $root.mirabuf.signal.Signals.fromObject(object.signals); + throw TypeError(".mirabuf.AssemblyData.signals: object expected") + message.signals = $root.mirabuf.signal.Signals.fromObject(object.signals) } - return message; - }; + return message + } /** * Creates a plain object from an AssemblyData message. Also converts values to other types if specified. @@ -662,25 +659,24 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ AssemblyData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.parts = null; - object.joints = null; - object.materials = null; - object.signals = null; + object.parts = null + object.joints = null + object.materials = null + object.signals = null } if (message.parts != null && message.hasOwnProperty("parts")) - object.parts = $root.mirabuf.Parts.toObject(message.parts, options); + object.parts = $root.mirabuf.Parts.toObject(message.parts, options) if (message.joints != null && message.hasOwnProperty("joints")) - object.joints = $root.mirabuf.joint.Joints.toObject(message.joints, options); + object.joints = $root.mirabuf.joint.Joints.toObject(message.joints, options) if (message.materials != null && message.hasOwnProperty("materials")) - object.materials = $root.mirabuf.material.Materials.toObject(message.materials, options); + object.materials = $root.mirabuf.material.Materials.toObject(message.materials, options) if (message.signals != null && message.hasOwnProperty("signals")) - object.signals = $root.mirabuf.signal.Signals.toObject(message.signals, options); - return object; - }; + object.signals = $root.mirabuf.signal.Signals.toObject(message.signals, options) + return object + } /** * Converts this AssemblyData to JSON. @@ -690,8 +686,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ AssemblyData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for AssemblyData @@ -703,16 +699,15 @@ export const mirabuf = $root.mirabuf = (() => { */ AssemblyData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.AssemblyData"; - }; - - return AssemblyData; - })(); + return typeUrlPrefix + "/mirabuf.AssemblyData" + } - mirabuf.Parts = (function() { + return AssemblyData + })() + mirabuf.Parts = (function () { /** * Properties of a Parts. * @memberof mirabuf @@ -732,12 +727,11 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.IParts=} [properties] Properties to set */ function Parts(properties) { - this.partDefinitions = {}; - this.partInstances = {}; + this.partDefinitions = {} + this.partInstances = {} if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -746,7 +740,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Parts * @instance */ - Parts.prototype.info = null; + Parts.prototype.info = null /** * Map of the Exported Part Definitions @@ -754,7 +748,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Parts * @instance */ - Parts.prototype.partDefinitions = $util.emptyObject; + Parts.prototype.partDefinitions = $util.emptyObject /** * Map of the Exported Parts that make up the object @@ -762,7 +756,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Parts * @instance */ - Parts.prototype.partInstances = $util.emptyObject; + Parts.prototype.partInstances = $util.emptyObject /** * other associated data that can be used @@ -770,7 +764,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Parts * @instance */ - Parts.prototype.userData = null; + Parts.prototype.userData = null /** * Creates a new Parts instance using the specified properties. @@ -781,8 +775,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Parts} Parts instance */ Parts.create = function create(properties) { - return new Parts(properties); - }; + return new Parts(properties) + } /** * Encodes the specified Parts message. Does not implicitly {@link mirabuf.Parts.verify|verify} messages. @@ -794,24 +788,36 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Parts.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.partDefinitions != null && Object.hasOwnProperty.call(message, "partDefinitions")) for (let keys = Object.keys(message.partDefinitions), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.mirabuf.PartDefinition.encode(message.partDefinitions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + writer.uint32(/* id 2, wireType 2 =*/ 18).fork().uint32(/* id 1, wireType 2 =*/ 10).string(keys[i]) + $root.mirabuf.PartDefinition.encode( + message.partDefinitions[keys[i]], + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ) + .ldelim() + .ldelim() } if (message.partInstances != null && Object.hasOwnProperty.call(message, "partInstances")) for (let keys = Object.keys(message.partInstances), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.mirabuf.PartInstance.encode(message.partInstances[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + writer.uint32(/* id 3, wireType 2 =*/ 26).fork().uint32(/* id 1, wireType 2 =*/ 10).string(keys[i]) + $root.mirabuf.PartInstance.encode( + message.partInstances[keys[i]], + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ) + .ldelim() + .ldelim() } if (message.userData != null && Object.hasOwnProperty.call(message, "userData")) - $root.mirabuf.UserData.encode(message.userData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + $root.mirabuf.UserData.encode( + message.userData, + writer.uint32(/* id 4, wireType 2 =*/ 34).fork() + ).ldelim() + return writer + } /** * Encodes the specified Parts message, length delimited. Does not implicitly {@link mirabuf.Parts.verify|verify} messages. @@ -823,8 +829,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Parts.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Parts message from the specified reader or buffer. @@ -838,73 +844,73 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Parts.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.Parts(), key, value; + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.Parts(), + key, + value while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; - } - case 2: { - if (message.partDefinitions === $util.emptyObject) - message.partDefinitions = {}; - let end2 = reader.uint32() + reader.pos; - key = ""; - value = null; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break + } + case 2: { + if (message.partDefinitions === $util.emptyObject) message.partDefinitions = {} + let end2 = reader.uint32() + reader.pos + key = "" + value = null while (reader.pos < end2) { - let tag2 = reader.uint32(); + let tag2 = reader.uint32() switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.mirabuf.PartDefinition.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: + key = reader.string() + break + case 2: + value = $root.mirabuf.PartDefinition.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag2 & 7) + break } } - message.partDefinitions[key] = value; - break; - } - case 3: { - if (message.partInstances === $util.emptyObject) - message.partInstances = {}; - let end2 = reader.uint32() + reader.pos; - key = ""; - value = null; + message.partDefinitions[key] = value + break + } + case 3: { + if (message.partInstances === $util.emptyObject) message.partInstances = {} + let end2 = reader.uint32() + reader.pos + key = "" + value = null while (reader.pos < end2) { - let tag2 = reader.uint32(); + let tag2 = reader.uint32() switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.mirabuf.PartInstance.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: + key = reader.string() + break + case 2: + value = $root.mirabuf.PartInstance.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag2 & 7) + break } } - message.partInstances[key] = value; - break; + message.partInstances[key] = value + break } - case 4: { - message.userData = $root.mirabuf.UserData.decode(reader, reader.uint32()); - break; + case 4: { + message.userData = $root.mirabuf.UserData.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Parts message from the specified reader or buffer, length delimited. @@ -917,10 +923,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Parts.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Parts message. @@ -931,40 +936,33 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Parts.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.partDefinitions != null && message.hasOwnProperty("partDefinitions")) { - if (!$util.isObject(message.partDefinitions)) - return "partDefinitions: object expected"; - let key = Object.keys(message.partDefinitions); + if (!$util.isObject(message.partDefinitions)) return "partDefinitions: object expected" + let key = Object.keys(message.partDefinitions) for (let i = 0; i < key.length; ++i) { - let error = $root.mirabuf.PartDefinition.verify(message.partDefinitions[key[i]]); - if (error) - return "partDefinitions." + error; + let error = $root.mirabuf.PartDefinition.verify(message.partDefinitions[key[i]]) + if (error) return "partDefinitions." + error } } if (message.partInstances != null && message.hasOwnProperty("partInstances")) { - if (!$util.isObject(message.partInstances)) - return "partInstances: object expected"; - let key = Object.keys(message.partInstances); + if (!$util.isObject(message.partInstances)) return "partInstances: object expected" + let key = Object.keys(message.partInstances) for (let i = 0; i < key.length; ++i) { - let error = $root.mirabuf.PartInstance.verify(message.partInstances[key[i]]); - if (error) - return "partInstances." + error; + let error = $root.mirabuf.PartInstance.verify(message.partInstances[key[i]]) + if (error) return "partInstances." + error } } if (message.userData != null && message.hasOwnProperty("userData")) { - let error = $root.mirabuf.UserData.verify(message.userData); - if (error) - return "userData." + error; + let error = $root.mirabuf.UserData.verify(message.userData) + if (error) return "userData." + error } - return null; - }; + return null + } /** * Creates a Parts message from a plain object. Also converts values to their respective internal types. @@ -975,41 +973,42 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Parts} Parts */ Parts.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.Parts) - return object; - let message = new $root.mirabuf.Parts(); + if (object instanceof $root.mirabuf.Parts) return object + let message = new $root.mirabuf.Parts() if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".mirabuf.Parts.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + if (typeof object.info !== "object") throw TypeError(".mirabuf.Parts.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } if (object.partDefinitions) { if (typeof object.partDefinitions !== "object") - throw TypeError(".mirabuf.Parts.partDefinitions: object expected"); - message.partDefinitions = {}; + throw TypeError(".mirabuf.Parts.partDefinitions: object expected") + message.partDefinitions = {} for (let keys = Object.keys(object.partDefinitions), i = 0; i < keys.length; ++i) { if (typeof object.partDefinitions[keys[i]] !== "object") - throw TypeError(".mirabuf.Parts.partDefinitions: object expected"); - message.partDefinitions[keys[i]] = $root.mirabuf.PartDefinition.fromObject(object.partDefinitions[keys[i]]); + throw TypeError(".mirabuf.Parts.partDefinitions: object expected") + message.partDefinitions[keys[i]] = $root.mirabuf.PartDefinition.fromObject( + object.partDefinitions[keys[i]] + ) } } if (object.partInstances) { if (typeof object.partInstances !== "object") - throw TypeError(".mirabuf.Parts.partInstances: object expected"); - message.partInstances = {}; + throw TypeError(".mirabuf.Parts.partInstances: object expected") + message.partInstances = {} for (let keys = Object.keys(object.partInstances), i = 0; i < keys.length; ++i) { if (typeof object.partInstances[keys[i]] !== "object") - throw TypeError(".mirabuf.Parts.partInstances: object expected"); - message.partInstances[keys[i]] = $root.mirabuf.PartInstance.fromObject(object.partInstances[keys[i]]); + throw TypeError(".mirabuf.Parts.partInstances: object expected") + message.partInstances[keys[i]] = $root.mirabuf.PartInstance.fromObject( + object.partInstances[keys[i]] + ) } } if (object.userData != null) { - if (typeof object.userData !== "object") - throw TypeError(".mirabuf.Parts.userData: object expected"); - message.userData = $root.mirabuf.UserData.fromObject(object.userData); + if (typeof object.userData !== "object") throw TypeError(".mirabuf.Parts.userData: object expected") + message.userData = $root.mirabuf.UserData.fromObject(object.userData) } - return message; - }; + return message + } /** * Creates a plain object from a Parts message. Also converts values to other types if specified. @@ -1021,34 +1020,39 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Parts.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.objects || options.defaults) { - object.partDefinitions = {}; - object.partInstances = {}; + object.partDefinitions = {} + object.partInstances = {} } if (options.defaults) { - object.info = null; - object.userData = null; + object.info = null + object.userData = null } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); - let keys2; + object.info = $root.mirabuf.Info.toObject(message.info, options) + let keys2 if (message.partDefinitions && (keys2 = Object.keys(message.partDefinitions)).length) { - object.partDefinitions = {}; + object.partDefinitions = {} for (let j = 0; j < keys2.length; ++j) - object.partDefinitions[keys2[j]] = $root.mirabuf.PartDefinition.toObject(message.partDefinitions[keys2[j]], options); + object.partDefinitions[keys2[j]] = $root.mirabuf.PartDefinition.toObject( + message.partDefinitions[keys2[j]], + options + ) } if (message.partInstances && (keys2 = Object.keys(message.partInstances)).length) { - object.partInstances = {}; + object.partInstances = {} for (let j = 0; j < keys2.length; ++j) - object.partInstances[keys2[j]] = $root.mirabuf.PartInstance.toObject(message.partInstances[keys2[j]], options); + object.partInstances[keys2[j]] = $root.mirabuf.PartInstance.toObject( + message.partInstances[keys2[j]], + options + ) } if (message.userData != null && message.hasOwnProperty("userData")) - object.userData = $root.mirabuf.UserData.toObject(message.userData, options); - return object; - }; + object.userData = $root.mirabuf.UserData.toObject(message.userData, options) + return object + } /** * Converts this Parts to JSON. @@ -1058,8 +1062,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Parts.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Parts @@ -1071,16 +1075,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Parts.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.Parts"; - }; - - return Parts; - })(); + return typeUrlPrefix + "/mirabuf.Parts" + } - mirabuf.PartDefinition = (function() { + return Parts + })() + mirabuf.PartDefinition = (function () { /** * Properties of a PartDefinition. * @memberof mirabuf @@ -1105,11 +1108,10 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.IPartDefinition=} [properties] Properties to set */ function PartDefinition(properties) { - this.bodies = []; + this.bodies = [] if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -1118,7 +1120,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartDefinition * @instance */ - PartDefinition.prototype.info = null; + PartDefinition.prototype.info = null /** * Physical data associated with Part @@ -1126,7 +1128,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartDefinition * @instance */ - PartDefinition.prototype.physicalData = null; + PartDefinition.prototype.physicalData = null /** * Base Transform applied - Most Likely Identity Matrix @@ -1134,7 +1136,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartDefinition * @instance */ - PartDefinition.prototype.baseTransform = null; + PartDefinition.prototype.baseTransform = null /** * Mesh Bodies to populate part @@ -1142,7 +1144,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartDefinition * @instance */ - PartDefinition.prototype.bodies = $util.emptyArray; + PartDefinition.prototype.bodies = $util.emptyArray /** * Optional value to state whether an object is a dynamic object in a static assembly - all children are also considered overriden @@ -1150,7 +1152,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartDefinition * @instance */ - PartDefinition.prototype.dynamic = false; + PartDefinition.prototype.dynamic = false /** * Optional value for overriding the friction value 0-1 @@ -1158,7 +1160,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartDefinition * @instance */ - PartDefinition.prototype.frictionOverride = 0; + PartDefinition.prototype.frictionOverride = 0 /** * Optional value for overriding an indiviaul object's mass @@ -1166,7 +1168,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartDefinition * @instance */ - PartDefinition.prototype.massOverride = 0; + PartDefinition.prototype.massOverride = 0 /** * Creates a new PartDefinition instance using the specified properties. @@ -1177,8 +1179,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.PartDefinition} PartDefinition instance */ PartDefinition.create = function create(properties) { - return new PartDefinition(properties); - }; + return new PartDefinition(properties) + } /** * Encodes the specified PartDefinition message. Does not implicitly {@link mirabuf.PartDefinition.verify|verify} messages. @@ -1190,25 +1192,33 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ PartDefinition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.physicalData != null && Object.hasOwnProperty.call(message, "physicalData")) - $root.mirabuf.PhysicalProperties.encode(message.physicalData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.mirabuf.PhysicalProperties.encode( + message.physicalData, + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ).ldelim() if (message.baseTransform != null && Object.hasOwnProperty.call(message, "baseTransform")) - $root.mirabuf.Transform.encode(message.baseTransform, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.mirabuf.Transform.encode( + message.baseTransform, + writer.uint32(/* id 3, wireType 2 =*/ 26).fork() + ).ldelim() if (message.bodies != null && message.bodies.length) for (let i = 0; i < message.bodies.length; ++i) - $root.mirabuf.Body.encode(message.bodies[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.mirabuf.Body.encode( + message.bodies[i], + writer.uint32(/* id 4, wireType 2 =*/ 34).fork() + ).ldelim() if (message.dynamic != null && Object.hasOwnProperty.call(message, "dynamic")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.dynamic); + writer.uint32(/* id 5, wireType 0 =*/ 40).bool(message.dynamic) if (message.frictionOverride != null && Object.hasOwnProperty.call(message, "frictionOverride")) - writer.uint32(/* id 6, wireType 5 =*/53).float(message.frictionOverride); + writer.uint32(/* id 6, wireType 5 =*/ 53).float(message.frictionOverride) if (message.massOverride != null && Object.hasOwnProperty.call(message, "massOverride")) - writer.uint32(/* id 7, wireType 5 =*/61).float(message.massOverride); - return writer; - }; + writer.uint32(/* id 7, wireType 5 =*/ 61).float(message.massOverride) + return writer + } /** * Encodes the specified PartDefinition message, length delimited. Does not implicitly {@link mirabuf.PartDefinition.verify|verify} messages. @@ -1220,8 +1230,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ PartDefinition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a PartDefinition message from the specified reader or buffer. @@ -1235,49 +1245,48 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PartDefinition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.PartDefinition(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.PartDefinition() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.physicalData = $root.mirabuf.PhysicalProperties.decode(reader, reader.uint32()); - break; + case 2: { + message.physicalData = $root.mirabuf.PhysicalProperties.decode(reader, reader.uint32()) + break } - case 3: { - message.baseTransform = $root.mirabuf.Transform.decode(reader, reader.uint32()); - break; + case 3: { + message.baseTransform = $root.mirabuf.Transform.decode(reader, reader.uint32()) + break } - case 4: { - if (!(message.bodies && message.bodies.length)) - message.bodies = []; - message.bodies.push($root.mirabuf.Body.decode(reader, reader.uint32())); - break; + case 4: { + if (!(message.bodies && message.bodies.length)) message.bodies = [] + message.bodies.push($root.mirabuf.Body.decode(reader, reader.uint32())) + break } - case 5: { - message.dynamic = reader.bool(); - break; + case 5: { + message.dynamic = reader.bool() + break } - case 6: { - message.frictionOverride = reader.float(); - break; + case 6: { + message.frictionOverride = reader.float() + break } - case 7: { - message.massOverride = reader.float(); - break; + case 7: { + message.massOverride = reader.float() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a PartDefinition message from the specified reader or buffer, length delimited. @@ -1290,10 +1299,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PartDefinition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a PartDefinition message. @@ -1304,43 +1312,34 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ PartDefinition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.physicalData != null && message.hasOwnProperty("physicalData")) { - let error = $root.mirabuf.PhysicalProperties.verify(message.physicalData); - if (error) - return "physicalData." + error; + let error = $root.mirabuf.PhysicalProperties.verify(message.physicalData) + if (error) return "physicalData." + error } if (message.baseTransform != null && message.hasOwnProperty("baseTransform")) { - let error = $root.mirabuf.Transform.verify(message.baseTransform); - if (error) - return "baseTransform." + error; + let error = $root.mirabuf.Transform.verify(message.baseTransform) + if (error) return "baseTransform." + error } if (message.bodies != null && message.hasOwnProperty("bodies")) { - if (!Array.isArray(message.bodies)) - return "bodies: array expected"; + if (!Array.isArray(message.bodies)) return "bodies: array expected" for (let i = 0; i < message.bodies.length; ++i) { - let error = $root.mirabuf.Body.verify(message.bodies[i]); - if (error) - return "bodies." + error; + let error = $root.mirabuf.Body.verify(message.bodies[i]) + if (error) return "bodies." + error } } if (message.dynamic != null && message.hasOwnProperty("dynamic")) - if (typeof message.dynamic !== "boolean") - return "dynamic: boolean expected"; + if (typeof message.dynamic !== "boolean") return "dynamic: boolean expected" if (message.frictionOverride != null && message.hasOwnProperty("frictionOverride")) - if (typeof message.frictionOverride !== "number") - return "frictionOverride: number expected"; + if (typeof message.frictionOverride !== "number") return "frictionOverride: number expected" if (message.massOverride != null && message.hasOwnProperty("massOverride")) - if (typeof message.massOverride !== "number") - return "massOverride: number expected"; - return null; - }; + if (typeof message.massOverride !== "number") return "massOverride: number expected" + return null + } /** * Creates a PartDefinition message from a plain object. Also converts values to their respective internal types. @@ -1351,42 +1350,36 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.PartDefinition} PartDefinition */ PartDefinition.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.PartDefinition) - return object; - let message = new $root.mirabuf.PartDefinition(); + if (object instanceof $root.mirabuf.PartDefinition) return object + let message = new $root.mirabuf.PartDefinition() if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".mirabuf.PartDefinition.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + if (typeof object.info !== "object") throw TypeError(".mirabuf.PartDefinition.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } if (object.physicalData != null) { if (typeof object.physicalData !== "object") - throw TypeError(".mirabuf.PartDefinition.physicalData: object expected"); - message.physicalData = $root.mirabuf.PhysicalProperties.fromObject(object.physicalData); + throw TypeError(".mirabuf.PartDefinition.physicalData: object expected") + message.physicalData = $root.mirabuf.PhysicalProperties.fromObject(object.physicalData) } if (object.baseTransform != null) { if (typeof object.baseTransform !== "object") - throw TypeError(".mirabuf.PartDefinition.baseTransform: object expected"); - message.baseTransform = $root.mirabuf.Transform.fromObject(object.baseTransform); + throw TypeError(".mirabuf.PartDefinition.baseTransform: object expected") + message.baseTransform = $root.mirabuf.Transform.fromObject(object.baseTransform) } if (object.bodies) { - if (!Array.isArray(object.bodies)) - throw TypeError(".mirabuf.PartDefinition.bodies: array expected"); - message.bodies = []; + if (!Array.isArray(object.bodies)) throw TypeError(".mirabuf.PartDefinition.bodies: array expected") + message.bodies = [] for (let i = 0; i < object.bodies.length; ++i) { if (typeof object.bodies[i] !== "object") - throw TypeError(".mirabuf.PartDefinition.bodies: object expected"); - message.bodies[i] = $root.mirabuf.Body.fromObject(object.bodies[i]); + throw TypeError(".mirabuf.PartDefinition.bodies: object expected") + message.bodies[i] = $root.mirabuf.Body.fromObject(object.bodies[i]) } } - if (object.dynamic != null) - message.dynamic = Boolean(object.dynamic); - if (object.frictionOverride != null) - message.frictionOverride = Number(object.frictionOverride); - if (object.massOverride != null) - message.massOverride = Number(object.massOverride); - return message; - }; + if (object.dynamic != null) message.dynamic = Boolean(object.dynamic) + if (object.frictionOverride != null) message.frictionOverride = Number(object.frictionOverride) + if (object.massOverride != null) message.massOverride = Number(object.massOverride) + return message + } /** * Creates a plain object from a PartDefinition message. Also converts values to other types if specified. @@ -1398,38 +1391,41 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ PartDefinition.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.bodies = []; + if (!options) options = {} + let object = {} + if (options.arrays || options.defaults) object.bodies = [] if (options.defaults) { - object.info = null; - object.physicalData = null; - object.baseTransform = null; - object.dynamic = false; - object.frictionOverride = 0; - object.massOverride = 0; + object.info = null + object.physicalData = null + object.baseTransform = null + object.dynamic = false + object.frictionOverride = 0 + object.massOverride = 0 } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); + object.info = $root.mirabuf.Info.toObject(message.info, options) if (message.physicalData != null && message.hasOwnProperty("physicalData")) - object.physicalData = $root.mirabuf.PhysicalProperties.toObject(message.physicalData, options); + object.physicalData = $root.mirabuf.PhysicalProperties.toObject(message.physicalData, options) if (message.baseTransform != null && message.hasOwnProperty("baseTransform")) - object.baseTransform = $root.mirabuf.Transform.toObject(message.baseTransform, options); + object.baseTransform = $root.mirabuf.Transform.toObject(message.baseTransform, options) if (message.bodies && message.bodies.length) { - object.bodies = []; + object.bodies = [] for (let j = 0; j < message.bodies.length; ++j) - object.bodies[j] = $root.mirabuf.Body.toObject(message.bodies[j], options); + object.bodies[j] = $root.mirabuf.Body.toObject(message.bodies[j], options) } - if (message.dynamic != null && message.hasOwnProperty("dynamic")) - object.dynamic = message.dynamic; + if (message.dynamic != null && message.hasOwnProperty("dynamic")) object.dynamic = message.dynamic if (message.frictionOverride != null && message.hasOwnProperty("frictionOverride")) - object.frictionOverride = options.json && !isFinite(message.frictionOverride) ? String(message.frictionOverride) : message.frictionOverride; + object.frictionOverride = + options.json && !isFinite(message.frictionOverride) + ? String(message.frictionOverride) + : message.frictionOverride if (message.massOverride != null && message.hasOwnProperty("massOverride")) - object.massOverride = options.json && !isFinite(message.massOverride) ? String(message.massOverride) : message.massOverride; - return object; - }; + object.massOverride = + options.json && !isFinite(message.massOverride) + ? String(message.massOverride) + : message.massOverride + return object + } /** * Converts this PartDefinition to JSON. @@ -1439,8 +1435,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ PartDefinition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for PartDefinition @@ -1452,16 +1448,15 @@ export const mirabuf = $root.mirabuf = (() => { */ PartDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.PartDefinition"; - }; - - return PartDefinition; - })(); + return typeUrlPrefix + "/mirabuf.PartDefinition" + } - mirabuf.PartInstance = (function() { + return PartDefinition + })() + mirabuf.PartInstance = (function () { /** * Properties of a PartInstance. * @memberof mirabuf @@ -1485,11 +1480,10 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.IPartInstance=} [properties] Properties to set */ function PartInstance(properties) { - this.joints = []; + this.joints = [] if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -1498,7 +1492,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartInstance * @instance */ - PartInstance.prototype.info = null; + PartInstance.prototype.info = null /** * Reference to the Part Definition defined in Assembly Data @@ -1506,7 +1500,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartInstance * @instance */ - PartInstance.prototype.partDefinitionReference = ""; + PartInstance.prototype.partDefinitionReference = "" /** * Overriding the object transform (moves the part from the def) - in design hierarchy context @@ -1514,7 +1508,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartInstance * @instance */ - PartInstance.prototype.transform = null; + PartInstance.prototype.transform = null /** * Position transform from a global scope @@ -1522,7 +1516,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartInstance * @instance */ - PartInstance.prototype.globalTransform = null; + PartInstance.prototype.globalTransform = null /** * Joints that interact with this element @@ -1530,7 +1524,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartInstance * @instance */ - PartInstance.prototype.joints = $util.emptyArray; + PartInstance.prototype.joints = $util.emptyArray /** * PartInstance appearance. @@ -1538,7 +1532,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartInstance * @instance */ - PartInstance.prototype.appearance = ""; + PartInstance.prototype.appearance = "" /** * Physical Material Reference to link to `Materials->PhysicalMaterial->Info->id` @@ -1546,7 +1540,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartInstance * @instance */ - PartInstance.prototype.physicalMaterial = ""; + PartInstance.prototype.physicalMaterial = "" /** * Flag that if enabled indicates we should skip generating a collider, defaults to FALSE or undefined @@ -1554,7 +1548,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PartInstance * @instance */ - PartInstance.prototype.skipCollider = false; + PartInstance.prototype.skipCollider = false /** * Creates a new PartInstance instance using the specified properties. @@ -1565,8 +1559,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.PartInstance} PartInstance instance */ PartInstance.create = function create(properties) { - return new PartInstance(properties); - }; + return new PartInstance(properties) + } /** * Encodes the specified PartInstance message. Does not implicitly {@link mirabuf.PartInstance.verify|verify} messages. @@ -1578,27 +1572,35 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ PartInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.partDefinitionReference != null && Object.hasOwnProperty.call(message, "partDefinitionReference")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.partDefinitionReference); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() + if ( + message.partDefinitionReference != null && + Object.hasOwnProperty.call(message, "partDefinitionReference") + ) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.partDefinitionReference) if (message.transform != null && Object.hasOwnProperty.call(message, "transform")) - $root.mirabuf.Transform.encode(message.transform, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.mirabuf.Transform.encode( + message.transform, + writer.uint32(/* id 3, wireType 2 =*/ 26).fork() + ).ldelim() if (message.globalTransform != null && Object.hasOwnProperty.call(message, "globalTransform")) - $root.mirabuf.Transform.encode(message.globalTransform, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.mirabuf.Transform.encode( + message.globalTransform, + writer.uint32(/* id 4, wireType 2 =*/ 34).fork() + ).ldelim() if (message.joints != null && message.joints.length) for (let i = 0; i < message.joints.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.joints[i]); + writer.uint32(/* id 5, wireType 2 =*/ 42).string(message.joints[i]) if (message.appearance != null && Object.hasOwnProperty.call(message, "appearance")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.appearance); + writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.appearance) if (message.physicalMaterial != null && Object.hasOwnProperty.call(message, "physicalMaterial")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.physicalMaterial); + writer.uint32(/* id 7, wireType 2 =*/ 58).string(message.physicalMaterial) if (message.skipCollider != null && Object.hasOwnProperty.call(message, "skipCollider")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.skipCollider); - return writer; - }; + writer.uint32(/* id 8, wireType 0 =*/ 64).bool(message.skipCollider) + return writer + } /** * Encodes the specified PartInstance message, length delimited. Does not implicitly {@link mirabuf.PartInstance.verify|verify} messages. @@ -1610,8 +1612,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ PartInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a PartInstance message from the specified reader or buffer. @@ -1625,53 +1627,52 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PartInstance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.PartInstance(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.PartInstance() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.partDefinitionReference = reader.string(); - break; + case 2: { + message.partDefinitionReference = reader.string() + break } - case 3: { - message.transform = $root.mirabuf.Transform.decode(reader, reader.uint32()); - break; + case 3: { + message.transform = $root.mirabuf.Transform.decode(reader, reader.uint32()) + break } - case 4: { - message.globalTransform = $root.mirabuf.Transform.decode(reader, reader.uint32()); - break; + case 4: { + message.globalTransform = $root.mirabuf.Transform.decode(reader, reader.uint32()) + break } - case 5: { - if (!(message.joints && message.joints.length)) - message.joints = []; - message.joints.push(reader.string()); - break; + case 5: { + if (!(message.joints && message.joints.length)) message.joints = [] + message.joints.push(reader.string()) + break } - case 6: { - message.appearance = reader.string(); - break; + case 6: { + message.appearance = reader.string() + break } - case 7: { - message.physicalMaterial = reader.string(); - break; + case 7: { + message.physicalMaterial = reader.string() + break } - case 8: { - message.skipCollider = reader.bool(); - break; + case 8: { + message.skipCollider = reader.bool() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a PartInstance message from the specified reader or buffer, length delimited. @@ -1684,10 +1685,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PartInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a PartInstance message. @@ -1698,44 +1698,34 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ PartInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.partDefinitionReference != null && message.hasOwnProperty("partDefinitionReference")) - if (!$util.isString(message.partDefinitionReference)) - return "partDefinitionReference: string expected"; + if (!$util.isString(message.partDefinitionReference)) return "partDefinitionReference: string expected" if (message.transform != null && message.hasOwnProperty("transform")) { - let error = $root.mirabuf.Transform.verify(message.transform); - if (error) - return "transform." + error; + let error = $root.mirabuf.Transform.verify(message.transform) + if (error) return "transform." + error } if (message.globalTransform != null && message.hasOwnProperty("globalTransform")) { - let error = $root.mirabuf.Transform.verify(message.globalTransform); - if (error) - return "globalTransform." + error; + let error = $root.mirabuf.Transform.verify(message.globalTransform) + if (error) return "globalTransform." + error } if (message.joints != null && message.hasOwnProperty("joints")) { - if (!Array.isArray(message.joints)) - return "joints: array expected"; + if (!Array.isArray(message.joints)) return "joints: array expected" for (let i = 0; i < message.joints.length; ++i) - if (!$util.isString(message.joints[i])) - return "joints: string[] expected"; + if (!$util.isString(message.joints[i])) return "joints: string[] expected" } if (message.appearance != null && message.hasOwnProperty("appearance")) - if (!$util.isString(message.appearance)) - return "appearance: string expected"; + if (!$util.isString(message.appearance)) return "appearance: string expected" if (message.physicalMaterial != null && message.hasOwnProperty("physicalMaterial")) - if (!$util.isString(message.physicalMaterial)) - return "physicalMaterial: string expected"; + if (!$util.isString(message.physicalMaterial)) return "physicalMaterial: string expected" if (message.skipCollider != null && message.hasOwnProperty("skipCollider")) - if (typeof message.skipCollider !== "boolean") - return "skipCollider: boolean expected"; - return null; - }; + if (typeof message.skipCollider !== "boolean") return "skipCollider: boolean expected" + return null + } /** * Creates a PartInstance message from a plain object. Also converts values to their respective internal types. @@ -1746,41 +1736,34 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.PartInstance} PartInstance */ PartInstance.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.PartInstance) - return object; - let message = new $root.mirabuf.PartInstance(); + if (object instanceof $root.mirabuf.PartInstance) return object + let message = new $root.mirabuf.PartInstance() if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".mirabuf.PartInstance.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + if (typeof object.info !== "object") throw TypeError(".mirabuf.PartInstance.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } if (object.partDefinitionReference != null) - message.partDefinitionReference = String(object.partDefinitionReference); + message.partDefinitionReference = String(object.partDefinitionReference) if (object.transform != null) { if (typeof object.transform !== "object") - throw TypeError(".mirabuf.PartInstance.transform: object expected"); - message.transform = $root.mirabuf.Transform.fromObject(object.transform); + throw TypeError(".mirabuf.PartInstance.transform: object expected") + message.transform = $root.mirabuf.Transform.fromObject(object.transform) } if (object.globalTransform != null) { if (typeof object.globalTransform !== "object") - throw TypeError(".mirabuf.PartInstance.globalTransform: object expected"); - message.globalTransform = $root.mirabuf.Transform.fromObject(object.globalTransform); + throw TypeError(".mirabuf.PartInstance.globalTransform: object expected") + message.globalTransform = $root.mirabuf.Transform.fromObject(object.globalTransform) } if (object.joints) { - if (!Array.isArray(object.joints)) - throw TypeError(".mirabuf.PartInstance.joints: array expected"); - message.joints = []; - for (let i = 0; i < object.joints.length; ++i) - message.joints[i] = String(object.joints[i]); - } - if (object.appearance != null) - message.appearance = String(object.appearance); - if (object.physicalMaterial != null) - message.physicalMaterial = String(object.physicalMaterial); - if (object.skipCollider != null) - message.skipCollider = Boolean(object.skipCollider); - return message; - }; + if (!Array.isArray(object.joints)) throw TypeError(".mirabuf.PartInstance.joints: array expected") + message.joints = [] + for (let i = 0; i < object.joints.length; ++i) message.joints[i] = String(object.joints[i]) + } + if (object.appearance != null) message.appearance = String(object.appearance) + if (object.physicalMaterial != null) message.physicalMaterial = String(object.physicalMaterial) + if (object.skipCollider != null) message.skipCollider = Boolean(object.skipCollider) + return message + } /** * Creates a plain object from a PartInstance message. Also converts values to other types if specified. @@ -1792,41 +1775,38 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ PartInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.joints = []; + if (!options) options = {} + let object = {} + if (options.arrays || options.defaults) object.joints = [] if (options.defaults) { - object.info = null; - object.partDefinitionReference = ""; - object.transform = null; - object.globalTransform = null; - object.appearance = ""; - object.physicalMaterial = ""; - object.skipCollider = false; + object.info = null + object.partDefinitionReference = "" + object.transform = null + object.globalTransform = null + object.appearance = "" + object.physicalMaterial = "" + object.skipCollider = false } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); + object.info = $root.mirabuf.Info.toObject(message.info, options) if (message.partDefinitionReference != null && message.hasOwnProperty("partDefinitionReference")) - object.partDefinitionReference = message.partDefinitionReference; + object.partDefinitionReference = message.partDefinitionReference if (message.transform != null && message.hasOwnProperty("transform")) - object.transform = $root.mirabuf.Transform.toObject(message.transform, options); + object.transform = $root.mirabuf.Transform.toObject(message.transform, options) if (message.globalTransform != null && message.hasOwnProperty("globalTransform")) - object.globalTransform = $root.mirabuf.Transform.toObject(message.globalTransform, options); + object.globalTransform = $root.mirabuf.Transform.toObject(message.globalTransform, options) if (message.joints && message.joints.length) { - object.joints = []; - for (let j = 0; j < message.joints.length; ++j) - object.joints[j] = message.joints[j]; + object.joints = [] + for (let j = 0; j < message.joints.length; ++j) object.joints[j] = message.joints[j] } if (message.appearance != null && message.hasOwnProperty("appearance")) - object.appearance = message.appearance; + object.appearance = message.appearance if (message.physicalMaterial != null && message.hasOwnProperty("physicalMaterial")) - object.physicalMaterial = message.physicalMaterial; + object.physicalMaterial = message.physicalMaterial if (message.skipCollider != null && message.hasOwnProperty("skipCollider")) - object.skipCollider = message.skipCollider; - return object; - }; + object.skipCollider = message.skipCollider + return object + } /** * Converts this PartInstance to JSON. @@ -1836,8 +1816,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ PartInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for PartInstance @@ -1849,16 +1829,15 @@ export const mirabuf = $root.mirabuf = (() => { */ PartInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.PartInstance"; - }; - - return PartInstance; - })(); + return typeUrlPrefix + "/mirabuf.PartInstance" + } - mirabuf.Body = (function() { + return PartInstance + })() + mirabuf.Body = (function () { /** * Properties of a Body. * @memberof mirabuf @@ -1880,8 +1859,7 @@ export const mirabuf = $root.mirabuf = (() => { function Body(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -1890,7 +1868,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Body * @instance */ - Body.prototype.info = null; + Body.prototype.info = null /** * Reference to Part Definition @@ -1898,7 +1876,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Body * @instance */ - Body.prototype.part = ""; + Body.prototype.part = "" /** * Triangle Mesh for rendering @@ -1906,7 +1884,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Body * @instance */ - Body.prototype.triangleMesh = null; + Body.prototype.triangleMesh = null /** * Override Visual Appearance for the body @@ -1914,7 +1892,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Body * @instance */ - Body.prototype.appearanceOverride = ""; + Body.prototype.appearanceOverride = "" /** * Creates a new Body instance using the specified properties. @@ -1925,8 +1903,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Body} Body instance */ Body.create = function create(properties) { - return new Body(properties); - }; + return new Body(properties) + } /** * Encodes the specified Body message. Does not implicitly {@link mirabuf.Body.verify|verify} messages. @@ -1938,18 +1916,20 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Body.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.part != null && Object.hasOwnProperty.call(message, "part")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.part); + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.part) if (message.triangleMesh != null && Object.hasOwnProperty.call(message, "triangleMesh")) - $root.mirabuf.TriangleMesh.encode(message.triangleMesh, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.mirabuf.TriangleMesh.encode( + message.triangleMesh, + writer.uint32(/* id 3, wireType 2 =*/ 26).fork() + ).ldelim() if (message.appearanceOverride != null && Object.hasOwnProperty.call(message, "appearanceOverride")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.appearanceOverride); - return writer; - }; + writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.appearanceOverride) + return writer + } /** * Encodes the specified Body message, length delimited. Does not implicitly {@link mirabuf.Body.verify|verify} messages. @@ -1961,8 +1941,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Body.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Body message from the specified reader or buffer. @@ -1976,35 +1956,35 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Body.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.Body(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.Body() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.part = reader.string(); - break; + case 2: { + message.part = reader.string() + break } - case 3: { - message.triangleMesh = $root.mirabuf.TriangleMesh.decode(reader, reader.uint32()); - break; + case 3: { + message.triangleMesh = $root.mirabuf.TriangleMesh.decode(reader, reader.uint32()) + break } - case 4: { - message.appearanceOverride = reader.string(); - break; + case 4: { + message.appearanceOverride = reader.string() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Body message from the specified reader or buffer, length delimited. @@ -2017,10 +1997,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Body.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Body message. @@ -2031,26 +2010,21 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Body.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.part != null && message.hasOwnProperty("part")) - if (!$util.isString(message.part)) - return "part: string expected"; + if (!$util.isString(message.part)) return "part: string expected" if (message.triangleMesh != null && message.hasOwnProperty("triangleMesh")) { - let error = $root.mirabuf.TriangleMesh.verify(message.triangleMesh); - if (error) - return "triangleMesh." + error; + let error = $root.mirabuf.TriangleMesh.verify(message.triangleMesh) + if (error) return "triangleMesh." + error } if (message.appearanceOverride != null && message.hasOwnProperty("appearanceOverride")) - if (!$util.isString(message.appearanceOverride)) - return "appearanceOverride: string expected"; - return null; - }; + if (!$util.isString(message.appearanceOverride)) return "appearanceOverride: string expected" + return null + } /** * Creates a Body message from a plain object. Also converts values to their respective internal types. @@ -2061,25 +2035,21 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Body} Body */ Body.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.Body) - return object; - let message = new $root.mirabuf.Body(); + if (object instanceof $root.mirabuf.Body) return object + let message = new $root.mirabuf.Body() if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".mirabuf.Body.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + if (typeof object.info !== "object") throw TypeError(".mirabuf.Body.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } - if (object.part != null) - message.part = String(object.part); + if (object.part != null) message.part = String(object.part) if (object.triangleMesh != null) { if (typeof object.triangleMesh !== "object") - throw TypeError(".mirabuf.Body.triangleMesh: object expected"); - message.triangleMesh = $root.mirabuf.TriangleMesh.fromObject(object.triangleMesh); + throw TypeError(".mirabuf.Body.triangleMesh: object expected") + message.triangleMesh = $root.mirabuf.TriangleMesh.fromObject(object.triangleMesh) } - if (object.appearanceOverride != null) - message.appearanceOverride = String(object.appearanceOverride); - return message; - }; + if (object.appearanceOverride != null) message.appearanceOverride = String(object.appearanceOverride) + return message + } /** * Creates a plain object from a Body message. Also converts values to other types if specified. @@ -2091,25 +2061,23 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Body.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.info = null; - object.part = ""; - object.triangleMesh = null; - object.appearanceOverride = ""; + object.info = null + object.part = "" + object.triangleMesh = null + object.appearanceOverride = "" } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); - if (message.part != null && message.hasOwnProperty("part")) - object.part = message.part; + object.info = $root.mirabuf.Info.toObject(message.info, options) + if (message.part != null && message.hasOwnProperty("part")) object.part = message.part if (message.triangleMesh != null && message.hasOwnProperty("triangleMesh")) - object.triangleMesh = $root.mirabuf.TriangleMesh.toObject(message.triangleMesh, options); + object.triangleMesh = $root.mirabuf.TriangleMesh.toObject(message.triangleMesh, options) if (message.appearanceOverride != null && message.hasOwnProperty("appearanceOverride")) - object.appearanceOverride = message.appearanceOverride; - return object; - }; + object.appearanceOverride = message.appearanceOverride + return object + } /** * Converts this Body to JSON. @@ -2119,8 +2087,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Body.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Body @@ -2132,16 +2100,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Body.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.Body"; - }; - - return Body; - })(); + return typeUrlPrefix + "/mirabuf.Body" + } - mirabuf.TriangleMesh = (function() { + return Body + })() + mirabuf.TriangleMesh = (function () { /** * Properties of a TriangleMesh. * @memberof mirabuf @@ -2164,8 +2131,7 @@ export const mirabuf = $root.mirabuf = (() => { function TriangleMesh(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -2174,7 +2140,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.TriangleMesh * @instance */ - TriangleMesh.prototype.info = null; + TriangleMesh.prototype.info = null /** * Is this object a Plane ? (Does it have volume) @@ -2182,7 +2148,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.TriangleMesh * @instance */ - TriangleMesh.prototype.hasVolume = false; + TriangleMesh.prototype.hasVolume = false /** * Rendered Appearance properties referenced from Assembly Data @@ -2190,7 +2156,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.TriangleMesh * @instance */ - TriangleMesh.prototype.materialReference = ""; + TriangleMesh.prototype.materialReference = "" /** * Stored as true types, inidicies, verts, uv @@ -2198,7 +2164,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.TriangleMesh * @instance */ - TriangleMesh.prototype.mesh = null; + TriangleMesh.prototype.mesh = null /** * Stored as binary data in bytes @@ -2206,10 +2172,10 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.TriangleMesh * @instance */ - TriangleMesh.prototype.bmesh = null; + TriangleMesh.prototype.bmesh = null // OneOf field names bound to virtual getters and setters - let $oneOfFields; + let $oneOfFields /** * What kind of Mesh Data exists in this Triangle Mesh @@ -2218,9 +2184,9 @@ export const mirabuf = $root.mirabuf = (() => { * @instance */ Object.defineProperty(TriangleMesh.prototype, "meshType", { - get: $util.oneOfGetter($oneOfFields = ["mesh", "bmesh"]), - set: $util.oneOfSetter($oneOfFields) - }); + get: $util.oneOfGetter(($oneOfFields = ["mesh", "bmesh"])), + set: $util.oneOfSetter($oneOfFields), + }) /** * Creates a new TriangleMesh instance using the specified properties. @@ -2231,8 +2197,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.TriangleMesh} TriangleMesh instance */ TriangleMesh.create = function create(properties) { - return new TriangleMesh(properties); - }; + return new TriangleMesh(properties) + } /** * Encodes the specified TriangleMesh message. Does not implicitly {@link mirabuf.TriangleMesh.verify|verify} messages. @@ -2244,20 +2210,22 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ TriangleMesh.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.hasVolume != null && Object.hasOwnProperty.call(message, "hasVolume")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.hasVolume); + writer.uint32(/* id 2, wireType 0 =*/ 16).bool(message.hasVolume) if (message.materialReference != null && Object.hasOwnProperty.call(message, "materialReference")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.materialReference); + writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.materialReference) if (message.mesh != null && Object.hasOwnProperty.call(message, "mesh")) - $root.mirabuf.Mesh.encode(message.mesh, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.mirabuf.Mesh.encode(message.mesh, writer.uint32(/* id 4, wireType 2 =*/ 34).fork()).ldelim() if (message.bmesh != null && Object.hasOwnProperty.call(message, "bmesh")) - $root.mirabuf.BinaryMesh.encode(message.bmesh, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; + $root.mirabuf.BinaryMesh.encode( + message.bmesh, + writer.uint32(/* id 5, wireType 2 =*/ 42).fork() + ).ldelim() + return writer + } /** * Encodes the specified TriangleMesh message, length delimited. Does not implicitly {@link mirabuf.TriangleMesh.verify|verify} messages. @@ -2269,8 +2237,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ TriangleMesh.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a TriangleMesh message from the specified reader or buffer. @@ -2284,39 +2252,39 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TriangleMesh.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.TriangleMesh(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.TriangleMesh() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.hasVolume = reader.bool(); - break; + case 2: { + message.hasVolume = reader.bool() + break } - case 3: { - message.materialReference = reader.string(); - break; + case 3: { + message.materialReference = reader.string() + break } - case 4: { - message.mesh = $root.mirabuf.Mesh.decode(reader, reader.uint32()); - break; + case 4: { + message.mesh = $root.mirabuf.Mesh.decode(reader, reader.uint32()) + break } - case 5: { - message.bmesh = $root.mirabuf.BinaryMesh.decode(reader, reader.uint32()); - break; + case 5: { + message.bmesh = $root.mirabuf.BinaryMesh.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a TriangleMesh message from the specified reader or buffer, length delimited. @@ -2329,10 +2297,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ TriangleMesh.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a TriangleMesh message. @@ -2343,40 +2310,33 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ TriangleMesh.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - let properties = {}; + if (typeof message !== "object" || message === null) return "object expected" + let properties = {} if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.hasVolume != null && message.hasOwnProperty("hasVolume")) - if (typeof message.hasVolume !== "boolean") - return "hasVolume: boolean expected"; + if (typeof message.hasVolume !== "boolean") return "hasVolume: boolean expected" if (message.materialReference != null && message.hasOwnProperty("materialReference")) - if (!$util.isString(message.materialReference)) - return "materialReference: string expected"; + if (!$util.isString(message.materialReference)) return "materialReference: string expected" if (message.mesh != null && message.hasOwnProperty("mesh")) { - properties.meshType = 1; + properties.meshType = 1 { - let error = $root.mirabuf.Mesh.verify(message.mesh); - if (error) - return "mesh." + error; + let error = $root.mirabuf.Mesh.verify(message.mesh) + if (error) return "mesh." + error } } if (message.bmesh != null && message.hasOwnProperty("bmesh")) { - if (properties.meshType === 1) - return "meshType: multiple values"; - properties.meshType = 1; + if (properties.meshType === 1) return "meshType: multiple values" + properties.meshType = 1 { - let error = $root.mirabuf.BinaryMesh.verify(message.bmesh); - if (error) - return "bmesh." + error; + let error = $root.mirabuf.BinaryMesh.verify(message.bmesh) + if (error) return "bmesh." + error } } - return null; - }; + return null + } /** * Creates a TriangleMesh message from a plain object. Also converts values to their respective internal types. @@ -2387,30 +2347,24 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.TriangleMesh} TriangleMesh */ TriangleMesh.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.TriangleMesh) - return object; - let message = new $root.mirabuf.TriangleMesh(); + if (object instanceof $root.mirabuf.TriangleMesh) return object + let message = new $root.mirabuf.TriangleMesh() if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".mirabuf.TriangleMesh.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); - } - if (object.hasVolume != null) - message.hasVolume = Boolean(object.hasVolume); - if (object.materialReference != null) - message.materialReference = String(object.materialReference); + if (typeof object.info !== "object") throw TypeError(".mirabuf.TriangleMesh.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) + } + if (object.hasVolume != null) message.hasVolume = Boolean(object.hasVolume) + if (object.materialReference != null) message.materialReference = String(object.materialReference) if (object.mesh != null) { - if (typeof object.mesh !== "object") - throw TypeError(".mirabuf.TriangleMesh.mesh: object expected"); - message.mesh = $root.mirabuf.Mesh.fromObject(object.mesh); + if (typeof object.mesh !== "object") throw TypeError(".mirabuf.TriangleMesh.mesh: object expected") + message.mesh = $root.mirabuf.Mesh.fromObject(object.mesh) } if (object.bmesh != null) { - if (typeof object.bmesh !== "object") - throw TypeError(".mirabuf.TriangleMesh.bmesh: object expected"); - message.bmesh = $root.mirabuf.BinaryMesh.fromObject(object.bmesh); + if (typeof object.bmesh !== "object") throw TypeError(".mirabuf.TriangleMesh.bmesh: object expected") + message.bmesh = $root.mirabuf.BinaryMesh.fromObject(object.bmesh) } - return message; - }; + return message + } /** * Creates a plain object from a TriangleMesh message. Also converts values to other types if specified. @@ -2422,32 +2376,28 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ TriangleMesh.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.info = null; - object.hasVolume = false; - object.materialReference = ""; + object.info = null + object.hasVolume = false + object.materialReference = "" } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); - if (message.hasVolume != null && message.hasOwnProperty("hasVolume")) - object.hasVolume = message.hasVolume; + object.info = $root.mirabuf.Info.toObject(message.info, options) + if (message.hasVolume != null && message.hasOwnProperty("hasVolume")) object.hasVolume = message.hasVolume if (message.materialReference != null && message.hasOwnProperty("materialReference")) - object.materialReference = message.materialReference; + object.materialReference = message.materialReference if (message.mesh != null && message.hasOwnProperty("mesh")) { - object.mesh = $root.mirabuf.Mesh.toObject(message.mesh, options); - if (options.oneofs) - object.meshType = "mesh"; + object.mesh = $root.mirabuf.Mesh.toObject(message.mesh, options) + if (options.oneofs) object.meshType = "mesh" } if (message.bmesh != null && message.hasOwnProperty("bmesh")) { - object.bmesh = $root.mirabuf.BinaryMesh.toObject(message.bmesh, options); - if (options.oneofs) - object.meshType = "bmesh"; + object.bmesh = $root.mirabuf.BinaryMesh.toObject(message.bmesh, options) + if (options.oneofs) object.meshType = "bmesh" } - return object; - }; + return object + } /** * Converts this TriangleMesh to JSON. @@ -2457,8 +2407,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ TriangleMesh.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for TriangleMesh @@ -2470,16 +2420,15 @@ export const mirabuf = $root.mirabuf = (() => { */ TriangleMesh.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.TriangleMesh"; - }; - - return TriangleMesh; - })(); + return typeUrlPrefix + "/mirabuf.TriangleMesh" + } - mirabuf.Mesh = (function() { + return TriangleMesh + })() + mirabuf.Mesh = (function () { /** * Properties of a Mesh. * @memberof mirabuf @@ -2499,14 +2448,13 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.IMesh=} [properties] Properties to set */ function Mesh(properties) { - this.verts = []; - this.normals = []; - this.uv = []; - this.indices = []; + this.verts = [] + this.normals = [] + this.uv = [] + this.indices = [] if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -2515,7 +2463,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Mesh * @instance */ - Mesh.prototype.verts = $util.emptyArray; + Mesh.prototype.verts = $util.emptyArray /** * Tri Mesh Normals vec3 @@ -2523,7 +2471,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Mesh * @instance */ - Mesh.prototype.normals = $util.emptyArray; + Mesh.prototype.normals = $util.emptyArray /** * Tri Mesh uv Mapping vec2 @@ -2531,7 +2479,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Mesh * @instance */ - Mesh.prototype.uv = $util.emptyArray; + Mesh.prototype.uv = $util.emptyArray /** * Tri Mesh indicies (Vert Map) @@ -2539,7 +2487,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Mesh * @instance */ - Mesh.prototype.indices = $util.emptyArray; + Mesh.prototype.indices = $util.emptyArray /** * Creates a new Mesh instance using the specified properties. @@ -2550,8 +2498,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Mesh} Mesh instance */ Mesh.create = function create(properties) { - return new Mesh(properties); - }; + return new Mesh(properties) + } /** * Encodes the specified Mesh message. Does not implicitly {@link mirabuf.Mesh.verify|verify} messages. @@ -2563,34 +2511,29 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Mesh.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.verts != null && message.verts.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (let i = 0; i < message.verts.length; ++i) - writer.float(message.verts[i]); - writer.ldelim(); + writer.uint32(/* id 1, wireType 2 =*/ 10).fork() + for (let i = 0; i < message.verts.length; ++i) writer.float(message.verts[i]) + writer.ldelim() } if (message.normals != null && message.normals.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (let i = 0; i < message.normals.length; ++i) - writer.float(message.normals[i]); - writer.ldelim(); + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + for (let i = 0; i < message.normals.length; ++i) writer.float(message.normals[i]) + writer.ldelim() } if (message.uv != null && message.uv.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (let i = 0; i < message.uv.length; ++i) - writer.float(message.uv[i]); - writer.ldelim(); + writer.uint32(/* id 3, wireType 2 =*/ 26).fork() + for (let i = 0; i < message.uv.length; ++i) writer.float(message.uv[i]) + writer.ldelim() } if (message.indices != null && message.indices.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (let i = 0; i < message.indices.length; ++i) - writer.int32(message.indices[i]); - writer.ldelim(); + writer.uint32(/* id 4, wireType 2 =*/ 34).fork() + for (let i = 0; i < message.indices.length; ++i) writer.int32(message.indices[i]) + writer.ldelim() } - return writer; - }; + return writer + } /** * Encodes the specified Mesh message, length delimited. Does not implicitly {@link mirabuf.Mesh.verify|verify} messages. @@ -2602,8 +2545,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Mesh.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Mesh message from the specified reader or buffer. @@ -2617,63 +2560,51 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Mesh.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.Mesh(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.Mesh() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - if (!(message.verts && message.verts.length)) - message.verts = []; + case 1: { + if (!(message.verts && message.verts.length)) message.verts = [] if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.verts.push(reader.float()); - } else - message.verts.push(reader.float()); - break; - } - case 2: { - if (!(message.normals && message.normals.length)) - message.normals = []; + let end2 = reader.uint32() + reader.pos + while (reader.pos < end2) message.verts.push(reader.float()) + } else message.verts.push(reader.float()) + break + } + case 2: { + if (!(message.normals && message.normals.length)) message.normals = [] if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.normals.push(reader.float()); - } else - message.normals.push(reader.float()); - break; - } - case 3: { - if (!(message.uv && message.uv.length)) - message.uv = []; + let end2 = reader.uint32() + reader.pos + while (reader.pos < end2) message.normals.push(reader.float()) + } else message.normals.push(reader.float()) + break + } + case 3: { + if (!(message.uv && message.uv.length)) message.uv = [] if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.uv.push(reader.float()); - } else - message.uv.push(reader.float()); - break; - } - case 4: { - if (!(message.indices && message.indices.length)) - message.indices = []; + let end2 = reader.uint32() + reader.pos + while (reader.pos < end2) message.uv.push(reader.float()) + } else message.uv.push(reader.float()) + break + } + case 4: { + if (!(message.indices && message.indices.length)) message.indices = [] if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.indices.push(reader.int32()); - } else - message.indices.push(reader.int32()); - break; + let end2 = reader.uint32() + reader.pos + while (reader.pos < end2) message.indices.push(reader.int32()) + } else message.indices.push(reader.int32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Mesh message from the specified reader or buffer, length delimited. @@ -2686,10 +2617,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Mesh.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Mesh message. @@ -2700,38 +2630,29 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Mesh.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.verts != null && message.hasOwnProperty("verts")) { - if (!Array.isArray(message.verts)) - return "verts: array expected"; + if (!Array.isArray(message.verts)) return "verts: array expected" for (let i = 0; i < message.verts.length; ++i) - if (typeof message.verts[i] !== "number") - return "verts: number[] expected"; + if (typeof message.verts[i] !== "number") return "verts: number[] expected" } if (message.normals != null && message.hasOwnProperty("normals")) { - if (!Array.isArray(message.normals)) - return "normals: array expected"; + if (!Array.isArray(message.normals)) return "normals: array expected" for (let i = 0; i < message.normals.length; ++i) - if (typeof message.normals[i] !== "number") - return "normals: number[] expected"; + if (typeof message.normals[i] !== "number") return "normals: number[] expected" } if (message.uv != null && message.hasOwnProperty("uv")) { - if (!Array.isArray(message.uv)) - return "uv: array expected"; + if (!Array.isArray(message.uv)) return "uv: array expected" for (let i = 0; i < message.uv.length; ++i) - if (typeof message.uv[i] !== "number") - return "uv: number[] expected"; + if (typeof message.uv[i] !== "number") return "uv: number[] expected" } if (message.indices != null && message.hasOwnProperty("indices")) { - if (!Array.isArray(message.indices)) - return "indices: array expected"; + if (!Array.isArray(message.indices)) return "indices: array expected" for (let i = 0; i < message.indices.length; ++i) - if (!$util.isInteger(message.indices[i])) - return "indices: integer[] expected"; + if (!$util.isInteger(message.indices[i])) return "indices: integer[] expected" } - return null; - }; + return null + } /** * Creates a Mesh message from a plain object. Also converts values to their respective internal types. @@ -2742,39 +2663,30 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Mesh} Mesh */ Mesh.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.Mesh) - return object; - let message = new $root.mirabuf.Mesh(); + if (object instanceof $root.mirabuf.Mesh) return object + let message = new $root.mirabuf.Mesh() if (object.verts) { - if (!Array.isArray(object.verts)) - throw TypeError(".mirabuf.Mesh.verts: array expected"); - message.verts = []; - for (let i = 0; i < object.verts.length; ++i) - message.verts[i] = Number(object.verts[i]); + if (!Array.isArray(object.verts)) throw TypeError(".mirabuf.Mesh.verts: array expected") + message.verts = [] + for (let i = 0; i < object.verts.length; ++i) message.verts[i] = Number(object.verts[i]) } if (object.normals) { - if (!Array.isArray(object.normals)) - throw TypeError(".mirabuf.Mesh.normals: array expected"); - message.normals = []; - for (let i = 0; i < object.normals.length; ++i) - message.normals[i] = Number(object.normals[i]); + if (!Array.isArray(object.normals)) throw TypeError(".mirabuf.Mesh.normals: array expected") + message.normals = [] + for (let i = 0; i < object.normals.length; ++i) message.normals[i] = Number(object.normals[i]) } if (object.uv) { - if (!Array.isArray(object.uv)) - throw TypeError(".mirabuf.Mesh.uv: array expected"); - message.uv = []; - for (let i = 0; i < object.uv.length; ++i) - message.uv[i] = Number(object.uv[i]); + if (!Array.isArray(object.uv)) throw TypeError(".mirabuf.Mesh.uv: array expected") + message.uv = [] + for (let i = 0; i < object.uv.length; ++i) message.uv[i] = Number(object.uv[i]) } if (object.indices) { - if (!Array.isArray(object.indices)) - throw TypeError(".mirabuf.Mesh.indices: array expected"); - message.indices = []; - for (let i = 0; i < object.indices.length; ++i) - message.indices[i] = object.indices[i] | 0; + if (!Array.isArray(object.indices)) throw TypeError(".mirabuf.Mesh.indices: array expected") + message.indices = [] + for (let i = 0; i < object.indices.length; ++i) message.indices[i] = object.indices[i] | 0 } - return message; - }; + return message + } /** * Creates a plain object from a Mesh message. Also converts values to other types if specified. @@ -2786,37 +2698,37 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Mesh.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.arrays || options.defaults) { - object.verts = []; - object.normals = []; - object.uv = []; - object.indices = []; + object.verts = [] + object.normals = [] + object.uv = [] + object.indices = [] } if (message.verts && message.verts.length) { - object.verts = []; + object.verts = [] for (let j = 0; j < message.verts.length; ++j) - object.verts[j] = options.json && !isFinite(message.verts[j]) ? String(message.verts[j]) : message.verts[j]; + object.verts[j] = + options.json && !isFinite(message.verts[j]) ? String(message.verts[j]) : message.verts[j] } if (message.normals && message.normals.length) { - object.normals = []; + object.normals = [] for (let j = 0; j < message.normals.length; ++j) - object.normals[j] = options.json && !isFinite(message.normals[j]) ? String(message.normals[j]) : message.normals[j]; + object.normals[j] = + options.json && !isFinite(message.normals[j]) ? String(message.normals[j]) : message.normals[j] } if (message.uv && message.uv.length) { - object.uv = []; + object.uv = [] for (let j = 0; j < message.uv.length; ++j) - object.uv[j] = options.json && !isFinite(message.uv[j]) ? String(message.uv[j]) : message.uv[j]; + object.uv[j] = options.json && !isFinite(message.uv[j]) ? String(message.uv[j]) : message.uv[j] } if (message.indices && message.indices.length) { - object.indices = []; - for (let j = 0; j < message.indices.length; ++j) - object.indices[j] = message.indices[j]; + object.indices = [] + for (let j = 0; j < message.indices.length; ++j) object.indices[j] = message.indices[j] } - return object; - }; + return object + } /** * Converts this Mesh to JSON. @@ -2826,8 +2738,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Mesh.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Mesh @@ -2839,16 +2751,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Mesh.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.Mesh"; - }; - - return Mesh; - })(); + return typeUrlPrefix + "/mirabuf.Mesh" + } - mirabuf.BinaryMesh = (function() { + return Mesh + })() + mirabuf.BinaryMesh = (function () { /** * Properties of a BinaryMesh. * @memberof mirabuf @@ -2867,8 +2778,7 @@ export const mirabuf = $root.mirabuf = (() => { function BinaryMesh(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -2877,7 +2787,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.BinaryMesh * @instance */ - BinaryMesh.prototype.data = $util.newBuffer([]); + BinaryMesh.prototype.data = $util.newBuffer([]) /** * Creates a new BinaryMesh instance using the specified properties. @@ -2888,8 +2798,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.BinaryMesh} BinaryMesh instance */ BinaryMesh.create = function create(properties) { - return new BinaryMesh(properties); - }; + return new BinaryMesh(properties) + } /** * Encodes the specified BinaryMesh message. Does not implicitly {@link mirabuf.BinaryMesh.verify|verify} messages. @@ -2901,12 +2811,11 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ BinaryMesh.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); - return writer; - }; + writer.uint32(/* id 1, wireType 2 =*/ 10).bytes(message.data) + return writer + } /** * Encodes the specified BinaryMesh message, length delimited. Does not implicitly {@link mirabuf.BinaryMesh.verify|verify} messages. @@ -2918,8 +2827,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ BinaryMesh.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a BinaryMesh message from the specified reader or buffer. @@ -2933,23 +2842,23 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BinaryMesh.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.BinaryMesh(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.BinaryMesh() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.data = reader.bytes(); - break; + case 1: { + message.data = reader.bytes() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a BinaryMesh message from the specified reader or buffer, length delimited. @@ -2962,10 +2871,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BinaryMesh.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a BinaryMesh message. @@ -2976,13 +2884,12 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ BinaryMesh.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; + if (!((message.data && typeof message.data.length === "number") || $util.isString(message.data))) + return "data: buffer expected" + return null + } /** * Creates a BinaryMesh message from a plain object. Also converts values to their respective internal types. @@ -2993,16 +2900,18 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.BinaryMesh} BinaryMesh */ BinaryMesh.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.BinaryMesh) - return object; - let message = new $root.mirabuf.BinaryMesh(); + if (object instanceof $root.mirabuf.BinaryMesh) return object + let message = new $root.mirabuf.BinaryMesh() if (object.data != null) if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; - return message; - }; + $util.base64.decode( + object.data, + (message.data = $util.newBuffer($util.base64.length(object.data))), + 0 + ) + else if (object.data.length >= 0) message.data = object.data + return message + } /** * Creates a plain object from a BinaryMesh message. Also converts values to other types if specified. @@ -3014,21 +2923,23 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ BinaryMesh.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) - if (options.bytes === String) - object.data = ""; + if (options.bytes === String) object.data = "" else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); + object.data = [] + if (options.bytes !== Array) object.data = $util.newBuffer(object.data) } if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; + object.data = + options.bytes === String + ? $util.base64.encode(message.data, 0, message.data.length) + : options.bytes === Array + ? Array.prototype.slice.call(message.data) + : message.data + return object + } /** * Converts this BinaryMesh to JSON. @@ -3038,8 +2949,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ BinaryMesh.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for BinaryMesh @@ -3051,16 +2962,15 @@ export const mirabuf = $root.mirabuf = (() => { */ BinaryMesh.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.BinaryMesh"; - }; - - return BinaryMesh; - })(); + return typeUrlPrefix + "/mirabuf.BinaryMesh" + } - mirabuf.Node = (function() { + return BinaryMesh + })() + mirabuf.Node = (function () { /** * Properties of a Node. * @memberof mirabuf @@ -3079,11 +2989,10 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.INode=} [properties] Properties to set */ function Node(properties) { - this.children = []; + this.children = [] if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -3092,7 +3001,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Node * @instance */ - Node.prototype.value = ""; + Node.prototype.value = "" /** * the children for the given leaf @@ -3100,7 +3009,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Node * @instance */ - Node.prototype.children = $util.emptyArray; + Node.prototype.children = $util.emptyArray /** * other associated data that can be used @@ -3108,7 +3017,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Node * @instance */ - Node.prototype.userData = null; + Node.prototype.userData = null /** * Creates a new Node instance using the specified properties. @@ -3119,8 +3028,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Node} Node instance */ Node.create = function create(properties) { - return new Node(properties); - }; + return new Node(properties) + } /** * Encodes the specified Node message. Does not implicitly {@link mirabuf.Node.verify|verify} messages. @@ -3132,17 +3041,22 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Node.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.value) if (message.children != null && message.children.length) for (let i = 0; i < message.children.length; ++i) - $root.mirabuf.Node.encode(message.children[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.mirabuf.Node.encode( + message.children[i], + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ).ldelim() if (message.userData != null && Object.hasOwnProperty.call(message, "userData")) - $root.mirabuf.UserData.encode(message.userData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + $root.mirabuf.UserData.encode( + message.userData, + writer.uint32(/* id 3, wireType 2 =*/ 26).fork() + ).ldelim() + return writer + } /** * Encodes the specified Node message, length delimited. Does not implicitly {@link mirabuf.Node.verify|verify} messages. @@ -3154,8 +3068,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Node.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Node message from the specified reader or buffer. @@ -3169,33 +3083,32 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Node.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.Node(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.Node() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; + case 1: { + message.value = reader.string() + break } - case 2: { - if (!(message.children && message.children.length)) - message.children = []; - message.children.push($root.mirabuf.Node.decode(reader, reader.uint32())); - break; + case 2: { + if (!(message.children && message.children.length)) message.children = [] + message.children.push($root.mirabuf.Node.decode(reader, reader.uint32())) + break } - case 3: { - message.userData = $root.mirabuf.UserData.decode(reader, reader.uint32()); - break; + case 3: { + message.userData = $root.mirabuf.UserData.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Node message from the specified reader or buffer, length delimited. @@ -3208,10 +3121,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Node.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Node message. @@ -3222,27 +3134,22 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Node.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; + if (!$util.isString(message.value)) return "value: string expected" if (message.children != null && message.hasOwnProperty("children")) { - if (!Array.isArray(message.children)) - return "children: array expected"; + if (!Array.isArray(message.children)) return "children: array expected" for (let i = 0; i < message.children.length; ++i) { - let error = $root.mirabuf.Node.verify(message.children[i]); - if (error) - return "children." + error; + let error = $root.mirabuf.Node.verify(message.children[i]) + if (error) return "children." + error } } if (message.userData != null && message.hasOwnProperty("userData")) { - let error = $root.mirabuf.UserData.verify(message.userData); - if (error) - return "userData." + error; + let error = $root.mirabuf.UserData.verify(message.userData) + if (error) return "userData." + error } - return null; - }; + return null + } /** * Creates a Node message from a plain object. Also converts values to their respective internal types. @@ -3253,28 +3160,24 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Node} Node */ Node.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.Node) - return object; - let message = new $root.mirabuf.Node(); - if (object.value != null) - message.value = String(object.value); + if (object instanceof $root.mirabuf.Node) return object + let message = new $root.mirabuf.Node() + if (object.value != null) message.value = String(object.value) if (object.children) { - if (!Array.isArray(object.children)) - throw TypeError(".mirabuf.Node.children: array expected"); - message.children = []; + if (!Array.isArray(object.children)) throw TypeError(".mirabuf.Node.children: array expected") + message.children = [] for (let i = 0; i < object.children.length; ++i) { if (typeof object.children[i] !== "object") - throw TypeError(".mirabuf.Node.children: object expected"); - message.children[i] = $root.mirabuf.Node.fromObject(object.children[i]); + throw TypeError(".mirabuf.Node.children: object expected") + message.children[i] = $root.mirabuf.Node.fromObject(object.children[i]) } } if (object.userData != null) { - if (typeof object.userData !== "object") - throw TypeError(".mirabuf.Node.userData: object expected"); - message.userData = $root.mirabuf.UserData.fromObject(object.userData); + if (typeof object.userData !== "object") throw TypeError(".mirabuf.Node.userData: object expected") + message.userData = $root.mirabuf.UserData.fromObject(object.userData) } - return message; - }; + return message + } /** * Creates a plain object from a Node message. Also converts values to other types if specified. @@ -3286,26 +3189,23 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Node.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.children = []; + if (!options) options = {} + let object = {} + if (options.arrays || options.defaults) object.children = [] if (options.defaults) { - object.value = ""; - object.userData = null; + object.value = "" + object.userData = null } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; + if (message.value != null && message.hasOwnProperty("value")) object.value = message.value if (message.children && message.children.length) { - object.children = []; + object.children = [] for (let j = 0; j < message.children.length; ++j) - object.children[j] = $root.mirabuf.Node.toObject(message.children[j], options); + object.children[j] = $root.mirabuf.Node.toObject(message.children[j], options) } if (message.userData != null && message.hasOwnProperty("userData")) - object.userData = $root.mirabuf.UserData.toObject(message.userData, options); - return object; - }; + object.userData = $root.mirabuf.UserData.toObject(message.userData, options) + return object + } /** * Converts this Node to JSON. @@ -3315,8 +3215,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Node.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Node @@ -3328,16 +3228,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.Node"; - }; - - return Node; - })(); + return typeUrlPrefix + "/mirabuf.Node" + } - mirabuf.GraphContainer = (function() { + return Node + })() + mirabuf.GraphContainer = (function () { /** * Properties of a GraphContainer. * @memberof mirabuf @@ -3354,11 +3253,10 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.IGraphContainer=} [properties] Properties to set */ function GraphContainer(properties) { - this.nodes = []; + this.nodes = [] if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -3367,7 +3265,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.GraphContainer * @instance */ - GraphContainer.prototype.nodes = $util.emptyArray; + GraphContainer.prototype.nodes = $util.emptyArray /** * Creates a new GraphContainer instance using the specified properties. @@ -3378,8 +3276,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.GraphContainer} GraphContainer instance */ GraphContainer.create = function create(properties) { - return new GraphContainer(properties); - }; + return new GraphContainer(properties) + } /** * Encodes the specified GraphContainer message. Does not implicitly {@link mirabuf.GraphContainer.verify|verify} messages. @@ -3391,13 +3289,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ GraphContainer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.nodes != null && message.nodes.length) for (let i = 0; i < message.nodes.length; ++i) - $root.mirabuf.Node.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + $root.mirabuf.Node.encode( + message.nodes[i], + writer.uint32(/* id 1, wireType 2 =*/ 10).fork() + ).ldelim() + return writer + } /** * Encodes the specified GraphContainer message, length delimited. Does not implicitly {@link mirabuf.GraphContainer.verify|verify} messages. @@ -3409,8 +3309,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ GraphContainer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a GraphContainer message from the specified reader or buffer. @@ -3424,25 +3324,24 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GraphContainer.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.GraphContainer(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.GraphContainer() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.mirabuf.Node.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.nodes && message.nodes.length)) message.nodes = [] + message.nodes.push($root.mirabuf.Node.decode(reader, reader.uint32())) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a GraphContainer message from the specified reader or buffer, length delimited. @@ -3455,10 +3354,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GraphContainer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a GraphContainer message. @@ -3469,19 +3367,16 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ GraphContainer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.nodes != null && message.hasOwnProperty("nodes")) { - if (!Array.isArray(message.nodes)) - return "nodes: array expected"; + if (!Array.isArray(message.nodes)) return "nodes: array expected" for (let i = 0; i < message.nodes.length; ++i) { - let error = $root.mirabuf.Node.verify(message.nodes[i]); - if (error) - return "nodes." + error; + let error = $root.mirabuf.Node.verify(message.nodes[i]) + if (error) return "nodes." + error } } - return null; - }; + return null + } /** * Creates a GraphContainer message from a plain object. Also converts values to their respective internal types. @@ -3492,21 +3387,19 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.GraphContainer} GraphContainer */ GraphContainer.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.GraphContainer) - return object; - let message = new $root.mirabuf.GraphContainer(); + if (object instanceof $root.mirabuf.GraphContainer) return object + let message = new $root.mirabuf.GraphContainer() if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".mirabuf.GraphContainer.nodes: array expected"); - message.nodes = []; + if (!Array.isArray(object.nodes)) throw TypeError(".mirabuf.GraphContainer.nodes: array expected") + message.nodes = [] for (let i = 0; i < object.nodes.length; ++i) { if (typeof object.nodes[i] !== "object") - throw TypeError(".mirabuf.GraphContainer.nodes: object expected"); - message.nodes[i] = $root.mirabuf.Node.fromObject(object.nodes[i]); + throw TypeError(".mirabuf.GraphContainer.nodes: object expected") + message.nodes[i] = $root.mirabuf.Node.fromObject(object.nodes[i]) } } - return message; - }; + return message + } /** * Creates a plain object from a GraphContainer message. Also converts values to other types if specified. @@ -3518,18 +3411,16 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ GraphContainer.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.nodes = []; + if (!options) options = {} + let object = {} + if (options.arrays || options.defaults) object.nodes = [] if (message.nodes && message.nodes.length) { - object.nodes = []; + object.nodes = [] for (let j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.mirabuf.Node.toObject(message.nodes[j], options); + object.nodes[j] = $root.mirabuf.Node.toObject(message.nodes[j], options) } - return object; - }; + return object + } /** * Converts this GraphContainer to JSON. @@ -3539,8 +3430,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ GraphContainer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for GraphContainer @@ -3552,16 +3443,15 @@ export const mirabuf = $root.mirabuf = (() => { */ GraphContainer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.GraphContainer"; - }; - - return GraphContainer; - })(); + return typeUrlPrefix + "/mirabuf.GraphContainer" + } - mirabuf.UserData = (function() { + return GraphContainer + })() + mirabuf.UserData = (function () { /** * Properties of a UserData. * @memberof mirabuf @@ -3573,18 +3463,17 @@ export const mirabuf = $root.mirabuf = (() => { * Constructs a new UserData. * @memberof mirabuf * @classdesc UserData - * + * * Arbitrary data to append to a given message in map form * @implements IUserData * @constructor * @param {mirabuf.IUserData=} [properties] Properties to set */ function UserData(properties) { - this.data = {}; + this.data = {} if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -3593,7 +3482,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.UserData * @instance */ - UserData.prototype.data = $util.emptyObject; + UserData.prototype.data = $util.emptyObject /** * Creates a new UserData instance using the specified properties. @@ -3604,8 +3493,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.UserData} UserData instance */ UserData.create = function create(properties) { - return new UserData(properties); - }; + return new UserData(properties) + } /** * Encodes the specified UserData message. Does not implicitly {@link mirabuf.UserData.verify|verify} messages. @@ -3617,13 +3506,19 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ UserData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.data != null && Object.hasOwnProperty.call(message, "data")) for (let keys = Object.keys(message.data), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.data[keys[i]]).ldelim(); - return writer; - }; + writer + .uint32(/* id 1, wireType 2 =*/ 10) + .fork() + .uint32(/* id 1, wireType 2 =*/ 10) + .string(keys[i]) + .uint32(/* id 2, wireType 2 =*/ 18) + .string(message.data[keys[i]]) + .ldelim() + return writer + } /** * Encodes the specified UserData message, length delimited. Does not implicitly {@link mirabuf.UserData.verify|verify} messages. @@ -3635,8 +3530,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ UserData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a UserData message from the specified reader or buffer. @@ -3650,42 +3545,43 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UserData.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.UserData(), key, value; + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.UserData(), + key, + value while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - if (message.data === $util.emptyObject) - message.data = {}; - let end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; + case 1: { + if (message.data === $util.emptyObject) message.data = {} + let end2 = reader.uint32() + reader.pos + key = "" + value = "" while (reader.pos < end2) { - let tag2 = reader.uint32(); + let tag2 = reader.uint32() switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: + key = reader.string() + break + case 2: + value = reader.string() + break + default: + reader.skipType(tag2 & 7) + break } } - message.data[key] = value; - break; + message.data[key] = value + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a UserData message from the specified reader or buffer, length delimited. @@ -3698,10 +3594,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ UserData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a UserData message. @@ -3712,18 +3607,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ UserData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.data != null && message.hasOwnProperty("data")) { - if (!$util.isObject(message.data)) - return "data: object expected"; - let key = Object.keys(message.data); + if (!$util.isObject(message.data)) return "data: object expected" + let key = Object.keys(message.data) for (let i = 0; i < key.length; ++i) - if (!$util.isString(message.data[key[i]])) - return "data: string{k:string} expected"; + if (!$util.isString(message.data[key[i]])) return "data: string{k:string} expected" } - return null; - }; + return null + } /** * Creates a UserData message from a plain object. Also converts values to their respective internal types. @@ -3734,18 +3626,16 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.UserData} UserData */ UserData.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.UserData) - return object; - let message = new $root.mirabuf.UserData(); + if (object instanceof $root.mirabuf.UserData) return object + let message = new $root.mirabuf.UserData() if (object.data) { - if (typeof object.data !== "object") - throw TypeError(".mirabuf.UserData.data: object expected"); - message.data = {}; + if (typeof object.data !== "object") throw TypeError(".mirabuf.UserData.data: object expected") + message.data = {} for (let keys = Object.keys(object.data), i = 0; i < keys.length; ++i) - message.data[keys[i]] = String(object.data[keys[i]]); + message.data[keys[i]] = String(object.data[keys[i]]) } - return message; - }; + return message + } /** * Creates a plain object from a UserData message. Also converts values to other types if specified. @@ -3757,19 +3647,16 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ UserData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.objects || options.defaults) - object.data = {}; - let keys2; + if (!options) options = {} + let object = {} + if (options.objects || options.defaults) object.data = {} + let keys2 if (message.data && (keys2 = Object.keys(message.data)).length) { - object.data = {}; - for (let j = 0; j < keys2.length; ++j) - object.data[keys2[j]] = message.data[keys2[j]]; + object.data = {} + for (let j = 0; j < keys2.length; ++j) object.data[keys2[j]] = message.data[keys2[j]] } - return object; - }; + return object + } /** * Converts this UserData to JSON. @@ -3779,8 +3666,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ UserData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for UserData @@ -3792,16 +3679,15 @@ export const mirabuf = $root.mirabuf = (() => { */ UserData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.UserData"; - }; - - return UserData; - })(); + return typeUrlPrefix + "/mirabuf.UserData" + } - mirabuf.Vector3 = (function() { + return UserData + })() + mirabuf.Vector3 = (function () { /** * Properties of a Vector3. * @memberof mirabuf @@ -3822,8 +3708,7 @@ export const mirabuf = $root.mirabuf = (() => { function Vector3(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -3832,7 +3717,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Vector3 * @instance */ - Vector3.prototype.x = 0; + Vector3.prototype.x = 0 /** * Vector3 y. @@ -3840,7 +3725,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Vector3 * @instance */ - Vector3.prototype.y = 0; + Vector3.prototype.y = 0 /** * Vector3 z. @@ -3848,7 +3733,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Vector3 * @instance */ - Vector3.prototype.z = 0; + Vector3.prototype.z = 0 /** * Creates a new Vector3 instance using the specified properties. @@ -3859,8 +3744,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Vector3} Vector3 instance */ Vector3.create = function create(properties) { - return new Vector3(properties); - }; + return new Vector3(properties) + } /** * Encodes the specified Vector3 message. Does not implicitly {@link mirabuf.Vector3.verify|verify} messages. @@ -3872,16 +3757,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Vector3.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.x); + writer.uint32(/* id 1, wireType 5 =*/ 13).float(message.x) if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.y); + writer.uint32(/* id 2, wireType 5 =*/ 21).float(message.y) if (message.z != null && Object.hasOwnProperty.call(message, "z")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.z); - return writer; - }; + writer.uint32(/* id 3, wireType 5 =*/ 29).float(message.z) + return writer + } /** * Encodes the specified Vector3 message, length delimited. Does not implicitly {@link mirabuf.Vector3.verify|verify} messages. @@ -3893,8 +3777,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Vector3.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Vector3 message from the specified reader or buffer. @@ -3908,31 +3792,31 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Vector3.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.Vector3(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.Vector3() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.x = reader.float(); - break; + case 1: { + message.x = reader.float() + break } - case 2: { - message.y = reader.float(); - break; + case 2: { + message.y = reader.float() + break } - case 3: { - message.z = reader.float(); - break; + case 3: { + message.z = reader.float() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Vector3 message from the specified reader or buffer, length delimited. @@ -3945,10 +3829,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Vector3.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Vector3 message. @@ -3959,19 +3842,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Vector3.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.x != null && message.hasOwnProperty("x")) - if (typeof message.x !== "number") - return "x: number expected"; + if (typeof message.x !== "number") return "x: number expected" if (message.y != null && message.hasOwnProperty("y")) - if (typeof message.y !== "number") - return "y: number expected"; + if (typeof message.y !== "number") return "y: number expected" if (message.z != null && message.hasOwnProperty("z")) - if (typeof message.z !== "number") - return "z: number expected"; - return null; - }; + if (typeof message.z !== "number") return "z: number expected" + return null + } /** * Creates a Vector3 message from a plain object. Also converts values to their respective internal types. @@ -3982,17 +3861,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Vector3} Vector3 */ Vector3.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.Vector3) - return object; - let message = new $root.mirabuf.Vector3(); - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); - if (object.z != null) - message.z = Number(object.z); - return message; - }; + if (object instanceof $root.mirabuf.Vector3) return object + let message = new $root.mirabuf.Vector3() + if (object.x != null) message.x = Number(object.x) + if (object.y != null) message.y = Number(object.y) + if (object.z != null) message.z = Number(object.z) + return message + } /** * Creates a plain object from a Vector3 message. Also converts values to other types if specified. @@ -4004,22 +3879,21 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Vector3.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.x = 0; - object.y = 0; - object.z = 0; + object.x = 0 + object.y = 0 + object.z = 0 } if (message.x != null && message.hasOwnProperty("x")) - object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; + object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x if (message.y != null && message.hasOwnProperty("y")) - object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; + object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y if (message.z != null && message.hasOwnProperty("z")) - object.z = options.json && !isFinite(message.z) ? String(message.z) : message.z; - return object; - }; + object.z = options.json && !isFinite(message.z) ? String(message.z) : message.z + return object + } /** * Converts this Vector3 to JSON. @@ -4029,8 +3903,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Vector3.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Vector3 @@ -4042,16 +3916,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Vector3.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.Vector3"; - }; - - return Vector3; - })(); + return typeUrlPrefix + "/mirabuf.Vector3" + } - mirabuf.PhysicalProperties = (function() { + return Vector3 + })() + mirabuf.PhysicalProperties = (function () { /** * Properties of a PhysicalProperties. * @memberof mirabuf @@ -4074,8 +3947,7 @@ export const mirabuf = $root.mirabuf = (() => { function PhysicalProperties(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -4084,7 +3956,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PhysicalProperties * @instance */ - PhysicalProperties.prototype.density = 0; + PhysicalProperties.prototype.density = 0 /** * kg @@ -4092,7 +3964,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PhysicalProperties * @instance */ - PhysicalProperties.prototype.mass = 0; + PhysicalProperties.prototype.mass = 0 /** * cm^3 @@ -4100,7 +3972,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PhysicalProperties * @instance */ - PhysicalProperties.prototype.volume = 0; + PhysicalProperties.prototype.volume = 0 /** * cm^2 @@ -4108,7 +3980,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PhysicalProperties * @instance */ - PhysicalProperties.prototype.area = 0; + PhysicalProperties.prototype.area = 0 /** * non-negative? Vec3 @@ -4116,7 +3988,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.PhysicalProperties * @instance */ - PhysicalProperties.prototype.com = null; + PhysicalProperties.prototype.com = null /** * Creates a new PhysicalProperties instance using the specified properties. @@ -4127,8 +3999,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.PhysicalProperties} PhysicalProperties instance */ PhysicalProperties.create = function create(properties) { - return new PhysicalProperties(properties); - }; + return new PhysicalProperties(properties) + } /** * Encodes the specified PhysicalProperties message. Does not implicitly {@link mirabuf.PhysicalProperties.verify|verify} messages. @@ -4140,20 +4012,19 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ PhysicalProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.density != null && Object.hasOwnProperty.call(message, "density")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.density); + writer.uint32(/* id 1, wireType 1 =*/ 9).double(message.density) if (message.mass != null && Object.hasOwnProperty.call(message, "mass")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.mass); + writer.uint32(/* id 2, wireType 1 =*/ 17).double(message.mass) if (message.volume != null && Object.hasOwnProperty.call(message, "volume")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.volume); + writer.uint32(/* id 3, wireType 1 =*/ 25).double(message.volume) if (message.area != null && Object.hasOwnProperty.call(message, "area")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.area); + writer.uint32(/* id 4, wireType 1 =*/ 33).double(message.area) if (message.com != null && Object.hasOwnProperty.call(message, "com")) - $root.mirabuf.Vector3.encode(message.com, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; + $root.mirabuf.Vector3.encode(message.com, writer.uint32(/* id 5, wireType 2 =*/ 42).fork()).ldelim() + return writer + } /** * Encodes the specified PhysicalProperties message, length delimited. Does not implicitly {@link mirabuf.PhysicalProperties.verify|verify} messages. @@ -4165,8 +4036,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ PhysicalProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a PhysicalProperties message from the specified reader or buffer. @@ -4180,39 +4051,39 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PhysicalProperties.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.PhysicalProperties(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.PhysicalProperties() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.density = reader.double(); - break; + case 1: { + message.density = reader.double() + break } - case 2: { - message.mass = reader.double(); - break; + case 2: { + message.mass = reader.double() + break } - case 3: { - message.volume = reader.double(); - break; + case 3: { + message.volume = reader.double() + break } - case 4: { - message.area = reader.double(); - break; + case 4: { + message.area = reader.double() + break } - case 5: { - message.com = $root.mirabuf.Vector3.decode(reader, reader.uint32()); - break; + case 5: { + message.com = $root.mirabuf.Vector3.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a PhysicalProperties message from the specified reader or buffer, length delimited. @@ -4225,10 +4096,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PhysicalProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a PhysicalProperties message. @@ -4239,27 +4109,21 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ PhysicalProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.density != null && message.hasOwnProperty("density")) - if (typeof message.density !== "number") - return "density: number expected"; + if (typeof message.density !== "number") return "density: number expected" if (message.mass != null && message.hasOwnProperty("mass")) - if (typeof message.mass !== "number") - return "mass: number expected"; + if (typeof message.mass !== "number") return "mass: number expected" if (message.volume != null && message.hasOwnProperty("volume")) - if (typeof message.volume !== "number") - return "volume: number expected"; + if (typeof message.volume !== "number") return "volume: number expected" if (message.area != null && message.hasOwnProperty("area")) - if (typeof message.area !== "number") - return "area: number expected"; + if (typeof message.area !== "number") return "area: number expected" if (message.com != null && message.hasOwnProperty("com")) { - let error = $root.mirabuf.Vector3.verify(message.com); - if (error) - return "com." + error; + let error = $root.mirabuf.Vector3.verify(message.com) + if (error) return "com." + error } - return null; - }; + return null + } /** * Creates a PhysicalProperties message from a plain object. Also converts values to their respective internal types. @@ -4270,24 +4134,18 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.PhysicalProperties} PhysicalProperties */ PhysicalProperties.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.PhysicalProperties) - return object; - let message = new $root.mirabuf.PhysicalProperties(); - if (object.density != null) - message.density = Number(object.density); - if (object.mass != null) - message.mass = Number(object.mass); - if (object.volume != null) - message.volume = Number(object.volume); - if (object.area != null) - message.area = Number(object.area); + if (object instanceof $root.mirabuf.PhysicalProperties) return object + let message = new $root.mirabuf.PhysicalProperties() + if (object.density != null) message.density = Number(object.density) + if (object.mass != null) message.mass = Number(object.mass) + if (object.volume != null) message.volume = Number(object.volume) + if (object.area != null) message.area = Number(object.area) if (object.com != null) { - if (typeof object.com !== "object") - throw TypeError(".mirabuf.PhysicalProperties.com: object expected"); - message.com = $root.mirabuf.Vector3.fromObject(object.com); + if (typeof object.com !== "object") throw TypeError(".mirabuf.PhysicalProperties.com: object expected") + message.com = $root.mirabuf.Vector3.fromObject(object.com) } - return message; - }; + return message + } /** * Creates a plain object from a PhysicalProperties message. Also converts values to other types if specified. @@ -4299,28 +4157,27 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ PhysicalProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.density = 0; - object.mass = 0; - object.volume = 0; - object.area = 0; - object.com = null; + object.density = 0 + object.mass = 0 + object.volume = 0 + object.area = 0 + object.com = null } if (message.density != null && message.hasOwnProperty("density")) - object.density = options.json && !isFinite(message.density) ? String(message.density) : message.density; + object.density = options.json && !isFinite(message.density) ? String(message.density) : message.density if (message.mass != null && message.hasOwnProperty("mass")) - object.mass = options.json && !isFinite(message.mass) ? String(message.mass) : message.mass; + object.mass = options.json && !isFinite(message.mass) ? String(message.mass) : message.mass if (message.volume != null && message.hasOwnProperty("volume")) - object.volume = options.json && !isFinite(message.volume) ? String(message.volume) : message.volume; + object.volume = options.json && !isFinite(message.volume) ? String(message.volume) : message.volume if (message.area != null && message.hasOwnProperty("area")) - object.area = options.json && !isFinite(message.area) ? String(message.area) : message.area; + object.area = options.json && !isFinite(message.area) ? String(message.area) : message.area if (message.com != null && message.hasOwnProperty("com")) - object.com = $root.mirabuf.Vector3.toObject(message.com, options); - return object; - }; + object.com = $root.mirabuf.Vector3.toObject(message.com, options) + return object + } /** * Converts this PhysicalProperties to JSON. @@ -4330,8 +4187,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ PhysicalProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for PhysicalProperties @@ -4343,16 +4200,15 @@ export const mirabuf = $root.mirabuf = (() => { */ PhysicalProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.PhysicalProperties"; - }; - - return PhysicalProperties; - })(); + return typeUrlPrefix + "/mirabuf.PhysicalProperties" + } - mirabuf.Transform = (function() { + return PhysicalProperties + })() + mirabuf.Transform = (function () { /** * Properties of a Transform. * @memberof mirabuf @@ -4364,18 +4220,17 @@ export const mirabuf = $root.mirabuf = (() => { * Constructs a new Transform. * @memberof mirabuf * @classdesc Transform - * + * * Data needed to apply scale, position, and rotational changes * @implements ITransform * @constructor * @param {mirabuf.ITransform=} [properties] Properties to set */ function Transform(properties) { - this.spatialMatrix = []; + this.spatialMatrix = [] if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -4384,7 +4239,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Transform * @instance */ - Transform.prototype.spatialMatrix = $util.emptyArray; + Transform.prototype.spatialMatrix = $util.emptyArray /** * Creates a new Transform instance using the specified properties. @@ -4395,8 +4250,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Transform} Transform instance */ Transform.create = function create(properties) { - return new Transform(properties); - }; + return new Transform(properties) + } /** * Encodes the specified Transform message. Does not implicitly {@link mirabuf.Transform.verify|verify} messages. @@ -4408,16 +4263,14 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Transform.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.spatialMatrix != null && message.spatialMatrix.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (let i = 0; i < message.spatialMatrix.length; ++i) - writer.float(message.spatialMatrix[i]); - writer.ldelim(); + writer.uint32(/* id 1, wireType 2 =*/ 10).fork() + for (let i = 0; i < message.spatialMatrix.length; ++i) writer.float(message.spatialMatrix[i]) + writer.ldelim() } - return writer; - }; + return writer + } /** * Encodes the specified Transform message, length delimited. Does not implicitly {@link mirabuf.Transform.verify|verify} messages. @@ -4429,8 +4282,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Transform.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Transform message from the specified reader or buffer. @@ -4444,30 +4297,27 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Transform.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.Transform(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.Transform() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - if (!(message.spatialMatrix && message.spatialMatrix.length)) - message.spatialMatrix = []; + case 1: { + if (!(message.spatialMatrix && message.spatialMatrix.length)) message.spatialMatrix = [] if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.spatialMatrix.push(reader.float()); - } else - message.spatialMatrix.push(reader.float()); - break; + let end2 = reader.uint32() + reader.pos + while (reader.pos < end2) message.spatialMatrix.push(reader.float()) + } else message.spatialMatrix.push(reader.float()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Transform message from the specified reader or buffer, length delimited. @@ -4480,10 +4330,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Transform.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Transform message. @@ -4494,17 +4343,14 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Transform.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.spatialMatrix != null && message.hasOwnProperty("spatialMatrix")) { - if (!Array.isArray(message.spatialMatrix)) - return "spatialMatrix: array expected"; + if (!Array.isArray(message.spatialMatrix)) return "spatialMatrix: array expected" for (let i = 0; i < message.spatialMatrix.length; ++i) - if (typeof message.spatialMatrix[i] !== "number") - return "spatialMatrix: number[] expected"; + if (typeof message.spatialMatrix[i] !== "number") return "spatialMatrix: number[] expected" } - return null; - }; + return null + } /** * Creates a Transform message from a plain object. Also converts values to their respective internal types. @@ -4515,18 +4361,17 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Transform} Transform */ Transform.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.Transform) - return object; - let message = new $root.mirabuf.Transform(); + if (object instanceof $root.mirabuf.Transform) return object + let message = new $root.mirabuf.Transform() if (object.spatialMatrix) { if (!Array.isArray(object.spatialMatrix)) - throw TypeError(".mirabuf.Transform.spatialMatrix: array expected"); - message.spatialMatrix = []; + throw TypeError(".mirabuf.Transform.spatialMatrix: array expected") + message.spatialMatrix = [] for (let i = 0; i < object.spatialMatrix.length; ++i) - message.spatialMatrix[i] = Number(object.spatialMatrix[i]); + message.spatialMatrix[i] = Number(object.spatialMatrix[i]) } - return message; - }; + return message + } /** * Creates a plain object from a Transform message. Also converts values to other types if specified. @@ -4538,18 +4383,19 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Transform.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.spatialMatrix = []; + if (!options) options = {} + let object = {} + if (options.arrays || options.defaults) object.spatialMatrix = [] if (message.spatialMatrix && message.spatialMatrix.length) { - object.spatialMatrix = []; + object.spatialMatrix = [] for (let j = 0; j < message.spatialMatrix.length; ++j) - object.spatialMatrix[j] = options.json && !isFinite(message.spatialMatrix[j]) ? String(message.spatialMatrix[j]) : message.spatialMatrix[j]; + object.spatialMatrix[j] = + options.json && !isFinite(message.spatialMatrix[j]) + ? String(message.spatialMatrix[j]) + : message.spatialMatrix[j] } - return object; - }; + return object + } /** * Converts this Transform to JSON. @@ -4559,8 +4405,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Transform.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Transform @@ -4572,16 +4418,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Transform.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.Transform"; - }; - - return Transform; - })(); + return typeUrlPrefix + "/mirabuf.Transform" + } - mirabuf.Color = (function() { + return Transform + })() + mirabuf.Color = (function () { /** * Properties of a Color. * @memberof mirabuf @@ -4603,8 +4448,7 @@ export const mirabuf = $root.mirabuf = (() => { function Color(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -4613,7 +4457,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Color * @instance */ - Color.prototype.R = 0; + Color.prototype.R = 0 /** * Color G. @@ -4621,7 +4465,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Color * @instance */ - Color.prototype.G = 0; + Color.prototype.G = 0 /** * Color B. @@ -4629,7 +4473,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Color * @instance */ - Color.prototype.B = 0; + Color.prototype.B = 0 /** * Color A. @@ -4637,7 +4481,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Color * @instance */ - Color.prototype.A = 0; + Color.prototype.A = 0 /** * Creates a new Color instance using the specified properties. @@ -4648,8 +4492,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Color} Color instance */ Color.create = function create(properties) { - return new Color(properties); - }; + return new Color(properties) + } /** * Encodes the specified Color message. Does not implicitly {@link mirabuf.Color.verify|verify} messages. @@ -4661,18 +4505,17 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Color.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.R != null && Object.hasOwnProperty.call(message, "R")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.R); + writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.R) if (message.G != null && Object.hasOwnProperty.call(message, "G")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.G); + writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.G) if (message.B != null && Object.hasOwnProperty.call(message, "B")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.B); + writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.B) if (message.A != null && Object.hasOwnProperty.call(message, "A")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.A); - return writer; - }; + writer.uint32(/* id 4, wireType 0 =*/ 32).int32(message.A) + return writer + } /** * Encodes the specified Color message, length delimited. Does not implicitly {@link mirabuf.Color.verify|verify} messages. @@ -4684,8 +4527,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Color.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Color message from the specified reader or buffer. @@ -4699,35 +4542,35 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Color.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.Color(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.Color() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.R = reader.int32(); - break; + case 1: { + message.R = reader.int32() + break } - case 2: { - message.G = reader.int32(); - break; + case 2: { + message.G = reader.int32() + break } - case 3: { - message.B = reader.int32(); - break; + case 3: { + message.B = reader.int32() + break } - case 4: { - message.A = reader.int32(); - break; + case 4: { + message.A = reader.int32() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Color message from the specified reader or buffer, length delimited. @@ -4740,10 +4583,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Color.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Color message. @@ -4754,22 +4596,17 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Color.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.R != null && message.hasOwnProperty("R")) - if (!$util.isInteger(message.R)) - return "R: integer expected"; + if (!$util.isInteger(message.R)) return "R: integer expected" if (message.G != null && message.hasOwnProperty("G")) - if (!$util.isInteger(message.G)) - return "G: integer expected"; + if (!$util.isInteger(message.G)) return "G: integer expected" if (message.B != null && message.hasOwnProperty("B")) - if (!$util.isInteger(message.B)) - return "B: integer expected"; + if (!$util.isInteger(message.B)) return "B: integer expected" if (message.A != null && message.hasOwnProperty("A")) - if (!$util.isInteger(message.A)) - return "A: integer expected"; - return null; - }; + if (!$util.isInteger(message.A)) return "A: integer expected" + return null + } /** * Creates a Color message from a plain object. Also converts values to their respective internal types. @@ -4780,19 +4617,14 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Color} Color */ Color.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.Color) - return object; - let message = new $root.mirabuf.Color(); - if (object.R != null) - message.R = object.R | 0; - if (object.G != null) - message.G = object.G | 0; - if (object.B != null) - message.B = object.B | 0; - if (object.A != null) - message.A = object.A | 0; - return message; - }; + if (object instanceof $root.mirabuf.Color) return object + let message = new $root.mirabuf.Color() + if (object.R != null) message.R = object.R | 0 + if (object.G != null) message.G = object.G | 0 + if (object.B != null) message.B = object.B | 0 + if (object.A != null) message.A = object.A | 0 + return message + } /** * Creates a plain object from a Color message. Also converts values to other types if specified. @@ -4804,25 +4636,20 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Color.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.R = 0; - object.G = 0; - object.B = 0; - object.A = 0; - } - if (message.R != null && message.hasOwnProperty("R")) - object.R = message.R; - if (message.G != null && message.hasOwnProperty("G")) - object.G = message.G; - if (message.B != null && message.hasOwnProperty("B")) - object.B = message.B; - if (message.A != null && message.hasOwnProperty("A")) - object.A = message.A; - return object; - }; + object.R = 0 + object.G = 0 + object.B = 0 + object.A = 0 + } + if (message.R != null && message.hasOwnProperty("R")) object.R = message.R + if (message.G != null && message.hasOwnProperty("G")) object.G = message.G + if (message.B != null && message.hasOwnProperty("B")) object.B = message.B + if (message.A != null && message.hasOwnProperty("A")) object.A = message.A + return object + } /** * Converts this Color to JSON. @@ -4832,8 +4659,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Color.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Color @@ -4845,13 +4672,13 @@ export const mirabuf = $root.mirabuf = (() => { */ Color.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.Color"; - }; + return typeUrlPrefix + "/mirabuf.Color" + } - return Color; - })(); + return Color + })() /** * Axis enum. @@ -4861,16 +4688,16 @@ export const mirabuf = $root.mirabuf = (() => { * @property {number} Y=1 Y value * @property {number} Z=2 Z value */ - mirabuf.Axis = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "X"] = 0; - values[valuesById[1] = "Y"] = 1; - values[valuesById[2] = "Z"] = 2; - return values; - })(); - - mirabuf.Info = (function() { + mirabuf.Axis = (function () { + const valuesById = {}, + values = Object.create(valuesById) + values[(valuesById[0] = "X")] = 0 + values[(valuesById[1] = "Y")] = 1 + values[(valuesById[2] = "Z")] = 2 + return values + })() + mirabuf.Info = (function () { /** * Properties of an Info. * @memberof mirabuf @@ -4892,8 +4719,7 @@ export const mirabuf = $root.mirabuf = (() => { function Info(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -4902,7 +4728,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Info * @instance */ - Info.prototype.GUID = ""; + Info.prototype.GUID = "" /** * Info name. @@ -4910,7 +4736,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Info * @instance */ - Info.prototype.name = ""; + Info.prototype.name = "" /** * Info version. @@ -4918,7 +4744,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Info * @instance */ - Info.prototype.version = 0; + Info.prototype.version = 0 /** * Creates a new Info instance using the specified properties. @@ -4929,8 +4755,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Info} Info instance */ Info.create = function create(properties) { - return new Info(properties); - }; + return new Info(properties) + } /** * Encodes the specified Info message. Does not implicitly {@link mirabuf.Info.verify|verify} messages. @@ -4942,16 +4768,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Info.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.GUID != null && Object.hasOwnProperty.call(message, "GUID")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.GUID); + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.GUID) if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.name) if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.version); - return writer; - }; + writer.uint32(/* id 3, wireType 0 =*/ 24).uint32(message.version) + return writer + } /** * Encodes the specified Info message, length delimited. Does not implicitly {@link mirabuf.Info.verify|verify} messages. @@ -4963,8 +4788,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Info.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes an Info message from the specified reader or buffer. @@ -4978,31 +4803,31 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Info.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.Info(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.Info() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.GUID = reader.string(); - break; + case 1: { + message.GUID = reader.string() + break } - case 2: { - message.name = reader.string(); - break; + case 2: { + message.name = reader.string() + break } - case 3: { - message.version = reader.uint32(); - break; + case 3: { + message.version = reader.uint32() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes an Info message from the specified reader or buffer, length delimited. @@ -5015,10 +4840,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Info.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies an Info message. @@ -5029,19 +4853,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Info.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.GUID != null && message.hasOwnProperty("GUID")) - if (!$util.isString(message.GUID)) - return "GUID: string expected"; + if (!$util.isString(message.GUID)) return "GUID: string expected" if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (!$util.isString(message.name)) return "name: string expected" if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - return null; - }; + if (!$util.isInteger(message.version)) return "version: integer expected" + return null + } /** * Creates an Info message from a plain object. Also converts values to their respective internal types. @@ -5052,17 +4872,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Info} Info */ Info.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.Info) - return object; - let message = new $root.mirabuf.Info(); - if (object.GUID != null) - message.GUID = String(object.GUID); - if (object.name != null) - message.name = String(object.name); - if (object.version != null) - message.version = object.version >>> 0; - return message; - }; + if (object instanceof $root.mirabuf.Info) return object + let message = new $root.mirabuf.Info() + if (object.GUID != null) message.GUID = String(object.GUID) + if (object.name != null) message.name = String(object.name) + if (object.version != null) message.version = object.version >>> 0 + return message + } /** * Creates a plain object from an Info message. Also converts values to other types if specified. @@ -5074,22 +4890,18 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Info.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.GUID = ""; - object.name = ""; - object.version = 0; - } - if (message.GUID != null && message.hasOwnProperty("GUID")) - object.GUID = message.GUID; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; + object.GUID = "" + object.name = "" + object.version = 0 + } + if (message.GUID != null && message.hasOwnProperty("GUID")) object.GUID = message.GUID + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name + if (message.version != null && message.hasOwnProperty("version")) object.version = message.version + return object + } /** * Converts this Info to JSON. @@ -5099,8 +4911,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Info.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Info @@ -5112,16 +4924,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Info.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.Info"; - }; - - return Info; - })(); + return typeUrlPrefix + "/mirabuf.Info" + } - mirabuf.Thumbnail = (function() { + return Info + })() + mirabuf.Thumbnail = (function () { /** * Properties of a Thumbnail. * @memberof mirabuf @@ -5145,8 +4956,7 @@ export const mirabuf = $root.mirabuf = (() => { function Thumbnail(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -5155,7 +4965,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Thumbnail * @instance */ - Thumbnail.prototype.width = 0; + Thumbnail.prototype.width = 0 /** * Image Height @@ -5163,7 +4973,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Thumbnail * @instance */ - Thumbnail.prototype.height = 0; + Thumbnail.prototype.height = 0 /** * Image Extension - ex. (.png, .bitmap, .jpeg) @@ -5171,7 +4981,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Thumbnail * @instance */ - Thumbnail.prototype.extension = ""; + Thumbnail.prototype.extension = "" /** * Transparency - true from fusion when correctly configured @@ -5179,7 +4989,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Thumbnail * @instance */ - Thumbnail.prototype.transparent = false; + Thumbnail.prototype.transparent = false /** * Data as read from the file in bytes[] form @@ -5187,7 +4997,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.Thumbnail * @instance */ - Thumbnail.prototype.data = $util.newBuffer([]); + Thumbnail.prototype.data = $util.newBuffer([]) /** * Creates a new Thumbnail instance using the specified properties. @@ -5198,8 +5008,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Thumbnail} Thumbnail instance */ Thumbnail.create = function create(properties) { - return new Thumbnail(properties); - }; + return new Thumbnail(properties) + } /** * Encodes the specified Thumbnail message. Does not implicitly {@link mirabuf.Thumbnail.verify|verify} messages. @@ -5211,20 +5021,19 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Thumbnail.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.width != null && Object.hasOwnProperty.call(message, "width")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.width); + writer.uint32(/* id 1, wireType 0 =*/ 8).int32(message.width) if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.height); + writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.height) if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.extension); + writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.extension) if (message.transparent != null && Object.hasOwnProperty.call(message, "transparent")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.transparent); + writer.uint32(/* id 4, wireType 0 =*/ 32).bool(message.transparent) if (message.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.data); - return writer; - }; + writer.uint32(/* id 5, wireType 2 =*/ 42).bytes(message.data) + return writer + } /** * Encodes the specified Thumbnail message, length delimited. Does not implicitly {@link mirabuf.Thumbnail.verify|verify} messages. @@ -5236,8 +5045,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Thumbnail.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Thumbnail message from the specified reader or buffer. @@ -5251,39 +5060,39 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Thumbnail.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.Thumbnail(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.Thumbnail() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.width = reader.int32(); - break; + case 1: { + message.width = reader.int32() + break } - case 2: { - message.height = reader.int32(); - break; + case 2: { + message.height = reader.int32() + break } - case 3: { - message.extension = reader.string(); - break; + case 3: { + message.extension = reader.string() + break } - case 4: { - message.transparent = reader.bool(); - break; + case 4: { + message.transparent = reader.bool() + break } - case 5: { - message.data = reader.bytes(); - break; + case 5: { + message.data = reader.bytes() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Thumbnail message from the specified reader or buffer, length delimited. @@ -5296,10 +5105,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Thumbnail.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Thumbnail message. @@ -5310,25 +5118,20 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Thumbnail.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.width != null && message.hasOwnProperty("width")) - if (!$util.isInteger(message.width)) - return "width: integer expected"; + if (!$util.isInteger(message.width)) return "width: integer expected" if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; + if (!$util.isInteger(message.height)) return "height: integer expected" if (message.extension != null && message.hasOwnProperty("extension")) - if (!$util.isString(message.extension)) - return "extension: string expected"; + if (!$util.isString(message.extension)) return "extension: string expected" if (message.transparent != null && message.hasOwnProperty("transparent")) - if (typeof message.transparent !== "boolean") - return "transparent: boolean expected"; + if (typeof message.transparent !== "boolean") return "transparent: boolean expected" if (message.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; - return null; - }; + if (!((message.data && typeof message.data.length === "number") || $util.isString(message.data))) + return "data: buffer expected" + return null + } /** * Creates a Thumbnail message from a plain object. Also converts values to their respective internal types. @@ -5339,24 +5142,22 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.Thumbnail} Thumbnail */ Thumbnail.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.Thumbnail) - return object; - let message = new $root.mirabuf.Thumbnail(); - if (object.width != null) - message.width = object.width | 0; - if (object.height != null) - message.height = object.height | 0; - if (object.extension != null) - message.extension = String(object.extension); - if (object.transparent != null) - message.transparent = Boolean(object.transparent); + if (object instanceof $root.mirabuf.Thumbnail) return object + let message = new $root.mirabuf.Thumbnail() + if (object.width != null) message.width = object.width | 0 + if (object.height != null) message.height = object.height | 0 + if (object.extension != null) message.extension = String(object.extension) + if (object.transparent != null) message.transparent = Boolean(object.transparent) if (object.data != null) if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; - return message; - }; + $util.base64.decode( + object.data, + (message.data = $util.newBuffer($util.base64.length(object.data))), + 0 + ) + else if (object.data.length >= 0) message.data = object.data + return message + } /** * Creates a plain object from a Thumbnail message. Also converts values to other types if specified. @@ -5368,34 +5169,33 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Thumbnail.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.width = 0; - object.height = 0; - object.extension = ""; - object.transparent = false; - if (options.bytes === String) - object.data = ""; + object.width = 0 + object.height = 0 + object.extension = "" + object.transparent = false + if (options.bytes === String) object.data = "" else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); + object.data = [] + if (options.bytes !== Array) object.data = $util.newBuffer(object.data) } } - if (message.width != null && message.hasOwnProperty("width")) - object.width = message.width; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.extension != null && message.hasOwnProperty("extension")) - object.extension = message.extension; + if (message.width != null && message.hasOwnProperty("width")) object.width = message.width + if (message.height != null && message.hasOwnProperty("height")) object.height = message.height + if (message.extension != null && message.hasOwnProperty("extension")) object.extension = message.extension if (message.transparent != null && message.hasOwnProperty("transparent")) - object.transparent = message.transparent; + object.transparent = message.transparent if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - return object; - }; + object.data = + options.bytes === String + ? $util.base64.encode(message.data, 0, message.data.length) + : options.bytes === Array + ? Array.prototype.slice.call(message.data) + : message.data + return object + } /** * Converts this Thumbnail to JSON. @@ -5405,8 +5205,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Thumbnail.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Thumbnail @@ -5418,25 +5218,23 @@ export const mirabuf = $root.mirabuf = (() => { */ Thumbnail.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.Thumbnail"; - }; - - return Thumbnail; - })(); + return typeUrlPrefix + "/mirabuf.Thumbnail" + } - mirabuf.joint = (function() { + return Thumbnail + })() + mirabuf.joint = (function () { /** * Namespace joint. * @memberof mirabuf * @namespace */ - const joint = {}; - - joint.Joints = (function() { + const joint = {} + joint.Joints = (function () { /** * Properties of a Joints. * @memberof mirabuf.joint @@ -5458,14 +5256,13 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.joint.IJoints=} [properties] Properties to set */ function Joints(properties) { - this.jointDefinitions = {}; - this.jointInstances = {}; - this.rigidGroups = []; - this.motorDefinitions = {}; + this.jointDefinitions = {} + this.jointInstances = {} + this.rigidGroups = [] + this.motorDefinitions = {} if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -5474,7 +5271,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joints * @instance */ - Joints.prototype.info = null; + Joints.prototype.info = null /** * Unique Joint Implementations @@ -5482,7 +5279,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joints * @instance */ - Joints.prototype.jointDefinitions = $util.emptyObject; + Joints.prototype.jointDefinitions = $util.emptyObject /** * Instances of the Joint Implementations @@ -5490,7 +5287,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joints * @instance */ - Joints.prototype.jointInstances = $util.emptyObject; + Joints.prototype.jointInstances = $util.emptyObject /** * Rigidgroups ? @@ -5498,7 +5295,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joints * @instance */ - Joints.prototype.rigidGroups = $util.emptyArray; + Joints.prototype.rigidGroups = $util.emptyArray /** * Collection of all Motors exported @@ -5506,7 +5303,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joints * @instance */ - Joints.prototype.motorDefinitions = $util.emptyObject; + Joints.prototype.motorDefinitions = $util.emptyObject /** * Creates a new Joints instance using the specified properties. @@ -5517,8 +5314,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.Joints} Joints instance */ Joints.create = function create(properties) { - return new Joints(properties); - }; + return new Joints(properties) + } /** * Encodes the specified Joints message. Does not implicitly {@link mirabuf.joint.Joints.verify|verify} messages. @@ -5530,30 +5327,59 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Joints.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.jointDefinitions != null && Object.hasOwnProperty.call(message, "jointDefinitions")) for (let keys = Object.keys(message.jointDefinitions), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.mirabuf.joint.Joint.encode(message.jointDefinitions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + writer + .uint32(/* id 2, wireType 2 =*/ 18) + .fork() + .uint32(/* id 1, wireType 2 =*/ 10) + .string(keys[i]) + $root.mirabuf.joint.Joint.encode( + message.jointDefinitions[keys[i]], + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ) + .ldelim() + .ldelim() } if (message.jointInstances != null && Object.hasOwnProperty.call(message, "jointInstances")) for (let keys = Object.keys(message.jointInstances), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.mirabuf.joint.JointInstance.encode(message.jointInstances[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + writer + .uint32(/* id 3, wireType 2 =*/ 26) + .fork() + .uint32(/* id 1, wireType 2 =*/ 10) + .string(keys[i]) + $root.mirabuf.joint.JointInstance.encode( + message.jointInstances[keys[i]], + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ) + .ldelim() + .ldelim() } if (message.rigidGroups != null && message.rigidGroups.length) for (let i = 0; i < message.rigidGroups.length; ++i) - $root.mirabuf.joint.RigidGroup.encode(message.rigidGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.mirabuf.joint.RigidGroup.encode( + message.rigidGroups[i], + writer.uint32(/* id 4, wireType 2 =*/ 34).fork() + ).ldelim() if (message.motorDefinitions != null && Object.hasOwnProperty.call(message, "motorDefinitions")) for (let keys = Object.keys(message.motorDefinitions), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.mirabuf.motor.Motor.encode(message.motorDefinitions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + writer + .uint32(/* id 5, wireType 2 =*/ 42) + .fork() + .uint32(/* id 1, wireType 2 =*/ 10) + .string(keys[i]) + $root.mirabuf.motor.Motor.encode( + message.motorDefinitions[keys[i]], + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ) + .ldelim() + .ldelim() } - return writer; - }; + return writer + } /** * Encodes the specified Joints message, length delimited. Does not implicitly {@link mirabuf.joint.Joints.verify|verify} messages. @@ -5565,8 +5391,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Joints.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Joints message from the specified reader or buffer. @@ -5580,98 +5406,96 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Joints.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.Joints(), key, value; + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.Joints(), + key, + value while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - if (message.jointDefinitions === $util.emptyObject) - message.jointDefinitions = {}; - let end2 = reader.uint32() + reader.pos; - key = ""; - value = null; + case 2: { + if (message.jointDefinitions === $util.emptyObject) message.jointDefinitions = {} + let end2 = reader.uint32() + reader.pos + key = "" + value = null while (reader.pos < end2) { - let tag2 = reader.uint32(); + let tag2 = reader.uint32() switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.mirabuf.joint.Joint.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: + key = reader.string() + break + case 2: + value = $root.mirabuf.joint.Joint.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag2 & 7) + break } } - message.jointDefinitions[key] = value; - break; + message.jointDefinitions[key] = value + break } - case 3: { - if (message.jointInstances === $util.emptyObject) - message.jointInstances = {}; - let end2 = reader.uint32() + reader.pos; - key = ""; - value = null; + case 3: { + if (message.jointInstances === $util.emptyObject) message.jointInstances = {} + let end2 = reader.uint32() + reader.pos + key = "" + value = null while (reader.pos < end2) { - let tag2 = reader.uint32(); + let tag2 = reader.uint32() switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.mirabuf.joint.JointInstance.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: + key = reader.string() + break + case 2: + value = $root.mirabuf.joint.JointInstance.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag2 & 7) + break } } - message.jointInstances[key] = value; - break; + message.jointInstances[key] = value + break } - case 4: { - if (!(message.rigidGroups && message.rigidGroups.length)) - message.rigidGroups = []; - message.rigidGroups.push($root.mirabuf.joint.RigidGroup.decode(reader, reader.uint32())); - break; + case 4: { + if (!(message.rigidGroups && message.rigidGroups.length)) message.rigidGroups = [] + message.rigidGroups.push($root.mirabuf.joint.RigidGroup.decode(reader, reader.uint32())) + break } - case 5: { - if (message.motorDefinitions === $util.emptyObject) - message.motorDefinitions = {}; - let end2 = reader.uint32() + reader.pos; - key = ""; - value = null; + case 5: { + if (message.motorDefinitions === $util.emptyObject) message.motorDefinitions = {} + let end2 = reader.uint32() + reader.pos + key = "" + value = null while (reader.pos < end2) { - let tag2 = reader.uint32(); + let tag2 = reader.uint32() switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.mirabuf.motor.Motor.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: + key = reader.string() + break + case 2: + value = $root.mirabuf.motor.Motor.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag2 & 7) + break } } - message.motorDefinitions[key] = value; - break; + message.motorDefinitions[key] = value + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Joints message from the specified reader or buffer, length delimited. @@ -5684,10 +5508,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Joints.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Joints message. @@ -5698,54 +5521,44 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Joints.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.jointDefinitions != null && message.hasOwnProperty("jointDefinitions")) { - if (!$util.isObject(message.jointDefinitions)) - return "jointDefinitions: object expected"; - let key = Object.keys(message.jointDefinitions); + if (!$util.isObject(message.jointDefinitions)) return "jointDefinitions: object expected" + let key = Object.keys(message.jointDefinitions) for (let i = 0; i < key.length; ++i) { - let error = $root.mirabuf.joint.Joint.verify(message.jointDefinitions[key[i]]); - if (error) - return "jointDefinitions." + error; + let error = $root.mirabuf.joint.Joint.verify(message.jointDefinitions[key[i]]) + if (error) return "jointDefinitions." + error } } if (message.jointInstances != null && message.hasOwnProperty("jointInstances")) { - if (!$util.isObject(message.jointInstances)) - return "jointInstances: object expected"; - let key = Object.keys(message.jointInstances); + if (!$util.isObject(message.jointInstances)) return "jointInstances: object expected" + let key = Object.keys(message.jointInstances) for (let i = 0; i < key.length; ++i) { - let error = $root.mirabuf.joint.JointInstance.verify(message.jointInstances[key[i]]); - if (error) - return "jointInstances." + error; + let error = $root.mirabuf.joint.JointInstance.verify(message.jointInstances[key[i]]) + if (error) return "jointInstances." + error } } if (message.rigidGroups != null && message.hasOwnProperty("rigidGroups")) { - if (!Array.isArray(message.rigidGroups)) - return "rigidGroups: array expected"; + if (!Array.isArray(message.rigidGroups)) return "rigidGroups: array expected" for (let i = 0; i < message.rigidGroups.length; ++i) { - let error = $root.mirabuf.joint.RigidGroup.verify(message.rigidGroups[i]); - if (error) - return "rigidGroups." + error; + let error = $root.mirabuf.joint.RigidGroup.verify(message.rigidGroups[i]) + if (error) return "rigidGroups." + error } } if (message.motorDefinitions != null && message.hasOwnProperty("motorDefinitions")) { - if (!$util.isObject(message.motorDefinitions)) - return "motorDefinitions: object expected"; - let key = Object.keys(message.motorDefinitions); + if (!$util.isObject(message.motorDefinitions)) return "motorDefinitions: object expected" + let key = Object.keys(message.motorDefinitions) for (let i = 0; i < key.length; ++i) { - let error = $root.mirabuf.motor.Motor.verify(message.motorDefinitions[key[i]]); - if (error) - return "motorDefinitions." + error; + let error = $root.mirabuf.motor.Motor.verify(message.motorDefinitions[key[i]]) + if (error) return "motorDefinitions." + error } } - return null; - }; + return null + } /** * Creates a Joints message from a plain object. Also converts values to their respective internal types. @@ -5756,56 +5569,60 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.Joints} Joints */ Joints.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.Joints) - return object; - let message = new $root.mirabuf.joint.Joints(); + if (object instanceof $root.mirabuf.joint.Joints) return object + let message = new $root.mirabuf.joint.Joints() if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".mirabuf.joint.Joints.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + if (typeof object.info !== "object") throw TypeError(".mirabuf.joint.Joints.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } if (object.jointDefinitions) { if (typeof object.jointDefinitions !== "object") - throw TypeError(".mirabuf.joint.Joints.jointDefinitions: object expected"); - message.jointDefinitions = {}; + throw TypeError(".mirabuf.joint.Joints.jointDefinitions: object expected") + message.jointDefinitions = {} for (let keys = Object.keys(object.jointDefinitions), i = 0; i < keys.length; ++i) { if (typeof object.jointDefinitions[keys[i]] !== "object") - throw TypeError(".mirabuf.joint.Joints.jointDefinitions: object expected"); - message.jointDefinitions[keys[i]] = $root.mirabuf.joint.Joint.fromObject(object.jointDefinitions[keys[i]]); + throw TypeError(".mirabuf.joint.Joints.jointDefinitions: object expected") + message.jointDefinitions[keys[i]] = $root.mirabuf.joint.Joint.fromObject( + object.jointDefinitions[keys[i]] + ) } } if (object.jointInstances) { if (typeof object.jointInstances !== "object") - throw TypeError(".mirabuf.joint.Joints.jointInstances: object expected"); - message.jointInstances = {}; + throw TypeError(".mirabuf.joint.Joints.jointInstances: object expected") + message.jointInstances = {} for (let keys = Object.keys(object.jointInstances), i = 0; i < keys.length; ++i) { if (typeof object.jointInstances[keys[i]] !== "object") - throw TypeError(".mirabuf.joint.Joints.jointInstances: object expected"); - message.jointInstances[keys[i]] = $root.mirabuf.joint.JointInstance.fromObject(object.jointInstances[keys[i]]); + throw TypeError(".mirabuf.joint.Joints.jointInstances: object expected") + message.jointInstances[keys[i]] = $root.mirabuf.joint.JointInstance.fromObject( + object.jointInstances[keys[i]] + ) } } if (object.rigidGroups) { if (!Array.isArray(object.rigidGroups)) - throw TypeError(".mirabuf.joint.Joints.rigidGroups: array expected"); - message.rigidGroups = []; + throw TypeError(".mirabuf.joint.Joints.rigidGroups: array expected") + message.rigidGroups = [] for (let i = 0; i < object.rigidGroups.length; ++i) { if (typeof object.rigidGroups[i] !== "object") - throw TypeError(".mirabuf.joint.Joints.rigidGroups: object expected"); - message.rigidGroups[i] = $root.mirabuf.joint.RigidGroup.fromObject(object.rigidGroups[i]); + throw TypeError(".mirabuf.joint.Joints.rigidGroups: object expected") + message.rigidGroups[i] = $root.mirabuf.joint.RigidGroup.fromObject(object.rigidGroups[i]) } } if (object.motorDefinitions) { if (typeof object.motorDefinitions !== "object") - throw TypeError(".mirabuf.joint.Joints.motorDefinitions: object expected"); - message.motorDefinitions = {}; + throw TypeError(".mirabuf.joint.Joints.motorDefinitions: object expected") + message.motorDefinitions = {} for (let keys = Object.keys(object.motorDefinitions), i = 0; i < keys.length; ++i) { if (typeof object.motorDefinitions[keys[i]] !== "object") - throw TypeError(".mirabuf.joint.Joints.motorDefinitions: object expected"); - message.motorDefinitions[keys[i]] = $root.mirabuf.motor.Motor.fromObject(object.motorDefinitions[keys[i]]); + throw TypeError(".mirabuf.joint.Joints.motorDefinitions: object expected") + message.motorDefinitions[keys[i]] = $root.mirabuf.motor.Motor.fromObject( + object.motorDefinitions[keys[i]] + ) } } - return message; - }; + return message + } /** * Creates a plain object from a Joints message. Also converts values to other types if specified. @@ -5817,43 +5634,49 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Joints.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.rigidGroups = []; + if (!options) options = {} + let object = {} + if (options.arrays || options.defaults) object.rigidGroups = [] if (options.objects || options.defaults) { - object.jointDefinitions = {}; - object.jointInstances = {}; - object.motorDefinitions = {}; + object.jointDefinitions = {} + object.jointInstances = {} + object.motorDefinitions = {} } - if (options.defaults) - object.info = null; + if (options.defaults) object.info = null if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); - let keys2; + object.info = $root.mirabuf.Info.toObject(message.info, options) + let keys2 if (message.jointDefinitions && (keys2 = Object.keys(message.jointDefinitions)).length) { - object.jointDefinitions = {}; + object.jointDefinitions = {} for (let j = 0; j < keys2.length; ++j) - object.jointDefinitions[keys2[j]] = $root.mirabuf.joint.Joint.toObject(message.jointDefinitions[keys2[j]], options); + object.jointDefinitions[keys2[j]] = $root.mirabuf.joint.Joint.toObject( + message.jointDefinitions[keys2[j]], + options + ) } if (message.jointInstances && (keys2 = Object.keys(message.jointInstances)).length) { - object.jointInstances = {}; + object.jointInstances = {} for (let j = 0; j < keys2.length; ++j) - object.jointInstances[keys2[j]] = $root.mirabuf.joint.JointInstance.toObject(message.jointInstances[keys2[j]], options); + object.jointInstances[keys2[j]] = $root.mirabuf.joint.JointInstance.toObject( + message.jointInstances[keys2[j]], + options + ) } if (message.rigidGroups && message.rigidGroups.length) { - object.rigidGroups = []; + object.rigidGroups = [] for (let j = 0; j < message.rigidGroups.length; ++j) - object.rigidGroups[j] = $root.mirabuf.joint.RigidGroup.toObject(message.rigidGroups[j], options); + object.rigidGroups[j] = $root.mirabuf.joint.RigidGroup.toObject(message.rigidGroups[j], options) } if (message.motorDefinitions && (keys2 = Object.keys(message.motorDefinitions)).length) { - object.motorDefinitions = {}; + object.motorDefinitions = {} for (let j = 0; j < keys2.length; ++j) - object.motorDefinitions[keys2[j]] = $root.mirabuf.motor.Motor.toObject(message.motorDefinitions[keys2[j]], options); + object.motorDefinitions[keys2[j]] = $root.mirabuf.motor.Motor.toObject( + message.motorDefinitions[keys2[j]], + options + ) } - return object; - }; + return object + } /** * Converts this Joints to JSON. @@ -5863,8 +5686,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Joints.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Joints @@ -5876,13 +5699,13 @@ export const mirabuf = $root.mirabuf = (() => { */ Joints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.Joints"; - }; + return typeUrlPrefix + "/mirabuf.joint.Joints" + } - return Joints; - })(); + return Joints + })() /** * JointMotion enum. @@ -5897,21 +5720,21 @@ export const mirabuf = $root.mirabuf = (() => { * @property {number} BALL=6 BALL value * @property {number} CUSTOM=7 CUSTOM value */ - joint.JointMotion = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RIGID"] = 0; - values[valuesById[1] = "REVOLUTE"] = 1; - values[valuesById[2] = "SLIDER"] = 2; - values[valuesById[3] = "CYLINDRICAL"] = 3; - values[valuesById[4] = "PINSLOT"] = 4; - values[valuesById[5] = "PLANAR"] = 5; - values[valuesById[6] = "BALL"] = 6; - values[valuesById[7] = "CUSTOM"] = 7; - return values; - })(); - - joint.JointInstance = (function() { - + joint.JointMotion = (function () { + const valuesById = {}, + values = Object.create(valuesById) + values[(valuesById[0] = "RIGID")] = 0 + values[(valuesById[1] = "REVOLUTE")] = 1 + values[(valuesById[2] = "SLIDER")] = 2 + values[(valuesById[3] = "CYLINDRICAL")] = 3 + values[(valuesById[4] = "PINSLOT")] = 4 + values[(valuesById[5] = "PLANAR")] = 5 + values[(valuesById[6] = "BALL")] = 6 + values[(valuesById[7] = "CUSTOM")] = 7 + return values + })() + + joint.JointInstance = (function () { /** * Properties of a JointInstance. * @memberof mirabuf.joint @@ -5937,11 +5760,10 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.joint.IJointInstance=} [properties] Properties to set */ function JointInstance(properties) { - this.motionLink = []; + this.motionLink = [] if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -5950,7 +5772,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.JointInstance * @instance */ - JointInstance.prototype.info = null; + JointInstance.prototype.info = null /** * JointInstance isEndEffector. @@ -5958,7 +5780,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.JointInstance * @instance */ - JointInstance.prototype.isEndEffector = false; + JointInstance.prototype.isEndEffector = false /** * JointInstance parentPart. @@ -5966,7 +5788,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.JointInstance * @instance */ - JointInstance.prototype.parentPart = ""; + JointInstance.prototype.parentPart = "" /** * JointInstance childPart. @@ -5974,7 +5796,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.JointInstance * @instance */ - JointInstance.prototype.childPart = ""; + JointInstance.prototype.childPart = "" /** * JointInstance jointReference. @@ -5982,7 +5804,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.JointInstance * @instance */ - JointInstance.prototype.jointReference = ""; + JointInstance.prototype.jointReference = "" /** * JointInstance offset. @@ -5990,7 +5812,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.JointInstance * @instance */ - JointInstance.prototype.offset = null; + JointInstance.prototype.offset = null /** * JointInstance parts. @@ -5998,7 +5820,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.JointInstance * @instance */ - JointInstance.prototype.parts = null; + JointInstance.prototype.parts = null /** * JointInstance signalReference. @@ -6006,7 +5828,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.JointInstance * @instance */ - JointInstance.prototype.signalReference = ""; + JointInstance.prototype.signalReference = "" /** * JointInstance motionLink. @@ -6014,7 +5836,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.JointInstance * @instance */ - JointInstance.prototype.motionLink = $util.emptyArray; + JointInstance.prototype.motionLink = $util.emptyArray /** * Creates a new JointInstance instance using the specified properties. @@ -6025,8 +5847,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.JointInstance} JointInstance instance */ JointInstance.create = function create(properties) { - return new JointInstance(properties); - }; + return new JointInstance(properties) + } /** * Encodes the specified JointInstance message. Does not implicitly {@link mirabuf.joint.JointInstance.verify|verify} messages. @@ -6038,29 +5860,37 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ JointInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.isEndEffector != null && Object.hasOwnProperty.call(message, "isEndEffector")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isEndEffector); + writer.uint32(/* id 2, wireType 0 =*/ 16).bool(message.isEndEffector) if (message.parentPart != null && Object.hasOwnProperty.call(message, "parentPart")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.parentPart); + writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.parentPart) if (message.childPart != null && Object.hasOwnProperty.call(message, "childPart")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.childPart); + writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.childPart) if (message.jointReference != null && Object.hasOwnProperty.call(message, "jointReference")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.jointReference); + writer.uint32(/* id 5, wireType 2 =*/ 42).string(message.jointReference) if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - $root.mirabuf.Vector3.encode(message.offset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.mirabuf.Vector3.encode( + message.offset, + writer.uint32(/* id 6, wireType 2 =*/ 50).fork() + ).ldelim() if (message.parts != null && Object.hasOwnProperty.call(message, "parts")) - $root.mirabuf.GraphContainer.encode(message.parts, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.mirabuf.GraphContainer.encode( + message.parts, + writer.uint32(/* id 7, wireType 2 =*/ 58).fork() + ).ldelim() if (message.signalReference != null && Object.hasOwnProperty.call(message, "signalReference")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.signalReference); + writer.uint32(/* id 8, wireType 2 =*/ 66).string(message.signalReference) if (message.motionLink != null && message.motionLink.length) for (let i = 0; i < message.motionLink.length; ++i) - $root.mirabuf.joint.MotionLink.encode(message.motionLink[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; + $root.mirabuf.joint.MotionLink.encode( + message.motionLink[i], + writer.uint32(/* id 9, wireType 2 =*/ 74).fork() + ).ldelim() + return writer + } /** * Encodes the specified JointInstance message, length delimited. Does not implicitly {@link mirabuf.joint.JointInstance.verify|verify} messages. @@ -6072,8 +5902,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ JointInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a JointInstance message from the specified reader or buffer. @@ -6087,57 +5917,56 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ JointInstance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.JointInstance(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.JointInstance() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.isEndEffector = reader.bool(); - break; + case 2: { + message.isEndEffector = reader.bool() + break } - case 3: { - message.parentPart = reader.string(); - break; + case 3: { + message.parentPart = reader.string() + break } - case 4: { - message.childPart = reader.string(); - break; + case 4: { + message.childPart = reader.string() + break } - case 5: { - message.jointReference = reader.string(); - break; + case 5: { + message.jointReference = reader.string() + break } - case 6: { - message.offset = $root.mirabuf.Vector3.decode(reader, reader.uint32()); - break; + case 6: { + message.offset = $root.mirabuf.Vector3.decode(reader, reader.uint32()) + break } - case 7: { - message.parts = $root.mirabuf.GraphContainer.decode(reader, reader.uint32()); - break; + case 7: { + message.parts = $root.mirabuf.GraphContainer.decode(reader, reader.uint32()) + break } - case 8: { - message.signalReference = reader.string(); - break; + case 8: { + message.signalReference = reader.string() + break } - case 9: { - if (!(message.motionLink && message.motionLink.length)) - message.motionLink = []; - message.motionLink.push($root.mirabuf.joint.MotionLink.decode(reader, reader.uint32())); - break; + case 9: { + if (!(message.motionLink && message.motionLink.length)) message.motionLink = [] + message.motionLink.push($root.mirabuf.joint.MotionLink.decode(reader, reader.uint32())) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a JointInstance message from the specified reader or buffer, length delimited. @@ -6150,10 +5979,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ JointInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a JointInstance message. @@ -6164,49 +5992,38 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ JointInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.isEndEffector != null && message.hasOwnProperty("isEndEffector")) - if (typeof message.isEndEffector !== "boolean") - return "isEndEffector: boolean expected"; + if (typeof message.isEndEffector !== "boolean") return "isEndEffector: boolean expected" if (message.parentPart != null && message.hasOwnProperty("parentPart")) - if (!$util.isString(message.parentPart)) - return "parentPart: string expected"; + if (!$util.isString(message.parentPart)) return "parentPart: string expected" if (message.childPart != null && message.hasOwnProperty("childPart")) - if (!$util.isString(message.childPart)) - return "childPart: string expected"; + if (!$util.isString(message.childPart)) return "childPart: string expected" if (message.jointReference != null && message.hasOwnProperty("jointReference")) - if (!$util.isString(message.jointReference)) - return "jointReference: string expected"; + if (!$util.isString(message.jointReference)) return "jointReference: string expected" if (message.offset != null && message.hasOwnProperty("offset")) { - let error = $root.mirabuf.Vector3.verify(message.offset); - if (error) - return "offset." + error; + let error = $root.mirabuf.Vector3.verify(message.offset) + if (error) return "offset." + error } if (message.parts != null && message.hasOwnProperty("parts")) { - let error = $root.mirabuf.GraphContainer.verify(message.parts); - if (error) - return "parts." + error; + let error = $root.mirabuf.GraphContainer.verify(message.parts) + if (error) return "parts." + error } if (message.signalReference != null && message.hasOwnProperty("signalReference")) - if (!$util.isString(message.signalReference)) - return "signalReference: string expected"; + if (!$util.isString(message.signalReference)) return "signalReference: string expected" if (message.motionLink != null && message.hasOwnProperty("motionLink")) { - if (!Array.isArray(message.motionLink)) - return "motionLink: array expected"; + if (!Array.isArray(message.motionLink)) return "motionLink: array expected" for (let i = 0; i < message.motionLink.length; ++i) { - let error = $root.mirabuf.joint.MotionLink.verify(message.motionLink[i]); - if (error) - return "motionLink." + error; + let error = $root.mirabuf.joint.MotionLink.verify(message.motionLink[i]) + if (error) return "motionLink." + error } } - return null; - }; + return null + } /** * Creates a JointInstance message from a plain object. Also converts values to their respective internal types. @@ -6217,46 +6034,40 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.JointInstance} JointInstance */ JointInstance.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.JointInstance) - return object; - let message = new $root.mirabuf.joint.JointInstance(); + if (object instanceof $root.mirabuf.joint.JointInstance) return object + let message = new $root.mirabuf.joint.JointInstance() if (object.info != null) { if (typeof object.info !== "object") - throw TypeError(".mirabuf.joint.JointInstance.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); - } - if (object.isEndEffector != null) - message.isEndEffector = Boolean(object.isEndEffector); - if (object.parentPart != null) - message.parentPart = String(object.parentPart); - if (object.childPart != null) - message.childPart = String(object.childPart); - if (object.jointReference != null) - message.jointReference = String(object.jointReference); + throw TypeError(".mirabuf.joint.JointInstance.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) + } + if (object.isEndEffector != null) message.isEndEffector = Boolean(object.isEndEffector) + if (object.parentPart != null) message.parentPart = String(object.parentPart) + if (object.childPart != null) message.childPart = String(object.childPart) + if (object.jointReference != null) message.jointReference = String(object.jointReference) if (object.offset != null) { if (typeof object.offset !== "object") - throw TypeError(".mirabuf.joint.JointInstance.offset: object expected"); - message.offset = $root.mirabuf.Vector3.fromObject(object.offset); + throw TypeError(".mirabuf.joint.JointInstance.offset: object expected") + message.offset = $root.mirabuf.Vector3.fromObject(object.offset) } if (object.parts != null) { if (typeof object.parts !== "object") - throw TypeError(".mirabuf.joint.JointInstance.parts: object expected"); - message.parts = $root.mirabuf.GraphContainer.fromObject(object.parts); + throw TypeError(".mirabuf.joint.JointInstance.parts: object expected") + message.parts = $root.mirabuf.GraphContainer.fromObject(object.parts) } - if (object.signalReference != null) - message.signalReference = String(object.signalReference); + if (object.signalReference != null) message.signalReference = String(object.signalReference) if (object.motionLink) { if (!Array.isArray(object.motionLink)) - throw TypeError(".mirabuf.joint.JointInstance.motionLink: array expected"); - message.motionLink = []; + throw TypeError(".mirabuf.joint.JointInstance.motionLink: array expected") + message.motionLink = [] for (let i = 0; i < object.motionLink.length; ++i) { if (typeof object.motionLink[i] !== "object") - throw TypeError(".mirabuf.joint.JointInstance.motionLink: object expected"); - message.motionLink[i] = $root.mirabuf.joint.MotionLink.fromObject(object.motionLink[i]); + throw TypeError(".mirabuf.joint.JointInstance.motionLink: object expected") + message.motionLink[i] = $root.mirabuf.joint.MotionLink.fromObject(object.motionLink[i]) } } - return message; - }; + return message + } /** * Creates a plain object from a JointInstance message. Also converts values to other types if specified. @@ -6268,44 +6079,42 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ JointInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.motionLink = []; + if (!options) options = {} + let object = {} + if (options.arrays || options.defaults) object.motionLink = [] if (options.defaults) { - object.info = null; - object.isEndEffector = false; - object.parentPart = ""; - object.childPart = ""; - object.jointReference = ""; - object.offset = null; - object.parts = null; - object.signalReference = ""; + object.info = null + object.isEndEffector = false + object.parentPart = "" + object.childPart = "" + object.jointReference = "" + object.offset = null + object.parts = null + object.signalReference = "" } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); + object.info = $root.mirabuf.Info.toObject(message.info, options) if (message.isEndEffector != null && message.hasOwnProperty("isEndEffector")) - object.isEndEffector = message.isEndEffector; + object.isEndEffector = message.isEndEffector if (message.parentPart != null && message.hasOwnProperty("parentPart")) - object.parentPart = message.parentPart; + object.parentPart = message.parentPart if (message.childPart != null && message.hasOwnProperty("childPart")) - object.childPart = message.childPart; + object.childPart = message.childPart if (message.jointReference != null && message.hasOwnProperty("jointReference")) - object.jointReference = message.jointReference; + object.jointReference = message.jointReference if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = $root.mirabuf.Vector3.toObject(message.offset, options); + object.offset = $root.mirabuf.Vector3.toObject(message.offset, options) if (message.parts != null && message.hasOwnProperty("parts")) - object.parts = $root.mirabuf.GraphContainer.toObject(message.parts, options); + object.parts = $root.mirabuf.GraphContainer.toObject(message.parts, options) if (message.signalReference != null && message.hasOwnProperty("signalReference")) - object.signalReference = message.signalReference; + object.signalReference = message.signalReference if (message.motionLink && message.motionLink.length) { - object.motionLink = []; + object.motionLink = [] for (let j = 0; j < message.motionLink.length; ++j) - object.motionLink[j] = $root.mirabuf.joint.MotionLink.toObject(message.motionLink[j], options); + object.motionLink[j] = $root.mirabuf.joint.MotionLink.toObject(message.motionLink[j], options) } - return object; - }; + return object + } /** * Converts this JointInstance to JSON. @@ -6315,8 +6124,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ JointInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for JointInstance @@ -6328,16 +6137,15 @@ export const mirabuf = $root.mirabuf = (() => { */ JointInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.JointInstance"; - }; - - return JointInstance; - })(); + return typeUrlPrefix + "/mirabuf.joint.JointInstance" + } - joint.MotionLink = (function() { + return JointInstance + })() + joint.MotionLink = (function () { /** * Properties of a MotionLink. * @memberof mirabuf.joint @@ -6360,8 +6168,7 @@ export const mirabuf = $root.mirabuf = (() => { function MotionLink(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -6370,7 +6177,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.MotionLink * @instance */ - MotionLink.prototype.jointInstance = ""; + MotionLink.prototype.jointInstance = "" /** * MotionLink ratio. @@ -6378,7 +6185,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.MotionLink * @instance */ - MotionLink.prototype.ratio = 0; + MotionLink.prototype.ratio = 0 /** * MotionLink reversed. @@ -6386,7 +6193,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.MotionLink * @instance */ - MotionLink.prototype.reversed = false; + MotionLink.prototype.reversed = false /** * Creates a new MotionLink instance using the specified properties. @@ -6397,8 +6204,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.MotionLink} MotionLink instance */ MotionLink.create = function create(properties) { - return new MotionLink(properties); - }; + return new MotionLink(properties) + } /** * Encodes the specified MotionLink message. Does not implicitly {@link mirabuf.joint.MotionLink.verify|verify} messages. @@ -6410,16 +6217,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ MotionLink.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.jointInstance != null && Object.hasOwnProperty.call(message, "jointInstance")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.jointInstance); + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.jointInstance) if (message.ratio != null && Object.hasOwnProperty.call(message, "ratio")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.ratio); + writer.uint32(/* id 2, wireType 5 =*/ 21).float(message.ratio) if (message.reversed != null && Object.hasOwnProperty.call(message, "reversed")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.reversed); - return writer; - }; + writer.uint32(/* id 3, wireType 0 =*/ 24).bool(message.reversed) + return writer + } /** * Encodes the specified MotionLink message, length delimited. Does not implicitly {@link mirabuf.joint.MotionLink.verify|verify} messages. @@ -6431,8 +6237,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ MotionLink.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a MotionLink message from the specified reader or buffer. @@ -6446,31 +6252,31 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MotionLink.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.MotionLink(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.MotionLink() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.jointInstance = reader.string(); - break; + case 1: { + message.jointInstance = reader.string() + break } - case 2: { - message.ratio = reader.float(); - break; + case 2: { + message.ratio = reader.float() + break } - case 3: { - message.reversed = reader.bool(); - break; + case 3: { + message.reversed = reader.bool() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a MotionLink message from the specified reader or buffer, length delimited. @@ -6483,10 +6289,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MotionLink.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a MotionLink message. @@ -6497,19 +6302,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ MotionLink.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.jointInstance != null && message.hasOwnProperty("jointInstance")) - if (!$util.isString(message.jointInstance)) - return "jointInstance: string expected"; + if (!$util.isString(message.jointInstance)) return "jointInstance: string expected" if (message.ratio != null && message.hasOwnProperty("ratio")) - if (typeof message.ratio !== "number") - return "ratio: number expected"; + if (typeof message.ratio !== "number") return "ratio: number expected" if (message.reversed != null && message.hasOwnProperty("reversed")) - if (typeof message.reversed !== "boolean") - return "reversed: boolean expected"; - return null; - }; + if (typeof message.reversed !== "boolean") return "reversed: boolean expected" + return null + } /** * Creates a MotionLink message from a plain object. Also converts values to their respective internal types. @@ -6520,17 +6321,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.MotionLink} MotionLink */ MotionLink.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.MotionLink) - return object; - let message = new $root.mirabuf.joint.MotionLink(); - if (object.jointInstance != null) - message.jointInstance = String(object.jointInstance); - if (object.ratio != null) - message.ratio = Number(object.ratio); - if (object.reversed != null) - message.reversed = Boolean(object.reversed); - return message; - }; + if (object instanceof $root.mirabuf.joint.MotionLink) return object + let message = new $root.mirabuf.joint.MotionLink() + if (object.jointInstance != null) message.jointInstance = String(object.jointInstance) + if (object.ratio != null) message.ratio = Number(object.ratio) + if (object.reversed != null) message.reversed = Boolean(object.reversed) + return message + } /** * Creates a plain object from a MotionLink message. Also converts values to other types if specified. @@ -6542,22 +6339,20 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ MotionLink.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.jointInstance = ""; - object.ratio = 0; - object.reversed = false; + object.jointInstance = "" + object.ratio = 0 + object.reversed = false } if (message.jointInstance != null && message.hasOwnProperty("jointInstance")) - object.jointInstance = message.jointInstance; + object.jointInstance = message.jointInstance if (message.ratio != null && message.hasOwnProperty("ratio")) - object.ratio = options.json && !isFinite(message.ratio) ? String(message.ratio) : message.ratio; - if (message.reversed != null && message.hasOwnProperty("reversed")) - object.reversed = message.reversed; - return object; - }; + object.ratio = options.json && !isFinite(message.ratio) ? String(message.ratio) : message.ratio + if (message.reversed != null && message.hasOwnProperty("reversed")) object.reversed = message.reversed + return object + } /** * Converts this MotionLink to JSON. @@ -6567,8 +6362,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ MotionLink.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for MotionLink @@ -6580,16 +6375,15 @@ export const mirabuf = $root.mirabuf = (() => { */ MotionLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.MotionLink"; - }; - - return MotionLink; - })(); + return typeUrlPrefix + "/mirabuf.joint.MotionLink" + } - joint.Joint = (function() { + return MotionLink + })() + joint.Joint = (function () { /** * Properties of a Joint. * @memberof mirabuf.joint @@ -6618,8 +6412,7 @@ export const mirabuf = $root.mirabuf = (() => { function Joint(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -6628,7 +6421,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joint * @instance */ - Joint.prototype.info = null; + Joint.prototype.info = null /** * Joint origin. @@ -6636,7 +6429,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joint * @instance */ - Joint.prototype.origin = null; + Joint.prototype.origin = null /** * Joint jointMotionType. @@ -6644,7 +6437,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joint * @instance */ - Joint.prototype.jointMotionType = 0; + Joint.prototype.jointMotionType = 0 /** * Joint breakMagnitude. @@ -6652,7 +6445,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joint * @instance */ - Joint.prototype.breakMagnitude = 0; + Joint.prototype.breakMagnitude = 0 /** * ONEOF rotational joint @@ -6660,7 +6453,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joint * @instance */ - Joint.prototype.rotational = null; + Joint.prototype.rotational = null /** * ONEOF prismatic joint @@ -6668,7 +6461,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joint * @instance */ - Joint.prototype.prismatic = null; + Joint.prototype.prismatic = null /** * ONEOF custom joint @@ -6676,7 +6469,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joint * @instance */ - Joint.prototype.custom = null; + Joint.prototype.custom = null /** * Additional information someone can query or store relative to your joint. @@ -6684,7 +6477,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joint * @instance */ - Joint.prototype.userData = null; + Joint.prototype.userData = null /** * Motor definition reference to lookup in joints collection @@ -6692,10 +6485,10 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Joint * @instance */ - Joint.prototype.motorReference = ""; + Joint.prototype.motorReference = "" // OneOf field names bound to virtual getters and setters - let $oneOfFields; + let $oneOfFields /** * Joint JointMotion. @@ -6704,9 +6497,9 @@ export const mirabuf = $root.mirabuf = (() => { * @instance */ Object.defineProperty(Joint.prototype, "JointMotion", { - get: $util.oneOfGetter($oneOfFields = ["rotational", "prismatic", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + get: $util.oneOfGetter(($oneOfFields = ["rotational", "prismatic", "custom"])), + set: $util.oneOfSetter($oneOfFields), + }) /** * Creates a new Joint instance using the specified properties. @@ -6717,8 +6510,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.Joint} Joint instance */ Joint.create = function create(properties) { - return new Joint(properties); - }; + return new Joint(properties) + } /** * Encodes the specified Joint message. Does not implicitly {@link mirabuf.joint.Joint.verify|verify} messages. @@ -6730,28 +6523,42 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Joint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.origin != null && Object.hasOwnProperty.call(message, "origin")) - $root.mirabuf.Vector3.encode(message.origin, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.mirabuf.Vector3.encode( + message.origin, + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ).ldelim() if (message.jointMotionType != null && Object.hasOwnProperty.call(message, "jointMotionType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.jointMotionType); + writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.jointMotionType) if (message.breakMagnitude != null && Object.hasOwnProperty.call(message, "breakMagnitude")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.breakMagnitude); + writer.uint32(/* id 4, wireType 5 =*/ 37).float(message.breakMagnitude) if (message.rotational != null && Object.hasOwnProperty.call(message, "rotational")) - $root.mirabuf.joint.RotationalJoint.encode(message.rotational, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.mirabuf.joint.RotationalJoint.encode( + message.rotational, + writer.uint32(/* id 5, wireType 2 =*/ 42).fork() + ).ldelim() if (message.prismatic != null && Object.hasOwnProperty.call(message, "prismatic")) - $root.mirabuf.joint.PrismaticJoint.encode(message.prismatic, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.mirabuf.joint.PrismaticJoint.encode( + message.prismatic, + writer.uint32(/* id 6, wireType 2 =*/ 50).fork() + ).ldelim() if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.mirabuf.joint.CustomJoint.encode(message.custom, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.mirabuf.joint.CustomJoint.encode( + message.custom, + writer.uint32(/* id 7, wireType 2 =*/ 58).fork() + ).ldelim() if (message.userData != null && Object.hasOwnProperty.call(message, "userData")) - $root.mirabuf.UserData.encode(message.userData, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.mirabuf.UserData.encode( + message.userData, + writer.uint32(/* id 8, wireType 2 =*/ 66).fork() + ).ldelim() if (message.motorReference != null && Object.hasOwnProperty.call(message, "motorReference")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.motorReference); - return writer; - }; + writer.uint32(/* id 9, wireType 2 =*/ 74).string(message.motorReference) + return writer + } /** * Encodes the specified Joint message, length delimited. Does not implicitly {@link mirabuf.joint.Joint.verify|verify} messages. @@ -6763,8 +6570,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Joint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Joint message from the specified reader or buffer. @@ -6778,55 +6585,55 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Joint.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.Joint(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.Joint() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.origin = $root.mirabuf.Vector3.decode(reader, reader.uint32()); - break; + case 2: { + message.origin = $root.mirabuf.Vector3.decode(reader, reader.uint32()) + break } - case 3: { - message.jointMotionType = reader.int32(); - break; + case 3: { + message.jointMotionType = reader.int32() + break } - case 4: { - message.breakMagnitude = reader.float(); - break; + case 4: { + message.breakMagnitude = reader.float() + break } - case 5: { - message.rotational = $root.mirabuf.joint.RotationalJoint.decode(reader, reader.uint32()); - break; + case 5: { + message.rotational = $root.mirabuf.joint.RotationalJoint.decode(reader, reader.uint32()) + break } - case 6: { - message.prismatic = $root.mirabuf.joint.PrismaticJoint.decode(reader, reader.uint32()); - break; + case 6: { + message.prismatic = $root.mirabuf.joint.PrismaticJoint.decode(reader, reader.uint32()) + break } - case 7: { - message.custom = $root.mirabuf.joint.CustomJoint.decode(reader, reader.uint32()); - break; + case 7: { + message.custom = $root.mirabuf.joint.CustomJoint.decode(reader, reader.uint32()) + break } - case 8: { - message.userData = $root.mirabuf.UserData.decode(reader, reader.uint32()); - break; + case 8: { + message.userData = $root.mirabuf.UserData.decode(reader, reader.uint32()) + break } - case 9: { - message.motorReference = reader.string(); - break; + case 9: { + message.motorReference = reader.string() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Joint message from the specified reader or buffer, length delimited. @@ -6839,10 +6646,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Joint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Joint message. @@ -6853,74 +6659,63 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Joint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - let properties = {}; + if (typeof message !== "object" || message === null) return "object expected" + let properties = {} if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.origin != null && message.hasOwnProperty("origin")) { - let error = $root.mirabuf.Vector3.verify(message.origin); - if (error) - return "origin." + error; + let error = $root.mirabuf.Vector3.verify(message.origin) + if (error) return "origin." + error } if (message.jointMotionType != null && message.hasOwnProperty("jointMotionType")) switch (message.jointMotionType) { - default: - return "jointMotionType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; + default: + return "jointMotionType: enum value expected" + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break } if (message.breakMagnitude != null && message.hasOwnProperty("breakMagnitude")) - if (typeof message.breakMagnitude !== "number") - return "breakMagnitude: number expected"; + if (typeof message.breakMagnitude !== "number") return "breakMagnitude: number expected" if (message.rotational != null && message.hasOwnProperty("rotational")) { - properties.JointMotion = 1; + properties.JointMotion = 1 { - let error = $root.mirabuf.joint.RotationalJoint.verify(message.rotational); - if (error) - return "rotational." + error; + let error = $root.mirabuf.joint.RotationalJoint.verify(message.rotational) + if (error) return "rotational." + error } } if (message.prismatic != null && message.hasOwnProperty("prismatic")) { - if (properties.JointMotion === 1) - return "JointMotion: multiple values"; - properties.JointMotion = 1; + if (properties.JointMotion === 1) return "JointMotion: multiple values" + properties.JointMotion = 1 { - let error = $root.mirabuf.joint.PrismaticJoint.verify(message.prismatic); - if (error) - return "prismatic." + error; + let error = $root.mirabuf.joint.PrismaticJoint.verify(message.prismatic) + if (error) return "prismatic." + error } } if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.JointMotion === 1) - return "JointMotion: multiple values"; - properties.JointMotion = 1; + if (properties.JointMotion === 1) return "JointMotion: multiple values" + properties.JointMotion = 1 { - let error = $root.mirabuf.joint.CustomJoint.verify(message.custom); - if (error) - return "custom." + error; + let error = $root.mirabuf.joint.CustomJoint.verify(message.custom) + if (error) return "custom." + error } } if (message.userData != null && message.hasOwnProperty("userData")) { - let error = $root.mirabuf.UserData.verify(message.userData); - if (error) - return "userData." + error; + let error = $root.mirabuf.UserData.verify(message.userData) + if (error) return "userData." + error } if (message.motorReference != null && message.hasOwnProperty("motorReference")) - if (!$util.isString(message.motorReference)) - return "motorReference: string expected"; - return null; - }; + if (!$util.isString(message.motorReference)) return "motorReference: string expected" + return null + } /** * Creates a Joint message from a plain object. Also converts values to their respective internal types. @@ -6931,85 +6726,81 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.Joint} Joint */ Joint.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.Joint) - return object; - let message = new $root.mirabuf.joint.Joint(); + if (object instanceof $root.mirabuf.joint.Joint) return object + let message = new $root.mirabuf.joint.Joint() if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".mirabuf.joint.Joint.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + if (typeof object.info !== "object") throw TypeError(".mirabuf.joint.Joint.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } if (object.origin != null) { if (typeof object.origin !== "object") - throw TypeError(".mirabuf.joint.Joint.origin: object expected"); - message.origin = $root.mirabuf.Vector3.fromObject(object.origin); + throw TypeError(".mirabuf.joint.Joint.origin: object expected") + message.origin = $root.mirabuf.Vector3.fromObject(object.origin) } switch (object.jointMotionType) { - default: - if (typeof object.jointMotionType === "number") { - message.jointMotionType = object.jointMotionType; - break; - } - break; - case "RIGID": - case 0: - message.jointMotionType = 0; - break; - case "REVOLUTE": - case 1: - message.jointMotionType = 1; - break; - case "SLIDER": - case 2: - message.jointMotionType = 2; - break; - case "CYLINDRICAL": - case 3: - message.jointMotionType = 3; - break; - case "PINSLOT": - case 4: - message.jointMotionType = 4; - break; - case "PLANAR": - case 5: - message.jointMotionType = 5; - break; - case "BALL": - case 6: - message.jointMotionType = 6; - break; - case "CUSTOM": - case 7: - message.jointMotionType = 7; - break; - } - if (object.breakMagnitude != null) - message.breakMagnitude = Number(object.breakMagnitude); + default: + if (typeof object.jointMotionType === "number") { + message.jointMotionType = object.jointMotionType + break + } + break + case "RIGID": + case 0: + message.jointMotionType = 0 + break + case "REVOLUTE": + case 1: + message.jointMotionType = 1 + break + case "SLIDER": + case 2: + message.jointMotionType = 2 + break + case "CYLINDRICAL": + case 3: + message.jointMotionType = 3 + break + case "PINSLOT": + case 4: + message.jointMotionType = 4 + break + case "PLANAR": + case 5: + message.jointMotionType = 5 + break + case "BALL": + case 6: + message.jointMotionType = 6 + break + case "CUSTOM": + case 7: + message.jointMotionType = 7 + break + } + if (object.breakMagnitude != null) message.breakMagnitude = Number(object.breakMagnitude) if (object.rotational != null) { if (typeof object.rotational !== "object") - throw TypeError(".mirabuf.joint.Joint.rotational: object expected"); - message.rotational = $root.mirabuf.joint.RotationalJoint.fromObject(object.rotational); + throw TypeError(".mirabuf.joint.Joint.rotational: object expected") + message.rotational = $root.mirabuf.joint.RotationalJoint.fromObject(object.rotational) } if (object.prismatic != null) { if (typeof object.prismatic !== "object") - throw TypeError(".mirabuf.joint.Joint.prismatic: object expected"); - message.prismatic = $root.mirabuf.joint.PrismaticJoint.fromObject(object.prismatic); + throw TypeError(".mirabuf.joint.Joint.prismatic: object expected") + message.prismatic = $root.mirabuf.joint.PrismaticJoint.fromObject(object.prismatic) } if (object.custom != null) { if (typeof object.custom !== "object") - throw TypeError(".mirabuf.joint.Joint.custom: object expected"); - message.custom = $root.mirabuf.joint.CustomJoint.fromObject(object.custom); + throw TypeError(".mirabuf.joint.Joint.custom: object expected") + message.custom = $root.mirabuf.joint.CustomJoint.fromObject(object.custom) } if (object.userData != null) { if (typeof object.userData !== "object") - throw TypeError(".mirabuf.joint.Joint.userData: object expected"); - message.userData = $root.mirabuf.UserData.fromObject(object.userData); + throw TypeError(".mirabuf.joint.Joint.userData: object expected") + message.userData = $root.mirabuf.UserData.fromObject(object.userData) } - if (object.motorReference != null) - message.motorReference = String(object.motorReference); - return message; - }; + if (object.motorReference != null) message.motorReference = String(object.motorReference) + return message + } /** * Creates a plain object from a Joint message. Also converts values to other types if specified. @@ -7021,46 +6812,50 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Joint.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.info = null; - object.origin = null; - object.jointMotionType = options.enums === String ? "RIGID" : 0; - object.breakMagnitude = 0; - object.userData = null; - object.motorReference = ""; + object.info = null + object.origin = null + object.jointMotionType = options.enums === String ? "RIGID" : 0 + object.breakMagnitude = 0 + object.userData = null + object.motorReference = "" } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); + object.info = $root.mirabuf.Info.toObject(message.info, options) if (message.origin != null && message.hasOwnProperty("origin")) - object.origin = $root.mirabuf.Vector3.toObject(message.origin, options); + object.origin = $root.mirabuf.Vector3.toObject(message.origin, options) if (message.jointMotionType != null && message.hasOwnProperty("jointMotionType")) - object.jointMotionType = options.enums === String ? $root.mirabuf.joint.JointMotion[message.jointMotionType] === undefined ? message.jointMotionType : $root.mirabuf.joint.JointMotion[message.jointMotionType] : message.jointMotionType; + object.jointMotionType = + options.enums === String + ? $root.mirabuf.joint.JointMotion[message.jointMotionType] === undefined + ? message.jointMotionType + : $root.mirabuf.joint.JointMotion[message.jointMotionType] + : message.jointMotionType if (message.breakMagnitude != null && message.hasOwnProperty("breakMagnitude")) - object.breakMagnitude = options.json && !isFinite(message.breakMagnitude) ? String(message.breakMagnitude) : message.breakMagnitude; + object.breakMagnitude = + options.json && !isFinite(message.breakMagnitude) + ? String(message.breakMagnitude) + : message.breakMagnitude if (message.rotational != null && message.hasOwnProperty("rotational")) { - object.rotational = $root.mirabuf.joint.RotationalJoint.toObject(message.rotational, options); - if (options.oneofs) - object.JointMotion = "rotational"; + object.rotational = $root.mirabuf.joint.RotationalJoint.toObject(message.rotational, options) + if (options.oneofs) object.JointMotion = "rotational" } if (message.prismatic != null && message.hasOwnProperty("prismatic")) { - object.prismatic = $root.mirabuf.joint.PrismaticJoint.toObject(message.prismatic, options); - if (options.oneofs) - object.JointMotion = "prismatic"; + object.prismatic = $root.mirabuf.joint.PrismaticJoint.toObject(message.prismatic, options) + if (options.oneofs) object.JointMotion = "prismatic" } if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.mirabuf.joint.CustomJoint.toObject(message.custom, options); - if (options.oneofs) - object.JointMotion = "custom"; + object.custom = $root.mirabuf.joint.CustomJoint.toObject(message.custom, options) + if (options.oneofs) object.JointMotion = "custom" } if (message.userData != null && message.hasOwnProperty("userData")) - object.userData = $root.mirabuf.UserData.toObject(message.userData, options); + object.userData = $root.mirabuf.UserData.toObject(message.userData, options) if (message.motorReference != null && message.hasOwnProperty("motorReference")) - object.motorReference = message.motorReference; - return object; - }; + object.motorReference = message.motorReference + return object + } /** * Converts this Joint to JSON. @@ -7070,8 +6865,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Joint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Joint @@ -7083,16 +6878,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Joint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.Joint"; - }; - - return Joint; - })(); + return typeUrlPrefix + "/mirabuf.joint.Joint" + } - joint.Dynamics = (function() { + return Joint + })() + joint.Dynamics = (function () { /** * Properties of a Dynamics. * @memberof mirabuf.joint @@ -7112,8 +6906,7 @@ export const mirabuf = $root.mirabuf = (() => { function Dynamics(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -7122,7 +6915,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Dynamics * @instance */ - Dynamics.prototype.damping = 0; + Dynamics.prototype.damping = 0 /** * Friction effect on a given joint motion @@ -7130,7 +6923,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Dynamics * @instance */ - Dynamics.prototype.friction = 0; + Dynamics.prototype.friction = 0 /** * Creates a new Dynamics instance using the specified properties. @@ -7141,8 +6934,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.Dynamics} Dynamics instance */ Dynamics.create = function create(properties) { - return new Dynamics(properties); - }; + return new Dynamics(properties) + } /** * Encodes the specified Dynamics message. Does not implicitly {@link mirabuf.joint.Dynamics.verify|verify} messages. @@ -7154,14 +6947,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Dynamics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.damping != null && Object.hasOwnProperty.call(message, "damping")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.damping); + writer.uint32(/* id 1, wireType 5 =*/ 13).float(message.damping) if (message.friction != null && Object.hasOwnProperty.call(message, "friction")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.friction); - return writer; - }; + writer.uint32(/* id 2, wireType 5 =*/ 21).float(message.friction) + return writer + } /** * Encodes the specified Dynamics message, length delimited. Does not implicitly {@link mirabuf.joint.Dynamics.verify|verify} messages. @@ -7173,8 +6965,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Dynamics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Dynamics message from the specified reader or buffer. @@ -7188,27 +6980,27 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Dynamics.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.Dynamics(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.Dynamics() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.damping = reader.float(); - break; + case 1: { + message.damping = reader.float() + break } - case 2: { - message.friction = reader.float(); - break; + case 2: { + message.friction = reader.float() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Dynamics message from the specified reader or buffer, length delimited. @@ -7221,10 +7013,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Dynamics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Dynamics message. @@ -7235,16 +7026,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Dynamics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.damping != null && message.hasOwnProperty("damping")) - if (typeof message.damping !== "number") - return "damping: number expected"; + if (typeof message.damping !== "number") return "damping: number expected" if (message.friction != null && message.hasOwnProperty("friction")) - if (typeof message.friction !== "number") - return "friction: number expected"; - return null; - }; + if (typeof message.friction !== "number") return "friction: number expected" + return null + } /** * Creates a Dynamics message from a plain object. Also converts values to their respective internal types. @@ -7255,15 +7043,12 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.Dynamics} Dynamics */ Dynamics.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.Dynamics) - return object; - let message = new $root.mirabuf.joint.Dynamics(); - if (object.damping != null) - message.damping = Number(object.damping); - if (object.friction != null) - message.friction = Number(object.friction); - return message; - }; + if (object instanceof $root.mirabuf.joint.Dynamics) return object + let message = new $root.mirabuf.joint.Dynamics() + if (object.damping != null) message.damping = Number(object.damping) + if (object.friction != null) message.friction = Number(object.friction) + return message + } /** * Creates a plain object from a Dynamics message. Also converts values to other types if specified. @@ -7275,19 +7060,20 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Dynamics.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.damping = 0; - object.friction = 0; + object.damping = 0 + object.friction = 0 } if (message.damping != null && message.hasOwnProperty("damping")) - object.damping = options.json && !isFinite(message.damping) ? String(message.damping) : message.damping; + object.damping = + options.json && !isFinite(message.damping) ? String(message.damping) : message.damping if (message.friction != null && message.hasOwnProperty("friction")) - object.friction = options.json && !isFinite(message.friction) ? String(message.friction) : message.friction; - return object; - }; + object.friction = + options.json && !isFinite(message.friction) ? String(message.friction) : message.friction + return object + } /** * Converts this Dynamics to JSON. @@ -7297,8 +7083,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Dynamics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Dynamics @@ -7310,16 +7096,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Dynamics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.Dynamics"; - }; - - return Dynamics; - })(); + return typeUrlPrefix + "/mirabuf.joint.Dynamics" + } - joint.Limits = (function() { + return Dynamics + })() + joint.Limits = (function () { /** * Properties of a Limits. * @memberof mirabuf.joint @@ -7334,7 +7119,7 @@ export const mirabuf = $root.mirabuf = (() => { * Constructs a new Limits. * @memberof mirabuf.joint * @classdesc Limits specify the mechanical range of a given joint. - * + * * TODO: Add units * @implements ILimits * @constructor @@ -7343,8 +7128,7 @@ export const mirabuf = $root.mirabuf = (() => { function Limits(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -7353,7 +7137,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Limits * @instance */ - Limits.prototype.lower = 0; + Limits.prototype.lower = 0 /** * Upper Limit is the joint extent @@ -7361,7 +7145,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Limits * @instance */ - Limits.prototype.upper = 0; + Limits.prototype.upper = 0 /** * Velocity Max in m/s^2 (angular for rotational) @@ -7369,7 +7153,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Limits * @instance */ - Limits.prototype.velocity = 0; + Limits.prototype.velocity = 0 /** * Effort is the absolute force a joint can apply for a given instant - ROS has a great article on it http://wiki.ros.org/pr2_controller_manager/safety_limits @@ -7377,7 +7161,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Limits * @instance */ - Limits.prototype.effort = 0; + Limits.prototype.effort = 0 /** * Creates a new Limits instance using the specified properties. @@ -7388,8 +7172,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.Limits} Limits instance */ Limits.create = function create(properties) { - return new Limits(properties); - }; + return new Limits(properties) + } /** * Encodes the specified Limits message. Does not implicitly {@link mirabuf.joint.Limits.verify|verify} messages. @@ -7401,18 +7185,17 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Limits.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.lower != null && Object.hasOwnProperty.call(message, "lower")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.lower); + writer.uint32(/* id 1, wireType 5 =*/ 13).float(message.lower) if (message.upper != null && Object.hasOwnProperty.call(message, "upper")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.upper); + writer.uint32(/* id 2, wireType 5 =*/ 21).float(message.upper) if (message.velocity != null && Object.hasOwnProperty.call(message, "velocity")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.velocity); + writer.uint32(/* id 3, wireType 5 =*/ 29).float(message.velocity) if (message.effort != null && Object.hasOwnProperty.call(message, "effort")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.effort); - return writer; - }; + writer.uint32(/* id 4, wireType 5 =*/ 37).float(message.effort) + return writer + } /** * Encodes the specified Limits message, length delimited. Does not implicitly {@link mirabuf.joint.Limits.verify|verify} messages. @@ -7424,8 +7207,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Limits.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Limits message from the specified reader or buffer. @@ -7439,35 +7222,35 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Limits.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.Limits(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.Limits() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.lower = reader.float(); - break; + case 1: { + message.lower = reader.float() + break } - case 2: { - message.upper = reader.float(); - break; + case 2: { + message.upper = reader.float() + break } - case 3: { - message.velocity = reader.float(); - break; + case 3: { + message.velocity = reader.float() + break } - case 4: { - message.effort = reader.float(); - break; + case 4: { + message.effort = reader.float() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Limits message from the specified reader or buffer, length delimited. @@ -7480,10 +7263,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Limits.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Limits message. @@ -7494,22 +7276,17 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Limits.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.lower != null && message.hasOwnProperty("lower")) - if (typeof message.lower !== "number") - return "lower: number expected"; + if (typeof message.lower !== "number") return "lower: number expected" if (message.upper != null && message.hasOwnProperty("upper")) - if (typeof message.upper !== "number") - return "upper: number expected"; + if (typeof message.upper !== "number") return "upper: number expected" if (message.velocity != null && message.hasOwnProperty("velocity")) - if (typeof message.velocity !== "number") - return "velocity: number expected"; + if (typeof message.velocity !== "number") return "velocity: number expected" if (message.effort != null && message.hasOwnProperty("effort")) - if (typeof message.effort !== "number") - return "effort: number expected"; - return null; - }; + if (typeof message.effort !== "number") return "effort: number expected" + return null + } /** * Creates a Limits message from a plain object. Also converts values to their respective internal types. @@ -7520,19 +7297,14 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.Limits} Limits */ Limits.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.Limits) - return object; - let message = new $root.mirabuf.joint.Limits(); - if (object.lower != null) - message.lower = Number(object.lower); - if (object.upper != null) - message.upper = Number(object.upper); - if (object.velocity != null) - message.velocity = Number(object.velocity); - if (object.effort != null) - message.effort = Number(object.effort); - return message; - }; + if (object instanceof $root.mirabuf.joint.Limits) return object + let message = new $root.mirabuf.joint.Limits() + if (object.lower != null) message.lower = Number(object.lower) + if (object.upper != null) message.upper = Number(object.upper) + if (object.velocity != null) message.velocity = Number(object.velocity) + if (object.effort != null) message.effort = Number(object.effort) + return message + } /** * Creates a plain object from a Limits message. Also converts values to other types if specified. @@ -7544,25 +7316,25 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Limits.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.lower = 0; - object.upper = 0; - object.velocity = 0; - object.effort = 0; + object.lower = 0 + object.upper = 0 + object.velocity = 0 + object.effort = 0 } if (message.lower != null && message.hasOwnProperty("lower")) - object.lower = options.json && !isFinite(message.lower) ? String(message.lower) : message.lower; + object.lower = options.json && !isFinite(message.lower) ? String(message.lower) : message.lower if (message.upper != null && message.hasOwnProperty("upper")) - object.upper = options.json && !isFinite(message.upper) ? String(message.upper) : message.upper; + object.upper = options.json && !isFinite(message.upper) ? String(message.upper) : message.upper if (message.velocity != null && message.hasOwnProperty("velocity")) - object.velocity = options.json && !isFinite(message.velocity) ? String(message.velocity) : message.velocity; + object.velocity = + options.json && !isFinite(message.velocity) ? String(message.velocity) : message.velocity if (message.effort != null && message.hasOwnProperty("effort")) - object.effort = options.json && !isFinite(message.effort) ? String(message.effort) : message.effort; - return object; - }; + object.effort = options.json && !isFinite(message.effort) ? String(message.effort) : message.effort + return object + } /** * Converts this Limits to JSON. @@ -7572,8 +7344,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Limits.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Limits @@ -7585,16 +7357,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Limits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.Limits"; - }; - - return Limits; - })(); + return typeUrlPrefix + "/mirabuf.joint.Limits" + } - joint.Safety = (function() { + return Limits + })() + joint.Safety = (function () { /** * Properties of a Safety. * @memberof mirabuf.joint @@ -7611,7 +7382,7 @@ export const mirabuf = $root.mirabuf = (() => { * @classdesc Safety switch configuration for a given joint. * Can usefully indicate a bounds issue. * Inspired by the URDF implementation. - * + * * This should really just be created by the controller. * http://wiki.ros.org/pr2_controller_manager/safety_limits * @implements ISafety @@ -7621,8 +7392,7 @@ export const mirabuf = $root.mirabuf = (() => { function Safety(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -7631,7 +7401,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Safety * @instance */ - Safety.prototype.lowerLimit = 0; + Safety.prototype.lowerLimit = 0 /** * Upper Software limit @@ -7639,7 +7409,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Safety * @instance */ - Safety.prototype.upperLimit = 0; + Safety.prototype.upperLimit = 0 /** * Relation between position and velocity limit @@ -7647,7 +7417,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Safety * @instance */ - Safety.prototype.kPosition = 0; + Safety.prototype.kPosition = 0 /** * Relation between effort and velocity limit @@ -7655,7 +7425,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.Safety * @instance */ - Safety.prototype.kVelocity = 0; + Safety.prototype.kVelocity = 0 /** * Creates a new Safety instance using the specified properties. @@ -7666,8 +7436,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.Safety} Safety instance */ Safety.create = function create(properties) { - return new Safety(properties); - }; + return new Safety(properties) + } /** * Encodes the specified Safety message. Does not implicitly {@link mirabuf.joint.Safety.verify|verify} messages. @@ -7679,18 +7449,17 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Safety.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.lowerLimit != null && Object.hasOwnProperty.call(message, "lowerLimit")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.lowerLimit); + writer.uint32(/* id 1, wireType 5 =*/ 13).float(message.lowerLimit) if (message.upperLimit != null && Object.hasOwnProperty.call(message, "upperLimit")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.upperLimit); + writer.uint32(/* id 2, wireType 5 =*/ 21).float(message.upperLimit) if (message.kPosition != null && Object.hasOwnProperty.call(message, "kPosition")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.kPosition); + writer.uint32(/* id 3, wireType 5 =*/ 29).float(message.kPosition) if (message.kVelocity != null && Object.hasOwnProperty.call(message, "kVelocity")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.kVelocity); - return writer; - }; + writer.uint32(/* id 4, wireType 5 =*/ 37).float(message.kVelocity) + return writer + } /** * Encodes the specified Safety message, length delimited. Does not implicitly {@link mirabuf.joint.Safety.verify|verify} messages. @@ -7702,8 +7471,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Safety.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Safety message from the specified reader or buffer. @@ -7717,35 +7486,35 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Safety.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.Safety(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.Safety() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.lowerLimit = reader.float(); - break; + case 1: { + message.lowerLimit = reader.float() + break } - case 2: { - message.upperLimit = reader.float(); - break; + case 2: { + message.upperLimit = reader.float() + break } - case 3: { - message.kPosition = reader.float(); - break; + case 3: { + message.kPosition = reader.float() + break } - case 4: { - message.kVelocity = reader.float(); - break; + case 4: { + message.kVelocity = reader.float() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Safety message from the specified reader or buffer, length delimited. @@ -7758,10 +7527,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Safety.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Safety message. @@ -7772,22 +7540,17 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Safety.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.lowerLimit != null && message.hasOwnProperty("lowerLimit")) - if (typeof message.lowerLimit !== "number") - return "lowerLimit: number expected"; + if (typeof message.lowerLimit !== "number") return "lowerLimit: number expected" if (message.upperLimit != null && message.hasOwnProperty("upperLimit")) - if (typeof message.upperLimit !== "number") - return "upperLimit: number expected"; + if (typeof message.upperLimit !== "number") return "upperLimit: number expected" if (message.kPosition != null && message.hasOwnProperty("kPosition")) - if (typeof message.kPosition !== "number") - return "kPosition: number expected"; + if (typeof message.kPosition !== "number") return "kPosition: number expected" if (message.kVelocity != null && message.hasOwnProperty("kVelocity")) - if (typeof message.kVelocity !== "number") - return "kVelocity: number expected"; - return null; - }; + if (typeof message.kVelocity !== "number") return "kVelocity: number expected" + return null + } /** * Creates a Safety message from a plain object. Also converts values to their respective internal types. @@ -7798,19 +7561,14 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.Safety} Safety */ Safety.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.Safety) - return object; - let message = new $root.mirabuf.joint.Safety(); - if (object.lowerLimit != null) - message.lowerLimit = Number(object.lowerLimit); - if (object.upperLimit != null) - message.upperLimit = Number(object.upperLimit); - if (object.kPosition != null) - message.kPosition = Number(object.kPosition); - if (object.kVelocity != null) - message.kVelocity = Number(object.kVelocity); - return message; - }; + if (object instanceof $root.mirabuf.joint.Safety) return object + let message = new $root.mirabuf.joint.Safety() + if (object.lowerLimit != null) message.lowerLimit = Number(object.lowerLimit) + if (object.upperLimit != null) message.upperLimit = Number(object.upperLimit) + if (object.kPosition != null) message.kPosition = Number(object.kPosition) + if (object.kVelocity != null) message.kVelocity = Number(object.kVelocity) + return message + } /** * Creates a plain object from a Safety message. Also converts values to other types if specified. @@ -7822,25 +7580,28 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Safety.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.lowerLimit = 0; - object.upperLimit = 0; - object.kPosition = 0; - object.kVelocity = 0; + object.lowerLimit = 0 + object.upperLimit = 0 + object.kPosition = 0 + object.kVelocity = 0 } if (message.lowerLimit != null && message.hasOwnProperty("lowerLimit")) - object.lowerLimit = options.json && !isFinite(message.lowerLimit) ? String(message.lowerLimit) : message.lowerLimit; + object.lowerLimit = + options.json && !isFinite(message.lowerLimit) ? String(message.lowerLimit) : message.lowerLimit if (message.upperLimit != null && message.hasOwnProperty("upperLimit")) - object.upperLimit = options.json && !isFinite(message.upperLimit) ? String(message.upperLimit) : message.upperLimit; + object.upperLimit = + options.json && !isFinite(message.upperLimit) ? String(message.upperLimit) : message.upperLimit if (message.kPosition != null && message.hasOwnProperty("kPosition")) - object.kPosition = options.json && !isFinite(message.kPosition) ? String(message.kPosition) : message.kPosition; + object.kPosition = + options.json && !isFinite(message.kPosition) ? String(message.kPosition) : message.kPosition if (message.kVelocity != null && message.hasOwnProperty("kVelocity")) - object.kVelocity = options.json && !isFinite(message.kVelocity) ? String(message.kVelocity) : message.kVelocity; - return object; - }; + object.kVelocity = + options.json && !isFinite(message.kVelocity) ? String(message.kVelocity) : message.kVelocity + return object + } /** * Converts this Safety to JSON. @@ -7850,8 +7611,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Safety.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Safety @@ -7863,16 +7624,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Safety.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.Safety"; - }; - - return Safety; - })(); + return typeUrlPrefix + "/mirabuf.joint.Safety" + } - joint.DOF = (function() { + return Safety + })() + joint.DOF = (function () { /** * Properties of a DOF. * @memberof mirabuf.joint @@ -7896,8 +7656,7 @@ export const mirabuf = $root.mirabuf = (() => { function DOF(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -7906,7 +7665,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.DOF * @instance */ - DOF.prototype.name = ""; + DOF.prototype.name = "" /** * Axis the degree of freedom is pivoting by @@ -7914,7 +7673,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.DOF * @instance */ - DOF.prototype.axis = null; + DOF.prototype.axis = null /** * Direction the axis vector is offset from - this has an incorrect naming scheme @@ -7922,7 +7681,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.DOF * @instance */ - DOF.prototype.pivotDirection = 0; + DOF.prototype.pivotDirection = 0 /** * Dynamic properties of this joint pivot @@ -7930,7 +7689,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.DOF * @instance */ - DOF.prototype.dynamics = null; + DOF.prototype.dynamics = null /** * Limits of this freedom @@ -7938,7 +7697,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.DOF * @instance */ - DOF.prototype.limits = null; + DOF.prototype.limits = null /** * Current value of the DOF @@ -7946,7 +7705,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.DOF * @instance */ - DOF.prototype.value = 0; + DOF.prototype.value = 0 /** * Creates a new DOF instance using the specified properties. @@ -7957,8 +7716,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.DOF} DOF instance */ DOF.create = function create(properties) { - return new DOF(properties); - }; + return new DOF(properties) + } /** * Encodes the specified DOF message. Does not implicitly {@link mirabuf.joint.DOF.verify|verify} messages. @@ -7970,22 +7729,30 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ DOF.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name) if (message.axis != null && Object.hasOwnProperty.call(message, "axis")) - $root.mirabuf.Vector3.encode(message.axis, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.mirabuf.Vector3.encode( + message.axis, + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ).ldelim() if (message.pivotDirection != null && Object.hasOwnProperty.call(message, "pivotDirection")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pivotDirection); + writer.uint32(/* id 3, wireType 0 =*/ 24).int32(message.pivotDirection) if (message.dynamics != null && Object.hasOwnProperty.call(message, "dynamics")) - $root.mirabuf.joint.Dynamics.encode(message.dynamics, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.mirabuf.joint.Dynamics.encode( + message.dynamics, + writer.uint32(/* id 4, wireType 2 =*/ 34).fork() + ).ldelim() if (message.limits != null && Object.hasOwnProperty.call(message, "limits")) - $root.mirabuf.joint.Limits.encode(message.limits, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.mirabuf.joint.Limits.encode( + message.limits, + writer.uint32(/* id 5, wireType 2 =*/ 42).fork() + ).ldelim() if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 6, wireType 5 =*/53).float(message.value); - return writer; - }; + writer.uint32(/* id 6, wireType 5 =*/ 53).float(message.value) + return writer + } /** * Encodes the specified DOF message, length delimited. Does not implicitly {@link mirabuf.joint.DOF.verify|verify} messages. @@ -7997,8 +7764,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ DOF.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a DOF message from the specified reader or buffer. @@ -8012,43 +7779,43 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DOF.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.DOF(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.DOF() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; + case 1: { + message.name = reader.string() + break } - case 2: { - message.axis = $root.mirabuf.Vector3.decode(reader, reader.uint32()); - break; + case 2: { + message.axis = $root.mirabuf.Vector3.decode(reader, reader.uint32()) + break } - case 3: { - message.pivotDirection = reader.int32(); - break; + case 3: { + message.pivotDirection = reader.int32() + break } - case 4: { - message.dynamics = $root.mirabuf.joint.Dynamics.decode(reader, reader.uint32()); - break; + case 4: { + message.dynamics = $root.mirabuf.joint.Dynamics.decode(reader, reader.uint32()) + break } - case 5: { - message.limits = $root.mirabuf.joint.Limits.decode(reader, reader.uint32()); - break; + case 5: { + message.limits = $root.mirabuf.joint.Limits.decode(reader, reader.uint32()) + break } - case 6: { - message.value = reader.float(); - break; + case 6: { + message.value = reader.float() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a DOF message from the specified reader or buffer, length delimited. @@ -8061,10 +7828,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DOF.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a DOF message. @@ -8075,40 +7841,34 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DOF.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (!$util.isString(message.name)) return "name: string expected" if (message.axis != null && message.hasOwnProperty("axis")) { - let error = $root.mirabuf.Vector3.verify(message.axis); - if (error) - return "axis." + error; + let error = $root.mirabuf.Vector3.verify(message.axis) + if (error) return "axis." + error } if (message.pivotDirection != null && message.hasOwnProperty("pivotDirection")) switch (message.pivotDirection) { - default: - return "pivotDirection: enum value expected"; - case 0: - case 1: - case 2: - break; + default: + return "pivotDirection: enum value expected" + case 0: + case 1: + case 2: + break } if (message.dynamics != null && message.hasOwnProperty("dynamics")) { - let error = $root.mirabuf.joint.Dynamics.verify(message.dynamics); - if (error) - return "dynamics." + error; + let error = $root.mirabuf.joint.Dynamics.verify(message.dynamics) + if (error) return "dynamics." + error } if (message.limits != null && message.hasOwnProperty("limits")) { - let error = $root.mirabuf.joint.Limits.verify(message.limits); - if (error) - return "limits." + error; + let error = $root.mirabuf.joint.Limits.verify(message.limits) + if (error) return "limits." + error } if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; + if (typeof message.value !== "number") return "value: number expected" + return null + } /** * Creates a DOF message from a plain object. Also converts values to their respective internal types. @@ -8119,50 +7879,45 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.DOF} DOF */ DOF.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.DOF) - return object; - let message = new $root.mirabuf.joint.DOF(); - if (object.name != null) - message.name = String(object.name); + if (object instanceof $root.mirabuf.joint.DOF) return object + let message = new $root.mirabuf.joint.DOF() + if (object.name != null) message.name = String(object.name) if (object.axis != null) { - if (typeof object.axis !== "object") - throw TypeError(".mirabuf.joint.DOF.axis: object expected"); - message.axis = $root.mirabuf.Vector3.fromObject(object.axis); + if (typeof object.axis !== "object") throw TypeError(".mirabuf.joint.DOF.axis: object expected") + message.axis = $root.mirabuf.Vector3.fromObject(object.axis) } switch (object.pivotDirection) { - default: - if (typeof object.pivotDirection === "number") { - message.pivotDirection = object.pivotDirection; - break; - } - break; - case "X": - case 0: - message.pivotDirection = 0; - break; - case "Y": - case 1: - message.pivotDirection = 1; - break; - case "Z": - case 2: - message.pivotDirection = 2; - break; + default: + if (typeof object.pivotDirection === "number") { + message.pivotDirection = object.pivotDirection + break + } + break + case "X": + case 0: + message.pivotDirection = 0 + break + case "Y": + case 1: + message.pivotDirection = 1 + break + case "Z": + case 2: + message.pivotDirection = 2 + break } if (object.dynamics != null) { if (typeof object.dynamics !== "object") - throw TypeError(".mirabuf.joint.DOF.dynamics: object expected"); - message.dynamics = $root.mirabuf.joint.Dynamics.fromObject(object.dynamics); + throw TypeError(".mirabuf.joint.DOF.dynamics: object expected") + message.dynamics = $root.mirabuf.joint.Dynamics.fromObject(object.dynamics) } if (object.limits != null) { - if (typeof object.limits !== "object") - throw TypeError(".mirabuf.joint.DOF.limits: object expected"); - message.limits = $root.mirabuf.joint.Limits.fromObject(object.limits); + if (typeof object.limits !== "object") throw TypeError(".mirabuf.joint.DOF.limits: object expected") + message.limits = $root.mirabuf.joint.Limits.fromObject(object.limits) } - if (object.value != null) - message.value = Number(object.value); - return message; - }; + if (object.value != null) message.value = Number(object.value) + return message + } /** * Creates a plain object from a DOF message. Also converts values to other types if specified. @@ -8174,31 +7929,34 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ DOF.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.name = ""; - object.axis = null; - object.pivotDirection = options.enums === String ? "X" : 0; - object.dynamics = null; - object.limits = null; - object.value = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.name = "" + object.axis = null + object.pivotDirection = options.enums === String ? "X" : 0 + object.dynamics = null + object.limits = null + object.value = 0 + } + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name if (message.axis != null && message.hasOwnProperty("axis")) - object.axis = $root.mirabuf.Vector3.toObject(message.axis, options); + object.axis = $root.mirabuf.Vector3.toObject(message.axis, options) if (message.pivotDirection != null && message.hasOwnProperty("pivotDirection")) - object.pivotDirection = options.enums === String ? $root.mirabuf.Axis[message.pivotDirection] === undefined ? message.pivotDirection : $root.mirabuf.Axis[message.pivotDirection] : message.pivotDirection; + object.pivotDirection = + options.enums === String + ? $root.mirabuf.Axis[message.pivotDirection] === undefined + ? message.pivotDirection + : $root.mirabuf.Axis[message.pivotDirection] + : message.pivotDirection if (message.dynamics != null && message.hasOwnProperty("dynamics")) - object.dynamics = $root.mirabuf.joint.Dynamics.toObject(message.dynamics, options); + object.dynamics = $root.mirabuf.joint.Dynamics.toObject(message.dynamics, options) if (message.limits != null && message.hasOwnProperty("limits")) - object.limits = $root.mirabuf.joint.Limits.toObject(message.limits, options); + object.limits = $root.mirabuf.joint.Limits.toObject(message.limits, options) if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value + return object + } /** * Converts this DOF to JSON. @@ -8208,8 +7966,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ DOF.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for DOF @@ -8221,16 +7979,15 @@ export const mirabuf = $root.mirabuf = (() => { */ DOF.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.DOF"; - }; - - return DOF; - })(); + return typeUrlPrefix + "/mirabuf.joint.DOF" + } - joint.CustomJoint = (function() { + return DOF + })() + joint.CustomJoint = (function () { /** * Properties of a CustomJoint. * @memberof mirabuf.joint @@ -8248,11 +8005,10 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.joint.ICustomJoint=} [properties] Properties to set */ function CustomJoint(properties) { - this.dofs = []; + this.dofs = [] if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -8261,7 +8017,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.CustomJoint * @instance */ - CustomJoint.prototype.dofs = $util.emptyArray; + CustomJoint.prototype.dofs = $util.emptyArray /** * Creates a new CustomJoint instance using the specified properties. @@ -8272,8 +8028,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.CustomJoint} CustomJoint instance */ CustomJoint.create = function create(properties) { - return new CustomJoint(properties); - }; + return new CustomJoint(properties) + } /** * Encodes the specified CustomJoint message. Does not implicitly {@link mirabuf.joint.CustomJoint.verify|verify} messages. @@ -8285,13 +8041,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ CustomJoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.dofs != null && message.dofs.length) for (let i = 0; i < message.dofs.length; ++i) - $root.mirabuf.joint.DOF.encode(message.dofs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + $root.mirabuf.joint.DOF.encode( + message.dofs[i], + writer.uint32(/* id 1, wireType 2 =*/ 10).fork() + ).ldelim() + return writer + } /** * Encodes the specified CustomJoint message, length delimited. Does not implicitly {@link mirabuf.joint.CustomJoint.verify|verify} messages. @@ -8303,8 +8061,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ CustomJoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a CustomJoint message from the specified reader or buffer. @@ -8318,25 +8076,24 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CustomJoint.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.CustomJoint(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.CustomJoint() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - if (!(message.dofs && message.dofs.length)) - message.dofs = []; - message.dofs.push($root.mirabuf.joint.DOF.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.dofs && message.dofs.length)) message.dofs = [] + message.dofs.push($root.mirabuf.joint.DOF.decode(reader, reader.uint32())) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a CustomJoint message from the specified reader or buffer, length delimited. @@ -8349,10 +8106,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CustomJoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a CustomJoint message. @@ -8363,19 +8119,16 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ CustomJoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.dofs != null && message.hasOwnProperty("dofs")) { - if (!Array.isArray(message.dofs)) - return "dofs: array expected"; + if (!Array.isArray(message.dofs)) return "dofs: array expected" for (let i = 0; i < message.dofs.length; ++i) { - let error = $root.mirabuf.joint.DOF.verify(message.dofs[i]); - if (error) - return "dofs." + error; + let error = $root.mirabuf.joint.DOF.verify(message.dofs[i]) + if (error) return "dofs." + error } } - return null; - }; + return null + } /** * Creates a CustomJoint message from a plain object. Also converts values to their respective internal types. @@ -8386,21 +8139,19 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.CustomJoint} CustomJoint */ CustomJoint.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.CustomJoint) - return object; - let message = new $root.mirabuf.joint.CustomJoint(); + if (object instanceof $root.mirabuf.joint.CustomJoint) return object + let message = new $root.mirabuf.joint.CustomJoint() if (object.dofs) { - if (!Array.isArray(object.dofs)) - throw TypeError(".mirabuf.joint.CustomJoint.dofs: array expected"); - message.dofs = []; + if (!Array.isArray(object.dofs)) throw TypeError(".mirabuf.joint.CustomJoint.dofs: array expected") + message.dofs = [] for (let i = 0; i < object.dofs.length; ++i) { if (typeof object.dofs[i] !== "object") - throw TypeError(".mirabuf.joint.CustomJoint.dofs: object expected"); - message.dofs[i] = $root.mirabuf.joint.DOF.fromObject(object.dofs[i]); + throw TypeError(".mirabuf.joint.CustomJoint.dofs: object expected") + message.dofs[i] = $root.mirabuf.joint.DOF.fromObject(object.dofs[i]) } } - return message; - }; + return message + } /** * Creates a plain object from a CustomJoint message. Also converts values to other types if specified. @@ -8412,18 +8163,16 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ CustomJoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.dofs = []; + if (!options) options = {} + let object = {} + if (options.arrays || options.defaults) object.dofs = [] if (message.dofs && message.dofs.length) { - object.dofs = []; + object.dofs = [] for (let j = 0; j < message.dofs.length; ++j) - object.dofs[j] = $root.mirabuf.joint.DOF.toObject(message.dofs[j], options); + object.dofs[j] = $root.mirabuf.joint.DOF.toObject(message.dofs[j], options) } - return object; - }; + return object + } /** * Converts this CustomJoint to JSON. @@ -8433,8 +8182,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ CustomJoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for CustomJoint @@ -8446,16 +8195,15 @@ export const mirabuf = $root.mirabuf = (() => { */ CustomJoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.CustomJoint"; - }; - - return CustomJoint; - })(); + return typeUrlPrefix + "/mirabuf.joint.CustomJoint" + } - joint.RotationalJoint = (function() { + return CustomJoint + })() + joint.RotationalJoint = (function () { /** * Properties of a RotationalJoint. * @memberof mirabuf.joint @@ -8475,8 +8223,7 @@ export const mirabuf = $root.mirabuf = (() => { function RotationalJoint(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -8485,7 +8232,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.RotationalJoint * @instance */ - RotationalJoint.prototype.rotationalFreedom = null; + RotationalJoint.prototype.rotationalFreedom = null /** * Creates a new RotationalJoint instance using the specified properties. @@ -8496,8 +8243,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.RotationalJoint} RotationalJoint instance */ RotationalJoint.create = function create(properties) { - return new RotationalJoint(properties); - }; + return new RotationalJoint(properties) + } /** * Encodes the specified RotationalJoint message. Does not implicitly {@link mirabuf.joint.RotationalJoint.verify|verify} messages. @@ -8509,12 +8256,14 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ RotationalJoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.rotationalFreedom != null && Object.hasOwnProperty.call(message, "rotationalFreedom")) - $root.mirabuf.joint.DOF.encode(message.rotationalFreedom, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + $root.mirabuf.joint.DOF.encode( + message.rotationalFreedom, + writer.uint32(/* id 1, wireType 2 =*/ 10).fork() + ).ldelim() + return writer + } /** * Encodes the specified RotationalJoint message, length delimited. Does not implicitly {@link mirabuf.joint.RotationalJoint.verify|verify} messages. @@ -8526,8 +8275,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ RotationalJoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a RotationalJoint message from the specified reader or buffer. @@ -8541,23 +8290,23 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RotationalJoint.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.RotationalJoint(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.RotationalJoint() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.rotationalFreedom = $root.mirabuf.joint.DOF.decode(reader, reader.uint32()); - break; + case 1: { + message.rotationalFreedom = $root.mirabuf.joint.DOF.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a RotationalJoint message from the specified reader or buffer, length delimited. @@ -8570,10 +8319,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RotationalJoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a RotationalJoint message. @@ -8584,15 +8332,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ RotationalJoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.rotationalFreedom != null && message.hasOwnProperty("rotationalFreedom")) { - let error = $root.mirabuf.joint.DOF.verify(message.rotationalFreedom); - if (error) - return "rotationalFreedom." + error; + let error = $root.mirabuf.joint.DOF.verify(message.rotationalFreedom) + if (error) return "rotationalFreedom." + error } - return null; - }; + return null + } /** * Creates a RotationalJoint message from a plain object. Also converts values to their respective internal types. @@ -8603,16 +8349,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.RotationalJoint} RotationalJoint */ RotationalJoint.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.RotationalJoint) - return object; - let message = new $root.mirabuf.joint.RotationalJoint(); + if (object instanceof $root.mirabuf.joint.RotationalJoint) return object + let message = new $root.mirabuf.joint.RotationalJoint() if (object.rotationalFreedom != null) { if (typeof object.rotationalFreedom !== "object") - throw TypeError(".mirabuf.joint.RotationalJoint.rotationalFreedom: object expected"); - message.rotationalFreedom = $root.mirabuf.joint.DOF.fromObject(object.rotationalFreedom); + throw TypeError(".mirabuf.joint.RotationalJoint.rotationalFreedom: object expected") + message.rotationalFreedom = $root.mirabuf.joint.DOF.fromObject(object.rotationalFreedom) } - return message; - }; + return message + } /** * Creates a plain object from a RotationalJoint message. Also converts values to other types if specified. @@ -8624,15 +8369,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ RotationalJoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.rotationalFreedom = null; + if (!options) options = {} + let object = {} + if (options.defaults) object.rotationalFreedom = null if (message.rotationalFreedom != null && message.hasOwnProperty("rotationalFreedom")) - object.rotationalFreedom = $root.mirabuf.joint.DOF.toObject(message.rotationalFreedom, options); - return object; - }; + object.rotationalFreedom = $root.mirabuf.joint.DOF.toObject(message.rotationalFreedom, options) + return object + } /** * Converts this RotationalJoint to JSON. @@ -8642,8 +8385,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ RotationalJoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for RotationalJoint @@ -8655,16 +8398,15 @@ export const mirabuf = $root.mirabuf = (() => { */ RotationalJoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.RotationalJoint"; - }; - - return RotationalJoint; - })(); + return typeUrlPrefix + "/mirabuf.joint.RotationalJoint" + } - joint.BallJoint = (function() { + return RotationalJoint + })() + joint.BallJoint = (function () { /** * Properties of a BallJoint. * @memberof mirabuf.joint @@ -8685,8 +8427,7 @@ export const mirabuf = $root.mirabuf = (() => { function BallJoint(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -8695,7 +8436,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.BallJoint * @instance */ - BallJoint.prototype.yaw = null; + BallJoint.prototype.yaw = null /** * BallJoint pitch. @@ -8703,7 +8444,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.BallJoint * @instance */ - BallJoint.prototype.pitch = null; + BallJoint.prototype.pitch = null /** * BallJoint rotation. @@ -8711,7 +8452,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.BallJoint * @instance */ - BallJoint.prototype.rotation = null; + BallJoint.prototype.rotation = null /** * Creates a new BallJoint instance using the specified properties. @@ -8722,8 +8463,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.BallJoint} BallJoint instance */ BallJoint.create = function create(properties) { - return new BallJoint(properties); - }; + return new BallJoint(properties) + } /** * Encodes the specified BallJoint message. Does not implicitly {@link mirabuf.joint.BallJoint.verify|verify} messages. @@ -8735,16 +8476,24 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ BallJoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.yaw != null && Object.hasOwnProperty.call(message, "yaw")) - $root.mirabuf.joint.DOF.encode(message.yaw, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.joint.DOF.encode( + message.yaw, + writer.uint32(/* id 1, wireType 2 =*/ 10).fork() + ).ldelim() if (message.pitch != null && Object.hasOwnProperty.call(message, "pitch")) - $root.mirabuf.joint.DOF.encode(message.pitch, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.mirabuf.joint.DOF.encode( + message.pitch, + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ).ldelim() if (message.rotation != null && Object.hasOwnProperty.call(message, "rotation")) - $root.mirabuf.joint.DOF.encode(message.rotation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + $root.mirabuf.joint.DOF.encode( + message.rotation, + writer.uint32(/* id 3, wireType 2 =*/ 26).fork() + ).ldelim() + return writer + } /** * Encodes the specified BallJoint message, length delimited. Does not implicitly {@link mirabuf.joint.BallJoint.verify|verify} messages. @@ -8756,8 +8505,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ BallJoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a BallJoint message from the specified reader or buffer. @@ -8771,31 +8520,31 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BallJoint.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.BallJoint(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.BallJoint() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.yaw = $root.mirabuf.joint.DOF.decode(reader, reader.uint32()); - break; + case 1: { + message.yaw = $root.mirabuf.joint.DOF.decode(reader, reader.uint32()) + break } - case 2: { - message.pitch = $root.mirabuf.joint.DOF.decode(reader, reader.uint32()); - break; + case 2: { + message.pitch = $root.mirabuf.joint.DOF.decode(reader, reader.uint32()) + break } - case 3: { - message.rotation = $root.mirabuf.joint.DOF.decode(reader, reader.uint32()); - break; + case 3: { + message.rotation = $root.mirabuf.joint.DOF.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a BallJoint message from the specified reader or buffer, length delimited. @@ -8808,10 +8557,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ BallJoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a BallJoint message. @@ -8822,25 +8570,21 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ BallJoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.yaw != null && message.hasOwnProperty("yaw")) { - let error = $root.mirabuf.joint.DOF.verify(message.yaw); - if (error) - return "yaw." + error; + let error = $root.mirabuf.joint.DOF.verify(message.yaw) + if (error) return "yaw." + error } if (message.pitch != null && message.hasOwnProperty("pitch")) { - let error = $root.mirabuf.joint.DOF.verify(message.pitch); - if (error) - return "pitch." + error; + let error = $root.mirabuf.joint.DOF.verify(message.pitch) + if (error) return "pitch." + error } if (message.rotation != null && message.hasOwnProperty("rotation")) { - let error = $root.mirabuf.joint.DOF.verify(message.rotation); - if (error) - return "rotation." + error; + let error = $root.mirabuf.joint.DOF.verify(message.rotation) + if (error) return "rotation." + error } - return null; - }; + return null + } /** * Creates a BallJoint message from a plain object. Also converts values to their respective internal types. @@ -8851,26 +8595,24 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.BallJoint} BallJoint */ BallJoint.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.BallJoint) - return object; - let message = new $root.mirabuf.joint.BallJoint(); + if (object instanceof $root.mirabuf.joint.BallJoint) return object + let message = new $root.mirabuf.joint.BallJoint() if (object.yaw != null) { - if (typeof object.yaw !== "object") - throw TypeError(".mirabuf.joint.BallJoint.yaw: object expected"); - message.yaw = $root.mirabuf.joint.DOF.fromObject(object.yaw); + if (typeof object.yaw !== "object") throw TypeError(".mirabuf.joint.BallJoint.yaw: object expected") + message.yaw = $root.mirabuf.joint.DOF.fromObject(object.yaw) } if (object.pitch != null) { if (typeof object.pitch !== "object") - throw TypeError(".mirabuf.joint.BallJoint.pitch: object expected"); - message.pitch = $root.mirabuf.joint.DOF.fromObject(object.pitch); + throw TypeError(".mirabuf.joint.BallJoint.pitch: object expected") + message.pitch = $root.mirabuf.joint.DOF.fromObject(object.pitch) } if (object.rotation != null) { if (typeof object.rotation !== "object") - throw TypeError(".mirabuf.joint.BallJoint.rotation: object expected"); - message.rotation = $root.mirabuf.joint.DOF.fromObject(object.rotation); + throw TypeError(".mirabuf.joint.BallJoint.rotation: object expected") + message.rotation = $root.mirabuf.joint.DOF.fromObject(object.rotation) } - return message; - }; + return message + } /** * Creates a plain object from a BallJoint message. Also converts values to other types if specified. @@ -8882,22 +8624,21 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ BallJoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.yaw = null; - object.pitch = null; - object.rotation = null; + object.yaw = null + object.pitch = null + object.rotation = null } if (message.yaw != null && message.hasOwnProperty("yaw")) - object.yaw = $root.mirabuf.joint.DOF.toObject(message.yaw, options); + object.yaw = $root.mirabuf.joint.DOF.toObject(message.yaw, options) if (message.pitch != null && message.hasOwnProperty("pitch")) - object.pitch = $root.mirabuf.joint.DOF.toObject(message.pitch, options); + object.pitch = $root.mirabuf.joint.DOF.toObject(message.pitch, options) if (message.rotation != null && message.hasOwnProperty("rotation")) - object.rotation = $root.mirabuf.joint.DOF.toObject(message.rotation, options); - return object; - }; + object.rotation = $root.mirabuf.joint.DOF.toObject(message.rotation, options) + return object + } /** * Converts this BallJoint to JSON. @@ -8907,8 +8648,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ BallJoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for BallJoint @@ -8920,16 +8661,15 @@ export const mirabuf = $root.mirabuf = (() => { */ BallJoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.BallJoint"; - }; - - return BallJoint; - })(); + return typeUrlPrefix + "/mirabuf.joint.BallJoint" + } - joint.PrismaticJoint = (function() { + return BallJoint + })() + joint.PrismaticJoint = (function () { /** * Properties of a PrismaticJoint. * @memberof mirabuf.joint @@ -8948,8 +8688,7 @@ export const mirabuf = $root.mirabuf = (() => { function PrismaticJoint(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -8958,7 +8697,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.PrismaticJoint * @instance */ - PrismaticJoint.prototype.prismaticFreedom = null; + PrismaticJoint.prototype.prismaticFreedom = null /** * Creates a new PrismaticJoint instance using the specified properties. @@ -8969,8 +8708,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.PrismaticJoint} PrismaticJoint instance */ PrismaticJoint.create = function create(properties) { - return new PrismaticJoint(properties); - }; + return new PrismaticJoint(properties) + } /** * Encodes the specified PrismaticJoint message. Does not implicitly {@link mirabuf.joint.PrismaticJoint.verify|verify} messages. @@ -8982,12 +8721,14 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ PrismaticJoint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.prismaticFreedom != null && Object.hasOwnProperty.call(message, "prismaticFreedom")) - $root.mirabuf.joint.DOF.encode(message.prismaticFreedom, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + $root.mirabuf.joint.DOF.encode( + message.prismaticFreedom, + writer.uint32(/* id 1, wireType 2 =*/ 10).fork() + ).ldelim() + return writer + } /** * Encodes the specified PrismaticJoint message, length delimited. Does not implicitly {@link mirabuf.joint.PrismaticJoint.verify|verify} messages. @@ -8999,8 +8740,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ PrismaticJoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a PrismaticJoint message from the specified reader or buffer. @@ -9014,23 +8755,23 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PrismaticJoint.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.PrismaticJoint(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.PrismaticJoint() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.prismaticFreedom = $root.mirabuf.joint.DOF.decode(reader, reader.uint32()); - break; + case 1: { + message.prismaticFreedom = $root.mirabuf.joint.DOF.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a PrismaticJoint message from the specified reader or buffer, length delimited. @@ -9043,10 +8784,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PrismaticJoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a PrismaticJoint message. @@ -9057,15 +8797,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ PrismaticJoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.prismaticFreedom != null && message.hasOwnProperty("prismaticFreedom")) { - let error = $root.mirabuf.joint.DOF.verify(message.prismaticFreedom); - if (error) - return "prismaticFreedom." + error; + let error = $root.mirabuf.joint.DOF.verify(message.prismaticFreedom) + if (error) return "prismaticFreedom." + error } - return null; - }; + return null + } /** * Creates a PrismaticJoint message from a plain object. Also converts values to their respective internal types. @@ -9076,16 +8814,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.PrismaticJoint} PrismaticJoint */ PrismaticJoint.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.PrismaticJoint) - return object; - let message = new $root.mirabuf.joint.PrismaticJoint(); + if (object instanceof $root.mirabuf.joint.PrismaticJoint) return object + let message = new $root.mirabuf.joint.PrismaticJoint() if (object.prismaticFreedom != null) { if (typeof object.prismaticFreedom !== "object") - throw TypeError(".mirabuf.joint.PrismaticJoint.prismaticFreedom: object expected"); - message.prismaticFreedom = $root.mirabuf.joint.DOF.fromObject(object.prismaticFreedom); + throw TypeError(".mirabuf.joint.PrismaticJoint.prismaticFreedom: object expected") + message.prismaticFreedom = $root.mirabuf.joint.DOF.fromObject(object.prismaticFreedom) } - return message; - }; + return message + } /** * Creates a plain object from a PrismaticJoint message. Also converts values to other types if specified. @@ -9097,15 +8834,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ PrismaticJoint.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.prismaticFreedom = null; + if (!options) options = {} + let object = {} + if (options.defaults) object.prismaticFreedom = null if (message.prismaticFreedom != null && message.hasOwnProperty("prismaticFreedom")) - object.prismaticFreedom = $root.mirabuf.joint.DOF.toObject(message.prismaticFreedom, options); - return object; - }; + object.prismaticFreedom = $root.mirabuf.joint.DOF.toObject(message.prismaticFreedom, options) + return object + } /** * Converts this PrismaticJoint to JSON. @@ -9115,8 +8850,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ PrismaticJoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for PrismaticJoint @@ -9128,16 +8863,15 @@ export const mirabuf = $root.mirabuf = (() => { */ PrismaticJoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.PrismaticJoint"; - }; - - return PrismaticJoint; - })(); + return typeUrlPrefix + "/mirabuf.joint.PrismaticJoint" + } - joint.RigidGroup = (function() { + return PrismaticJoint + })() + joint.RigidGroup = (function () { /** * Properties of a RigidGroup. * @memberof mirabuf.joint @@ -9155,11 +8889,10 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.joint.IRigidGroup=} [properties] Properties to set */ function RigidGroup(properties) { - this.occurrences = []; + this.occurrences = [] if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -9168,7 +8901,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.RigidGroup * @instance */ - RigidGroup.prototype.name = ""; + RigidGroup.prototype.name = "" /** * RigidGroup occurrences. @@ -9176,7 +8909,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.joint.RigidGroup * @instance */ - RigidGroup.prototype.occurrences = $util.emptyArray; + RigidGroup.prototype.occurrences = $util.emptyArray /** * Creates a new RigidGroup instance using the specified properties. @@ -9187,8 +8920,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.RigidGroup} RigidGroup instance */ RigidGroup.create = function create(properties) { - return new RigidGroup(properties); - }; + return new RigidGroup(properties) + } /** * Encodes the specified RigidGroup message. Does not implicitly {@link mirabuf.joint.RigidGroup.verify|verify} messages. @@ -9200,15 +8933,14 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ RigidGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.name) if (message.occurrences != null && message.occurrences.length) for (let i = 0; i < message.occurrences.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.occurrences[i]); - return writer; - }; + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.occurrences[i]) + return writer + } /** * Encodes the specified RigidGroup message, length delimited. Does not implicitly {@link mirabuf.joint.RigidGroup.verify|verify} messages. @@ -9220,8 +8952,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ RigidGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a RigidGroup message from the specified reader or buffer. @@ -9235,29 +8967,28 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RigidGroup.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.joint.RigidGroup(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.joint.RigidGroup() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; + case 1: { + message.name = reader.string() + break } - case 2: { - if (!(message.occurrences && message.occurrences.length)) - message.occurrences = []; - message.occurrences.push(reader.string()); - break; + case 2: { + if (!(message.occurrences && message.occurrences.length)) message.occurrences = [] + message.occurrences.push(reader.string()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a RigidGroup message from the specified reader or buffer, length delimited. @@ -9270,10 +9001,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ RigidGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a RigidGroup message. @@ -9284,20 +9014,16 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ RigidGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (!$util.isString(message.name)) return "name: string expected" if (message.occurrences != null && message.hasOwnProperty("occurrences")) { - if (!Array.isArray(message.occurrences)) - return "occurrences: array expected"; + if (!Array.isArray(message.occurrences)) return "occurrences: array expected" for (let i = 0; i < message.occurrences.length; ++i) - if (!$util.isString(message.occurrences[i])) - return "occurrences: string[] expected"; + if (!$util.isString(message.occurrences[i])) return "occurrences: string[] expected" } - return null; - }; + return null + } /** * Creates a RigidGroup message from a plain object. Also converts values to their respective internal types. @@ -9308,20 +9034,18 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.joint.RigidGroup} RigidGroup */ RigidGroup.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.joint.RigidGroup) - return object; - let message = new $root.mirabuf.joint.RigidGroup(); - if (object.name != null) - message.name = String(object.name); + if (object instanceof $root.mirabuf.joint.RigidGroup) return object + let message = new $root.mirabuf.joint.RigidGroup() + if (object.name != null) message.name = String(object.name) if (object.occurrences) { if (!Array.isArray(object.occurrences)) - throw TypeError(".mirabuf.joint.RigidGroup.occurrences: array expected"); - message.occurrences = []; + throw TypeError(".mirabuf.joint.RigidGroup.occurrences: array expected") + message.occurrences = [] for (let i = 0; i < object.occurrences.length; ++i) - message.occurrences[i] = String(object.occurrences[i]); + message.occurrences[i] = String(object.occurrences[i]) } - return message; - }; + return message + } /** * Creates a plain object from a RigidGroup message. Also converts values to other types if specified. @@ -9333,22 +9057,17 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ RigidGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.occurrences = []; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (!options) options = {} + let object = {} + if (options.arrays || options.defaults) object.occurrences = [] + if (options.defaults) object.name = "" + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name if (message.occurrences && message.occurrences.length) { - object.occurrences = []; - for (let j = 0; j < message.occurrences.length; ++j) - object.occurrences[j] = message.occurrences[j]; + object.occurrences = [] + for (let j = 0; j < message.occurrences.length; ++j) object.occurrences[j] = message.occurrences[j] } - return object; - }; + return object + } /** * Converts this RigidGroup to JSON. @@ -9358,8 +9077,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ RigidGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for RigidGroup @@ -9371,25 +9090,24 @@ export const mirabuf = $root.mirabuf = (() => { */ RigidGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.joint.RigidGroup"; - }; - - return RigidGroup; - })(); + return typeUrlPrefix + "/mirabuf.joint.RigidGroup" + } - return joint; - })(); + return RigidGroup + })() - mirabuf.motor = (function() { + return joint + })() + mirabuf.motor = (function () { /** * Namespace motor. * @memberof mirabuf * @namespace */ - const motor = {}; + const motor = {} /** * Duty Cycles for electric motors @@ -9403,17 +9121,17 @@ export const mirabuf = $root.mirabuf = (() => { * @property {number} INTERMITTENT_PERIODIC=2 S3 * @property {number} CONTINUOUS_PERIODIC=3 S6 Continuous Operation with Periodic Duty */ - motor.DutyCycles = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTINUOUS_RUNNING"] = 0; - values[valuesById[1] = "SHORT_TIME"] = 1; - values[valuesById[2] = "INTERMITTENT_PERIODIC"] = 2; - values[valuesById[3] = "CONTINUOUS_PERIODIC"] = 3; - return values; - })(); - - motor.Motor = (function() { + motor.DutyCycles = (function () { + const valuesById = {}, + values = Object.create(valuesById) + values[(valuesById[0] = "CONTINUOUS_RUNNING")] = 0 + values[(valuesById[1] = "SHORT_TIME")] = 1 + values[(valuesById[2] = "INTERMITTENT_PERIODIC")] = 2 + values[(valuesById[3] = "CONTINUOUS_PERIODIC")] = 3 + return values + })() + motor.Motor = (function () { /** * Properties of a Motor. * @memberof mirabuf.motor @@ -9435,8 +9153,7 @@ export const mirabuf = $root.mirabuf = (() => { function Motor(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -9445,7 +9162,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.Motor * @instance */ - Motor.prototype.info = null; + Motor.prototype.info = null /** * Motor dcMotor. @@ -9453,7 +9170,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.Motor * @instance */ - Motor.prototype.dcMotor = null; + Motor.prototype.dcMotor = null /** * Motor simpleMotor. @@ -9461,10 +9178,10 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.Motor * @instance */ - Motor.prototype.simpleMotor = null; + Motor.prototype.simpleMotor = null // OneOf field names bound to virtual getters and setters - let $oneOfFields; + let $oneOfFields /** * Motor motorType. @@ -9473,9 +9190,9 @@ export const mirabuf = $root.mirabuf = (() => { * @instance */ Object.defineProperty(Motor.prototype, "motorType", { - get: $util.oneOfGetter($oneOfFields = ["dcMotor", "simpleMotor"]), - set: $util.oneOfSetter($oneOfFields) - }); + get: $util.oneOfGetter(($oneOfFields = ["dcMotor", "simpleMotor"])), + set: $util.oneOfSetter($oneOfFields), + }) /** * Creates a new Motor instance using the specified properties. @@ -9486,8 +9203,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.motor.Motor} Motor instance */ Motor.create = function create(properties) { - return new Motor(properties); - }; + return new Motor(properties) + } /** * Encodes the specified Motor message. Does not implicitly {@link mirabuf.motor.Motor.verify|verify} messages. @@ -9499,16 +9216,21 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Motor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.dcMotor != null && Object.hasOwnProperty.call(message, "dcMotor")) - $root.mirabuf.motor.DCMotor.encode(message.dcMotor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.mirabuf.motor.DCMotor.encode( + message.dcMotor, + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ).ldelim() if (message.simpleMotor != null && Object.hasOwnProperty.call(message, "simpleMotor")) - $root.mirabuf.motor.SimpleMotor.encode(message.simpleMotor, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + $root.mirabuf.motor.SimpleMotor.encode( + message.simpleMotor, + writer.uint32(/* id 3, wireType 2 =*/ 26).fork() + ).ldelim() + return writer + } /** * Encodes the specified Motor message, length delimited. Does not implicitly {@link mirabuf.motor.Motor.verify|verify} messages. @@ -9520,8 +9242,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Motor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Motor message from the specified reader or buffer. @@ -9535,31 +9257,31 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Motor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.motor.Motor(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.motor.Motor() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.dcMotor = $root.mirabuf.motor.DCMotor.decode(reader, reader.uint32()); - break; + case 2: { + message.dcMotor = $root.mirabuf.motor.DCMotor.decode(reader, reader.uint32()) + break } - case 3: { - message.simpleMotor = $root.mirabuf.motor.SimpleMotor.decode(reader, reader.uint32()); - break; + case 3: { + message.simpleMotor = $root.mirabuf.motor.SimpleMotor.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Motor message from the specified reader or buffer, length delimited. @@ -9572,10 +9294,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Motor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Motor message. @@ -9586,34 +9307,29 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Motor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - let properties = {}; + if (typeof message !== "object" || message === null) return "object expected" + let properties = {} if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.dcMotor != null && message.hasOwnProperty("dcMotor")) { - properties.motorType = 1; + properties.motorType = 1 { - let error = $root.mirabuf.motor.DCMotor.verify(message.dcMotor); - if (error) - return "dcMotor." + error; + let error = $root.mirabuf.motor.DCMotor.verify(message.dcMotor) + if (error) return "dcMotor." + error } } if (message.simpleMotor != null && message.hasOwnProperty("simpleMotor")) { - if (properties.motorType === 1) - return "motorType: multiple values"; - properties.motorType = 1; + if (properties.motorType === 1) return "motorType: multiple values" + properties.motorType = 1 { - let error = $root.mirabuf.motor.SimpleMotor.verify(message.simpleMotor); - if (error) - return "simpleMotor." + error; + let error = $root.mirabuf.motor.SimpleMotor.verify(message.simpleMotor) + if (error) return "simpleMotor." + error } } - return null; - }; + return null + } /** * Creates a Motor message from a plain object. Also converts values to their respective internal types. @@ -9624,26 +9340,24 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.motor.Motor} Motor */ Motor.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.motor.Motor) - return object; - let message = new $root.mirabuf.motor.Motor(); + if (object instanceof $root.mirabuf.motor.Motor) return object + let message = new $root.mirabuf.motor.Motor() if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".mirabuf.motor.Motor.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + if (typeof object.info !== "object") throw TypeError(".mirabuf.motor.Motor.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } if (object.dcMotor != null) { if (typeof object.dcMotor !== "object") - throw TypeError(".mirabuf.motor.Motor.dcMotor: object expected"); - message.dcMotor = $root.mirabuf.motor.DCMotor.fromObject(object.dcMotor); + throw TypeError(".mirabuf.motor.Motor.dcMotor: object expected") + message.dcMotor = $root.mirabuf.motor.DCMotor.fromObject(object.dcMotor) } if (object.simpleMotor != null) { if (typeof object.simpleMotor !== "object") - throw TypeError(".mirabuf.motor.Motor.simpleMotor: object expected"); - message.simpleMotor = $root.mirabuf.motor.SimpleMotor.fromObject(object.simpleMotor); + throw TypeError(".mirabuf.motor.Motor.simpleMotor: object expected") + message.simpleMotor = $root.mirabuf.motor.SimpleMotor.fromObject(object.simpleMotor) } - return message; - }; + return message + } /** * Creates a plain object from a Motor message. Also converts values to other types if specified. @@ -9655,25 +9369,21 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Motor.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.info = null; + if (!options) options = {} + let object = {} + if (options.defaults) object.info = null if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); + object.info = $root.mirabuf.Info.toObject(message.info, options) if (message.dcMotor != null && message.hasOwnProperty("dcMotor")) { - object.dcMotor = $root.mirabuf.motor.DCMotor.toObject(message.dcMotor, options); - if (options.oneofs) - object.motorType = "dcMotor"; + object.dcMotor = $root.mirabuf.motor.DCMotor.toObject(message.dcMotor, options) + if (options.oneofs) object.motorType = "dcMotor" } if (message.simpleMotor != null && message.hasOwnProperty("simpleMotor")) { - object.simpleMotor = $root.mirabuf.motor.SimpleMotor.toObject(message.simpleMotor, options); - if (options.oneofs) - object.motorType = "simpleMotor"; + object.simpleMotor = $root.mirabuf.motor.SimpleMotor.toObject(message.simpleMotor, options) + if (options.oneofs) object.motorType = "simpleMotor" } - return object; - }; + return object + } /** * Converts this Motor to JSON. @@ -9683,8 +9393,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Motor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Motor @@ -9696,16 +9406,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Motor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.motor.Motor"; - }; - - return Motor; - })(); + return typeUrlPrefix + "/mirabuf.motor.Motor" + } - motor.SimpleMotor = (function() { + return Motor + })() + motor.SimpleMotor = (function () { /** * Properties of a SimpleMotor. * @memberof mirabuf.motor @@ -9729,8 +9438,7 @@ export const mirabuf = $root.mirabuf = (() => { function SimpleMotor(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -9739,7 +9447,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.SimpleMotor * @instance */ - SimpleMotor.prototype.stallTorque = 0; + SimpleMotor.prototype.stallTorque = 0 /** * The target velocity in RPM, will use stall_torque relationship to reach each step @@ -9747,7 +9455,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.SimpleMotor * @instance */ - SimpleMotor.prototype.maxVelocity = 0; + SimpleMotor.prototype.maxVelocity = 0 /** * (Optional) 0 - 1, the relationship of stall_torque used to perserve the position of this motor @@ -9755,7 +9463,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.SimpleMotor * @instance */ - SimpleMotor.prototype.brakingConstant = 0; + SimpleMotor.prototype.brakingConstant = 0 /** * Creates a new SimpleMotor instance using the specified properties. @@ -9766,8 +9474,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.motor.SimpleMotor} SimpleMotor instance */ SimpleMotor.create = function create(properties) { - return new SimpleMotor(properties); - }; + return new SimpleMotor(properties) + } /** * Encodes the specified SimpleMotor message. Does not implicitly {@link mirabuf.motor.SimpleMotor.verify|verify} messages. @@ -9779,16 +9487,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ SimpleMotor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.stallTorque != null && Object.hasOwnProperty.call(message, "stallTorque")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.stallTorque); + writer.uint32(/* id 1, wireType 5 =*/ 13).float(message.stallTorque) if (message.maxVelocity != null && Object.hasOwnProperty.call(message, "maxVelocity")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.maxVelocity); + writer.uint32(/* id 2, wireType 5 =*/ 21).float(message.maxVelocity) if (message.brakingConstant != null && Object.hasOwnProperty.call(message, "brakingConstant")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.brakingConstant); - return writer; - }; + writer.uint32(/* id 3, wireType 5 =*/ 29).float(message.brakingConstant) + return writer + } /** * Encodes the specified SimpleMotor message, length delimited. Does not implicitly {@link mirabuf.motor.SimpleMotor.verify|verify} messages. @@ -9800,8 +9507,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ SimpleMotor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a SimpleMotor message from the specified reader or buffer. @@ -9815,31 +9522,31 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SimpleMotor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.motor.SimpleMotor(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.motor.SimpleMotor() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.stallTorque = reader.float(); - break; + case 1: { + message.stallTorque = reader.float() + break } - case 2: { - message.maxVelocity = reader.float(); - break; + case 2: { + message.maxVelocity = reader.float() + break } - case 3: { - message.brakingConstant = reader.float(); - break; + case 3: { + message.brakingConstant = reader.float() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a SimpleMotor message from the specified reader or buffer, length delimited. @@ -9852,10 +9559,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SimpleMotor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a SimpleMotor message. @@ -9866,19 +9572,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SimpleMotor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.stallTorque != null && message.hasOwnProperty("stallTorque")) - if (typeof message.stallTorque !== "number") - return "stallTorque: number expected"; + if (typeof message.stallTorque !== "number") return "stallTorque: number expected" if (message.maxVelocity != null && message.hasOwnProperty("maxVelocity")) - if (typeof message.maxVelocity !== "number") - return "maxVelocity: number expected"; + if (typeof message.maxVelocity !== "number") return "maxVelocity: number expected" if (message.brakingConstant != null && message.hasOwnProperty("brakingConstant")) - if (typeof message.brakingConstant !== "number") - return "brakingConstant: number expected"; - return null; - }; + if (typeof message.brakingConstant !== "number") return "brakingConstant: number expected" + return null + } /** * Creates a SimpleMotor message from a plain object. Also converts values to their respective internal types. @@ -9889,17 +9591,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.motor.SimpleMotor} SimpleMotor */ SimpleMotor.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.motor.SimpleMotor) - return object; - let message = new $root.mirabuf.motor.SimpleMotor(); - if (object.stallTorque != null) - message.stallTorque = Number(object.stallTorque); - if (object.maxVelocity != null) - message.maxVelocity = Number(object.maxVelocity); - if (object.brakingConstant != null) - message.brakingConstant = Number(object.brakingConstant); - return message; - }; + if (object instanceof $root.mirabuf.motor.SimpleMotor) return object + let message = new $root.mirabuf.motor.SimpleMotor() + if (object.stallTorque != null) message.stallTorque = Number(object.stallTorque) + if (object.maxVelocity != null) message.maxVelocity = Number(object.maxVelocity) + if (object.brakingConstant != null) message.brakingConstant = Number(object.brakingConstant) + return message + } /** * Creates a plain object from a SimpleMotor message. Also converts values to other types if specified. @@ -9911,22 +9609,30 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ SimpleMotor.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.stallTorque = 0; - object.maxVelocity = 0; - object.brakingConstant = 0; + object.stallTorque = 0 + object.maxVelocity = 0 + object.brakingConstant = 0 } if (message.stallTorque != null && message.hasOwnProperty("stallTorque")) - object.stallTorque = options.json && !isFinite(message.stallTorque) ? String(message.stallTorque) : message.stallTorque; + object.stallTorque = + options.json && !isFinite(message.stallTorque) + ? String(message.stallTorque) + : message.stallTorque if (message.maxVelocity != null && message.hasOwnProperty("maxVelocity")) - object.maxVelocity = options.json && !isFinite(message.maxVelocity) ? String(message.maxVelocity) : message.maxVelocity; + object.maxVelocity = + options.json && !isFinite(message.maxVelocity) + ? String(message.maxVelocity) + : message.maxVelocity if (message.brakingConstant != null && message.hasOwnProperty("brakingConstant")) - object.brakingConstant = options.json && !isFinite(message.brakingConstant) ? String(message.brakingConstant) : message.brakingConstant; - return object; - }; + object.brakingConstant = + options.json && !isFinite(message.brakingConstant) + ? String(message.brakingConstant) + : message.brakingConstant + return object + } /** * Converts this SimpleMotor to JSON. @@ -9936,8 +9642,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ SimpleMotor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for SimpleMotor @@ -9949,16 +9655,15 @@ export const mirabuf = $root.mirabuf = (() => { */ SimpleMotor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.motor.SimpleMotor"; - }; - - return SimpleMotor; - })(); + return typeUrlPrefix + "/mirabuf.motor.SimpleMotor" + } - motor.DCMotor = (function() { + return SimpleMotor + })() + motor.DCMotor = (function () { /** * Properties of a DCMotor. * @memberof mirabuf.motor @@ -9986,8 +9691,7 @@ export const mirabuf = $root.mirabuf = (() => { function DCMotor(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -9996,7 +9700,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor * @instance */ - DCMotor.prototype.referenceUrl = ""; + DCMotor.prototype.referenceUrl = "" /** * m-Nm/Amp @@ -10004,7 +9708,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor * @instance */ - DCMotor.prototype.torqueConstant = 0; + DCMotor.prototype.torqueConstant = 0 /** * mV/rad/sec @@ -10012,7 +9716,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor * @instance */ - DCMotor.prototype.emfConstant = 0; + DCMotor.prototype.emfConstant = 0 /** * Resistance of Motor - Optional if other values are known @@ -10020,7 +9724,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor * @instance */ - DCMotor.prototype.resistance = 0; + DCMotor.prototype.resistance = 0 /** * measure in percentage of 100 - generally around 60 - measured under optimal load @@ -10028,7 +9732,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor * @instance */ - DCMotor.prototype.maximumEffeciency = 0; + DCMotor.prototype.maximumEffeciency = 0 /** * measured in Watts @@ -10036,7 +9740,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor * @instance */ - DCMotor.prototype.maximumPower = 0; + DCMotor.prototype.maximumPower = 0 /** * Stated Duty Cycle of motor @@ -10044,7 +9748,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor * @instance */ - DCMotor.prototype.dutyCycle = 0; + DCMotor.prototype.dutyCycle = 0 /** * Optional data that can give a better relationship to the simulation @@ -10052,7 +9756,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor * @instance */ - DCMotor.prototype.advanced = null; + DCMotor.prototype.advanced = null /** * Creates a new DCMotor instance using the specified properties. @@ -10063,8 +9767,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.motor.DCMotor} DCMotor instance */ DCMotor.create = function create(properties) { - return new DCMotor(properties); - }; + return new DCMotor(properties) + } /** * Encodes the specified DCMotor message. Does not implicitly {@link mirabuf.motor.DCMotor.verify|verify} messages. @@ -10076,26 +9780,28 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ DCMotor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.referenceUrl != null && Object.hasOwnProperty.call(message, "referenceUrl")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.referenceUrl); + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.referenceUrl) if (message.torqueConstant != null && Object.hasOwnProperty.call(message, "torqueConstant")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.torqueConstant); + writer.uint32(/* id 3, wireType 5 =*/ 29).float(message.torqueConstant) if (message.emfConstant != null && Object.hasOwnProperty.call(message, "emfConstant")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.emfConstant); + writer.uint32(/* id 4, wireType 5 =*/ 37).float(message.emfConstant) if (message.resistance != null && Object.hasOwnProperty.call(message, "resistance")) - writer.uint32(/* id 5, wireType 5 =*/45).float(message.resistance); + writer.uint32(/* id 5, wireType 5 =*/ 45).float(message.resistance) if (message.maximumEffeciency != null && Object.hasOwnProperty.call(message, "maximumEffeciency")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.maximumEffeciency); + writer.uint32(/* id 6, wireType 0 =*/ 48).uint32(message.maximumEffeciency) if (message.maximumPower != null && Object.hasOwnProperty.call(message, "maximumPower")) - writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.maximumPower); + writer.uint32(/* id 7, wireType 0 =*/ 56).uint32(message.maximumPower) if (message.dutyCycle != null && Object.hasOwnProperty.call(message, "dutyCycle")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.dutyCycle); + writer.uint32(/* id 8, wireType 0 =*/ 64).int32(message.dutyCycle) if (message.advanced != null && Object.hasOwnProperty.call(message, "advanced")) - $root.mirabuf.motor.DCMotor.Advanced.encode(message.advanced, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - return writer; - }; + $root.mirabuf.motor.DCMotor.Advanced.encode( + message.advanced, + writer.uint32(/* id 16, wireType 2 =*/ 130).fork() + ).ldelim() + return writer + } /** * Encodes the specified DCMotor message, length delimited. Does not implicitly {@link mirabuf.motor.DCMotor.verify|verify} messages. @@ -10107,8 +9813,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ DCMotor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a DCMotor message from the specified reader or buffer. @@ -10122,51 +9828,51 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DCMotor.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.motor.DCMotor(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.motor.DCMotor() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 2: { - message.referenceUrl = reader.string(); - break; + case 2: { + message.referenceUrl = reader.string() + break } - case 3: { - message.torqueConstant = reader.float(); - break; + case 3: { + message.torqueConstant = reader.float() + break } - case 4: { - message.emfConstant = reader.float(); - break; + case 4: { + message.emfConstant = reader.float() + break } - case 5: { - message.resistance = reader.float(); - break; + case 5: { + message.resistance = reader.float() + break } - case 6: { - message.maximumEffeciency = reader.uint32(); - break; + case 6: { + message.maximumEffeciency = reader.uint32() + break } - case 7: { - message.maximumPower = reader.uint32(); - break; + case 7: { + message.maximumPower = reader.uint32() + break } - case 8: { - message.dutyCycle = reader.int32(); - break; + case 8: { + message.dutyCycle = reader.int32() + break } - case 16: { - message.advanced = $root.mirabuf.motor.DCMotor.Advanced.decode(reader, reader.uint32()); - break; + case 16: { + message.advanced = $root.mirabuf.motor.DCMotor.Advanced.decode(reader, reader.uint32()) + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a DCMotor message from the specified reader or buffer, length delimited. @@ -10179,10 +9885,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DCMotor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a DCMotor message. @@ -10193,43 +9898,35 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ DCMotor.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.referenceUrl != null && message.hasOwnProperty("referenceUrl")) - if (!$util.isString(message.referenceUrl)) - return "referenceUrl: string expected"; + if (!$util.isString(message.referenceUrl)) return "referenceUrl: string expected" if (message.torqueConstant != null && message.hasOwnProperty("torqueConstant")) - if (typeof message.torqueConstant !== "number") - return "torqueConstant: number expected"; + if (typeof message.torqueConstant !== "number") return "torqueConstant: number expected" if (message.emfConstant != null && message.hasOwnProperty("emfConstant")) - if (typeof message.emfConstant !== "number") - return "emfConstant: number expected"; + if (typeof message.emfConstant !== "number") return "emfConstant: number expected" if (message.resistance != null && message.hasOwnProperty("resistance")) - if (typeof message.resistance !== "number") - return "resistance: number expected"; + if (typeof message.resistance !== "number") return "resistance: number expected" if (message.maximumEffeciency != null && message.hasOwnProperty("maximumEffeciency")) - if (!$util.isInteger(message.maximumEffeciency)) - return "maximumEffeciency: integer expected"; + if (!$util.isInteger(message.maximumEffeciency)) return "maximumEffeciency: integer expected" if (message.maximumPower != null && message.hasOwnProperty("maximumPower")) - if (!$util.isInteger(message.maximumPower)) - return "maximumPower: integer expected"; + if (!$util.isInteger(message.maximumPower)) return "maximumPower: integer expected" if (message.dutyCycle != null && message.hasOwnProperty("dutyCycle")) switch (message.dutyCycle) { - default: - return "dutyCycle: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + default: + return "dutyCycle: enum value expected" + case 0: + case 1: + case 2: + case 3: + break } if (message.advanced != null && message.hasOwnProperty("advanced")) { - let error = $root.mirabuf.motor.DCMotor.Advanced.verify(message.advanced); - if (error) - return "advanced." + error; + let error = $root.mirabuf.motor.DCMotor.Advanced.verify(message.advanced) + if (error) return "advanced." + error } - return null; - }; + return null + } /** * Creates a DCMotor message from a plain object. Also converts values to their respective internal types. @@ -10240,52 +9937,45 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.motor.DCMotor} DCMotor */ DCMotor.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.motor.DCMotor) - return object; - let message = new $root.mirabuf.motor.DCMotor(); - if (object.referenceUrl != null) - message.referenceUrl = String(object.referenceUrl); - if (object.torqueConstant != null) - message.torqueConstant = Number(object.torqueConstant); - if (object.emfConstant != null) - message.emfConstant = Number(object.emfConstant); - if (object.resistance != null) - message.resistance = Number(object.resistance); - if (object.maximumEffeciency != null) - message.maximumEffeciency = object.maximumEffeciency >>> 0; - if (object.maximumPower != null) - message.maximumPower = object.maximumPower >>> 0; + if (object instanceof $root.mirabuf.motor.DCMotor) return object + let message = new $root.mirabuf.motor.DCMotor() + if (object.referenceUrl != null) message.referenceUrl = String(object.referenceUrl) + if (object.torqueConstant != null) message.torqueConstant = Number(object.torqueConstant) + if (object.emfConstant != null) message.emfConstant = Number(object.emfConstant) + if (object.resistance != null) message.resistance = Number(object.resistance) + if (object.maximumEffeciency != null) message.maximumEffeciency = object.maximumEffeciency >>> 0 + if (object.maximumPower != null) message.maximumPower = object.maximumPower >>> 0 switch (object.dutyCycle) { - default: - if (typeof object.dutyCycle === "number") { - message.dutyCycle = object.dutyCycle; - break; - } - break; - case "CONTINUOUS_RUNNING": - case 0: - message.dutyCycle = 0; - break; - case "SHORT_TIME": - case 1: - message.dutyCycle = 1; - break; - case "INTERMITTENT_PERIODIC": - case 2: - message.dutyCycle = 2; - break; - case "CONTINUOUS_PERIODIC": - case 3: - message.dutyCycle = 3; - break; + default: + if (typeof object.dutyCycle === "number") { + message.dutyCycle = object.dutyCycle + break + } + break + case "CONTINUOUS_RUNNING": + case 0: + message.dutyCycle = 0 + break + case "SHORT_TIME": + case 1: + message.dutyCycle = 1 + break + case "INTERMITTENT_PERIODIC": + case 2: + message.dutyCycle = 2 + break + case "CONTINUOUS_PERIODIC": + case 3: + message.dutyCycle = 3 + break } if (object.advanced != null) { if (typeof object.advanced !== "object") - throw TypeError(".mirabuf.motor.DCMotor.advanced: object expected"); - message.advanced = $root.mirabuf.motor.DCMotor.Advanced.fromObject(object.advanced); + throw TypeError(".mirabuf.motor.DCMotor.advanced: object expected") + message.advanced = $root.mirabuf.motor.DCMotor.Advanced.fromObject(object.advanced) } - return message; - }; + return message + } /** * Creates a plain object from a DCMotor message. Also converts values to other types if specified. @@ -10297,37 +9987,48 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ DCMotor.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.referenceUrl = ""; - object.torqueConstant = 0; - object.emfConstant = 0; - object.resistance = 0; - object.maximumEffeciency = 0; - object.maximumPower = 0; - object.dutyCycle = options.enums === String ? "CONTINUOUS_RUNNING" : 0; - object.advanced = null; + object.referenceUrl = "" + object.torqueConstant = 0 + object.emfConstant = 0 + object.resistance = 0 + object.maximumEffeciency = 0 + object.maximumPower = 0 + object.dutyCycle = options.enums === String ? "CONTINUOUS_RUNNING" : 0 + object.advanced = null } if (message.referenceUrl != null && message.hasOwnProperty("referenceUrl")) - object.referenceUrl = message.referenceUrl; + object.referenceUrl = message.referenceUrl if (message.torqueConstant != null && message.hasOwnProperty("torqueConstant")) - object.torqueConstant = options.json && !isFinite(message.torqueConstant) ? String(message.torqueConstant) : message.torqueConstant; + object.torqueConstant = + options.json && !isFinite(message.torqueConstant) + ? String(message.torqueConstant) + : message.torqueConstant if (message.emfConstant != null && message.hasOwnProperty("emfConstant")) - object.emfConstant = options.json && !isFinite(message.emfConstant) ? String(message.emfConstant) : message.emfConstant; + object.emfConstant = + options.json && !isFinite(message.emfConstant) + ? String(message.emfConstant) + : message.emfConstant if (message.resistance != null && message.hasOwnProperty("resistance")) - object.resistance = options.json && !isFinite(message.resistance) ? String(message.resistance) : message.resistance; + object.resistance = + options.json && !isFinite(message.resistance) ? String(message.resistance) : message.resistance if (message.maximumEffeciency != null && message.hasOwnProperty("maximumEffeciency")) - object.maximumEffeciency = message.maximumEffeciency; + object.maximumEffeciency = message.maximumEffeciency if (message.maximumPower != null && message.hasOwnProperty("maximumPower")) - object.maximumPower = message.maximumPower; + object.maximumPower = message.maximumPower if (message.dutyCycle != null && message.hasOwnProperty("dutyCycle")) - object.dutyCycle = options.enums === String ? $root.mirabuf.motor.DutyCycles[message.dutyCycle] === undefined ? message.dutyCycle : $root.mirabuf.motor.DutyCycles[message.dutyCycle] : message.dutyCycle; + object.dutyCycle = + options.enums === String + ? $root.mirabuf.motor.DutyCycles[message.dutyCycle] === undefined + ? message.dutyCycle + : $root.mirabuf.motor.DutyCycles[message.dutyCycle] + : message.dutyCycle if (message.advanced != null && message.hasOwnProperty("advanced")) - object.advanced = $root.mirabuf.motor.DCMotor.Advanced.toObject(message.advanced, options); - return object; - }; + object.advanced = $root.mirabuf.motor.DCMotor.Advanced.toObject(message.advanced, options) + return object + } /** * Converts this DCMotor to JSON. @@ -10337,8 +10038,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ DCMotor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for DCMotor @@ -10350,13 +10051,12 @@ export const mirabuf = $root.mirabuf = (() => { */ DCMotor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.motor.DCMotor"; - }; - - DCMotor.Advanced = (function() { + return typeUrlPrefix + "/mirabuf.motor.DCMotor" + } + DCMotor.Advanced = (function () { /** * Properties of an Advanced. * @memberof mirabuf.motor.DCMotor @@ -10380,8 +10080,7 @@ export const mirabuf = $root.mirabuf = (() => { function Advanced(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -10390,7 +10089,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor.Advanced * @instance */ - Advanced.prototype.freeCurrent = 0; + Advanced.prototype.freeCurrent = 0 /** * measured in RPM @@ -10398,7 +10097,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor.Advanced * @instance */ - Advanced.prototype.freeSpeed = 0; + Advanced.prototype.freeSpeed = 0 /** * measure in AMPs @@ -10406,7 +10105,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor.Advanced * @instance */ - Advanced.prototype.stallCurrent = 0; + Advanced.prototype.stallCurrent = 0 /** * measured in Nm @@ -10414,7 +10113,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor.Advanced * @instance */ - Advanced.prototype.stallTorque = 0; + Advanced.prototype.stallTorque = 0 /** * measured in Volts DC @@ -10422,7 +10121,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor.Advanced * @instance */ - Advanced.prototype.inputVoltage = 0; + Advanced.prototype.inputVoltage = 0 /** * between (K * (N / 4)) and (K * ((N-2) / 4)) where N is number of poles - leave at 0 if unknown @@ -10430,7 +10129,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.motor.DCMotor.Advanced * @instance */ - Advanced.prototype.resistanceVariation = 0; + Advanced.prototype.resistanceVariation = 0 /** * Creates a new Advanced instance using the specified properties. @@ -10441,8 +10140,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.motor.DCMotor.Advanced} Advanced instance */ Advanced.create = function create(properties) { - return new Advanced(properties); - }; + return new Advanced(properties) + } /** * Encodes the specified Advanced message. Does not implicitly {@link mirabuf.motor.DCMotor.Advanced.verify|verify} messages. @@ -10454,22 +10153,24 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Advanced.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.freeCurrent != null && Object.hasOwnProperty.call(message, "freeCurrent")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.freeCurrent); + writer.uint32(/* id 1, wireType 5 =*/ 13).float(message.freeCurrent) if (message.freeSpeed != null && Object.hasOwnProperty.call(message, "freeSpeed")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.freeSpeed); + writer.uint32(/* id 2, wireType 0 =*/ 16).uint32(message.freeSpeed) if (message.stallCurrent != null && Object.hasOwnProperty.call(message, "stallCurrent")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.stallCurrent); + writer.uint32(/* id 3, wireType 5 =*/ 29).float(message.stallCurrent) if (message.stallTorque != null && Object.hasOwnProperty.call(message, "stallTorque")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.stallTorque); + writer.uint32(/* id 4, wireType 5 =*/ 37).float(message.stallTorque) if (message.inputVoltage != null && Object.hasOwnProperty.call(message, "inputVoltage")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.inputVoltage); - if (message.resistanceVariation != null && Object.hasOwnProperty.call(message, "resistanceVariation")) - writer.uint32(/* id 7, wireType 5 =*/61).float(message.resistanceVariation); - return writer; - }; + writer.uint32(/* id 5, wireType 0 =*/ 40).uint32(message.inputVoltage) + if ( + message.resistanceVariation != null && + Object.hasOwnProperty.call(message, "resistanceVariation") + ) + writer.uint32(/* id 7, wireType 5 =*/ 61).float(message.resistanceVariation) + return writer + } /** * Encodes the specified Advanced message, length delimited. Does not implicitly {@link mirabuf.motor.DCMotor.Advanced.verify|verify} messages. @@ -10481,8 +10182,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Advanced.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes an Advanced message from the specified reader or buffer. @@ -10496,43 +10197,43 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Advanced.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.motor.DCMotor.Advanced(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.motor.DCMotor.Advanced() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.freeCurrent = reader.float(); - break; + case 1: { + message.freeCurrent = reader.float() + break } - case 2: { - message.freeSpeed = reader.uint32(); - break; + case 2: { + message.freeSpeed = reader.uint32() + break } - case 3: { - message.stallCurrent = reader.float(); - break; + case 3: { + message.stallCurrent = reader.float() + break } - case 4: { - message.stallTorque = reader.float(); - break; + case 4: { + message.stallTorque = reader.float() + break } - case 5: { - message.inputVoltage = reader.uint32(); - break; + case 5: { + message.inputVoltage = reader.uint32() + break } - case 7: { - message.resistanceVariation = reader.float(); - break; + case 7: { + message.resistanceVariation = reader.float() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes an Advanced message from the specified reader or buffer, length delimited. @@ -10545,10 +10246,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Advanced.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies an Advanced message. @@ -10559,28 +10259,22 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Advanced.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.freeCurrent != null && message.hasOwnProperty("freeCurrent")) - if (typeof message.freeCurrent !== "number") - return "freeCurrent: number expected"; + if (typeof message.freeCurrent !== "number") return "freeCurrent: number expected" if (message.freeSpeed != null && message.hasOwnProperty("freeSpeed")) - if (!$util.isInteger(message.freeSpeed)) - return "freeSpeed: integer expected"; + if (!$util.isInteger(message.freeSpeed)) return "freeSpeed: integer expected" if (message.stallCurrent != null && message.hasOwnProperty("stallCurrent")) - if (typeof message.stallCurrent !== "number") - return "stallCurrent: number expected"; + if (typeof message.stallCurrent !== "number") return "stallCurrent: number expected" if (message.stallTorque != null && message.hasOwnProperty("stallTorque")) - if (typeof message.stallTorque !== "number") - return "stallTorque: number expected"; + if (typeof message.stallTorque !== "number") return "stallTorque: number expected" if (message.inputVoltage != null && message.hasOwnProperty("inputVoltage")) - if (!$util.isInteger(message.inputVoltage)) - return "inputVoltage: integer expected"; + if (!$util.isInteger(message.inputVoltage)) return "inputVoltage: integer expected" if (message.resistanceVariation != null && message.hasOwnProperty("resistanceVariation")) if (typeof message.resistanceVariation !== "number") - return "resistanceVariation: number expected"; - return null; - }; + return "resistanceVariation: number expected" + return null + } /** * Creates an Advanced message from a plain object. Also converts values to their respective internal types. @@ -10591,23 +10285,17 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.motor.DCMotor.Advanced} Advanced */ Advanced.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.motor.DCMotor.Advanced) - return object; - let message = new $root.mirabuf.motor.DCMotor.Advanced(); - if (object.freeCurrent != null) - message.freeCurrent = Number(object.freeCurrent); - if (object.freeSpeed != null) - message.freeSpeed = object.freeSpeed >>> 0; - if (object.stallCurrent != null) - message.stallCurrent = Number(object.stallCurrent); - if (object.stallTorque != null) - message.stallTorque = Number(object.stallTorque); - if (object.inputVoltage != null) - message.inputVoltage = object.inputVoltage >>> 0; + if (object instanceof $root.mirabuf.motor.DCMotor.Advanced) return object + let message = new $root.mirabuf.motor.DCMotor.Advanced() + if (object.freeCurrent != null) message.freeCurrent = Number(object.freeCurrent) + if (object.freeSpeed != null) message.freeSpeed = object.freeSpeed >>> 0 + if (object.stallCurrent != null) message.stallCurrent = Number(object.stallCurrent) + if (object.stallTorque != null) message.stallTorque = Number(object.stallTorque) + if (object.inputVoltage != null) message.inputVoltage = object.inputVoltage >>> 0 if (object.resistanceVariation != null) - message.resistanceVariation = Number(object.resistanceVariation); - return message; - }; + message.resistanceVariation = Number(object.resistanceVariation) + return message + } /** * Creates a plain object from an Advanced message. Also converts values to other types if specified. @@ -10619,31 +10307,42 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Advanced.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.freeCurrent = 0; - object.freeSpeed = 0; - object.stallCurrent = 0; - object.stallTorque = 0; - object.inputVoltage = 0; - object.resistanceVariation = 0; + object.freeCurrent = 0 + object.freeSpeed = 0 + object.stallCurrent = 0 + object.stallTorque = 0 + object.inputVoltage = 0 + object.resistanceVariation = 0 } if (message.freeCurrent != null && message.hasOwnProperty("freeCurrent")) - object.freeCurrent = options.json && !isFinite(message.freeCurrent) ? String(message.freeCurrent) : message.freeCurrent; + object.freeCurrent = + options.json && !isFinite(message.freeCurrent) + ? String(message.freeCurrent) + : message.freeCurrent if (message.freeSpeed != null && message.hasOwnProperty("freeSpeed")) - object.freeSpeed = message.freeSpeed; + object.freeSpeed = message.freeSpeed if (message.stallCurrent != null && message.hasOwnProperty("stallCurrent")) - object.stallCurrent = options.json && !isFinite(message.stallCurrent) ? String(message.stallCurrent) : message.stallCurrent; + object.stallCurrent = + options.json && !isFinite(message.stallCurrent) + ? String(message.stallCurrent) + : message.stallCurrent if (message.stallTorque != null && message.hasOwnProperty("stallTorque")) - object.stallTorque = options.json && !isFinite(message.stallTorque) ? String(message.stallTorque) : message.stallTorque; + object.stallTorque = + options.json && !isFinite(message.stallTorque) + ? String(message.stallTorque) + : message.stallTorque if (message.inputVoltage != null && message.hasOwnProperty("inputVoltage")) - object.inputVoltage = message.inputVoltage; + object.inputVoltage = message.inputVoltage if (message.resistanceVariation != null && message.hasOwnProperty("resistanceVariation")) - object.resistanceVariation = options.json && !isFinite(message.resistanceVariation) ? String(message.resistanceVariation) : message.resistanceVariation; - return object; - }; + object.resistanceVariation = + options.json && !isFinite(message.resistanceVariation) + ? String(message.resistanceVariation) + : message.resistanceVariation + return object + } /** * Converts this Advanced to JSON. @@ -10653,8 +10352,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Advanced.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Advanced @@ -10666,31 +10365,29 @@ export const mirabuf = $root.mirabuf = (() => { */ Advanced.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.motor.DCMotor.Advanced"; - }; - - return Advanced; - })(); + return typeUrlPrefix + "/mirabuf.motor.DCMotor.Advanced" + } - return DCMotor; - })(); + return Advanced + })() - return motor; - })(); + return DCMotor + })() - mirabuf.material = (function() { + return motor + })() + mirabuf.material = (function () { /** * Namespace material. * @memberof mirabuf * @namespace */ - const material = {}; - - material.Materials = (function() { + const material = {} + material.Materials = (function () { /** * Properties of a Materials. * @memberof mirabuf.material @@ -10704,19 +10401,18 @@ export const mirabuf = $root.mirabuf = (() => { * Constructs a new Materials. * @memberof mirabuf.material * @classdesc Represents a File or Set of Materials with Appearances and Physical Data - * + * * Can be Stored in AssemblyData * @implements IMaterials * @constructor * @param {mirabuf.material.IMaterials=} [properties] Properties to set */ function Materials(properties) { - this.physicalMaterials = {}; - this.appearances = {}; + this.physicalMaterials = {} + this.appearances = {} if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -10725,7 +10421,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.Materials * @instance */ - Materials.prototype.info = null; + Materials.prototype.info = null /** * Map of Physical Materials @@ -10733,7 +10429,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.Materials * @instance */ - Materials.prototype.physicalMaterials = $util.emptyObject; + Materials.prototype.physicalMaterials = $util.emptyObject /** * Map of Appearances that are purely visual @@ -10741,7 +10437,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.Materials * @instance */ - Materials.prototype.appearances = $util.emptyObject; + Materials.prototype.appearances = $util.emptyObject /** * Creates a new Materials instance using the specified properties. @@ -10752,8 +10448,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.Materials} Materials instance */ Materials.create = function create(properties) { - return new Materials(properties); - }; + return new Materials(properties) + } /** * Encodes the specified Materials message. Does not implicitly {@link mirabuf.material.Materials.verify|verify} messages. @@ -10765,22 +10461,39 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Materials.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.physicalMaterials != null && Object.hasOwnProperty.call(message, "physicalMaterials")) for (let keys = Object.keys(message.physicalMaterials), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.mirabuf.material.PhysicalMaterial.encode(message.physicalMaterials[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + writer + .uint32(/* id 2, wireType 2 =*/ 18) + .fork() + .uint32(/* id 1, wireType 2 =*/ 10) + .string(keys[i]) + $root.mirabuf.material.PhysicalMaterial.encode( + message.physicalMaterials[keys[i]], + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ) + .ldelim() + .ldelim() } if (message.appearances != null && Object.hasOwnProperty.call(message, "appearances")) for (let keys = Object.keys(message.appearances), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.mirabuf.material.Appearance.encode(message.appearances[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + writer + .uint32(/* id 3, wireType 2 =*/ 26) + .fork() + .uint32(/* id 1, wireType 2 =*/ 10) + .string(keys[i]) + $root.mirabuf.material.Appearance.encode( + message.appearances[keys[i]], + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ) + .ldelim() + .ldelim() } - return writer; - }; + return writer + } /** * Encodes the specified Materials message, length delimited. Does not implicitly {@link mirabuf.material.Materials.verify|verify} messages. @@ -10792,8 +10505,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Materials.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Materials message from the specified reader or buffer. @@ -10807,69 +10520,69 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Materials.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.material.Materials(), key, value; + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.material.Materials(), + key, + value while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - if (message.physicalMaterials === $util.emptyObject) - message.physicalMaterials = {}; - let end2 = reader.uint32() + reader.pos; - key = ""; - value = null; + case 2: { + if (message.physicalMaterials === $util.emptyObject) message.physicalMaterials = {} + let end2 = reader.uint32() + reader.pos + key = "" + value = null while (reader.pos < end2) { - let tag2 = reader.uint32(); + let tag2 = reader.uint32() switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.mirabuf.material.PhysicalMaterial.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: + key = reader.string() + break + case 2: + value = $root.mirabuf.material.PhysicalMaterial.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag2 & 7) + break } } - message.physicalMaterials[key] = value; - break; + message.physicalMaterials[key] = value + break } - case 3: { - if (message.appearances === $util.emptyObject) - message.appearances = {}; - let end2 = reader.uint32() + reader.pos; - key = ""; - value = null; + case 3: { + if (message.appearances === $util.emptyObject) message.appearances = {} + let end2 = reader.uint32() + reader.pos + key = "" + value = null while (reader.pos < end2) { - let tag2 = reader.uint32(); + let tag2 = reader.uint32() switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.mirabuf.material.Appearance.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: + key = reader.string() + break + case 2: + value = $root.mirabuf.material.Appearance.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag2 & 7) + break } } - message.appearances[key] = value; - break; + message.appearances[key] = value + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Materials message from the specified reader or buffer, length delimited. @@ -10882,10 +10595,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Materials.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Materials message. @@ -10896,35 +10608,29 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Materials.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.physicalMaterials != null && message.hasOwnProperty("physicalMaterials")) { - if (!$util.isObject(message.physicalMaterials)) - return "physicalMaterials: object expected"; - let key = Object.keys(message.physicalMaterials); + if (!$util.isObject(message.physicalMaterials)) return "physicalMaterials: object expected" + let key = Object.keys(message.physicalMaterials) for (let i = 0; i < key.length; ++i) { - let error = $root.mirabuf.material.PhysicalMaterial.verify(message.physicalMaterials[key[i]]); - if (error) - return "physicalMaterials." + error; + let error = $root.mirabuf.material.PhysicalMaterial.verify(message.physicalMaterials[key[i]]) + if (error) return "physicalMaterials." + error } } if (message.appearances != null && message.hasOwnProperty("appearances")) { - if (!$util.isObject(message.appearances)) - return "appearances: object expected"; - let key = Object.keys(message.appearances); + if (!$util.isObject(message.appearances)) return "appearances: object expected" + let key = Object.keys(message.appearances) for (let i = 0; i < key.length; ++i) { - let error = $root.mirabuf.material.Appearance.verify(message.appearances[key[i]]); - if (error) - return "appearances." + error; + let error = $root.mirabuf.material.Appearance.verify(message.appearances[key[i]]) + if (error) return "appearances." + error } } - return null; - }; + return null + } /** * Creates a Materials message from a plain object. Also converts values to their respective internal types. @@ -10935,36 +10641,39 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.Materials} Materials */ Materials.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.material.Materials) - return object; - let message = new $root.mirabuf.material.Materials(); + if (object instanceof $root.mirabuf.material.Materials) return object + let message = new $root.mirabuf.material.Materials() if (object.info != null) { if (typeof object.info !== "object") - throw TypeError(".mirabuf.material.Materials.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + throw TypeError(".mirabuf.material.Materials.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } if (object.physicalMaterials) { if (typeof object.physicalMaterials !== "object") - throw TypeError(".mirabuf.material.Materials.physicalMaterials: object expected"); - message.physicalMaterials = {}; + throw TypeError(".mirabuf.material.Materials.physicalMaterials: object expected") + message.physicalMaterials = {} for (let keys = Object.keys(object.physicalMaterials), i = 0; i < keys.length; ++i) { if (typeof object.physicalMaterials[keys[i]] !== "object") - throw TypeError(".mirabuf.material.Materials.physicalMaterials: object expected"); - message.physicalMaterials[keys[i]] = $root.mirabuf.material.PhysicalMaterial.fromObject(object.physicalMaterials[keys[i]]); + throw TypeError(".mirabuf.material.Materials.physicalMaterials: object expected") + message.physicalMaterials[keys[i]] = $root.mirabuf.material.PhysicalMaterial.fromObject( + object.physicalMaterials[keys[i]] + ) } } if (object.appearances) { if (typeof object.appearances !== "object") - throw TypeError(".mirabuf.material.Materials.appearances: object expected"); - message.appearances = {}; + throw TypeError(".mirabuf.material.Materials.appearances: object expected") + message.appearances = {} for (let keys = Object.keys(object.appearances), i = 0; i < keys.length; ++i) { if (typeof object.appearances[keys[i]] !== "object") - throw TypeError(".mirabuf.material.Materials.appearances: object expected"); - message.appearances[keys[i]] = $root.mirabuf.material.Appearance.fromObject(object.appearances[keys[i]]); + throw TypeError(".mirabuf.material.Materials.appearances: object expected") + message.appearances[keys[i]] = $root.mirabuf.material.Appearance.fromObject( + object.appearances[keys[i]] + ) } } - return message; - }; + return message + } /** * Creates a plain object from a Materials message. Also converts values to other types if specified. @@ -10976,30 +10685,34 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Materials.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.objects || options.defaults) { - object.physicalMaterials = {}; - object.appearances = {}; + object.physicalMaterials = {} + object.appearances = {} } - if (options.defaults) - object.info = null; + if (options.defaults) object.info = null if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); - let keys2; + object.info = $root.mirabuf.Info.toObject(message.info, options) + let keys2 if (message.physicalMaterials && (keys2 = Object.keys(message.physicalMaterials)).length) { - object.physicalMaterials = {}; + object.physicalMaterials = {} for (let j = 0; j < keys2.length; ++j) - object.physicalMaterials[keys2[j]] = $root.mirabuf.material.PhysicalMaterial.toObject(message.physicalMaterials[keys2[j]], options); + object.physicalMaterials[keys2[j]] = $root.mirabuf.material.PhysicalMaterial.toObject( + message.physicalMaterials[keys2[j]], + options + ) } if (message.appearances && (keys2 = Object.keys(message.appearances)).length) { - object.appearances = {}; + object.appearances = {} for (let j = 0; j < keys2.length; ++j) - object.appearances[keys2[j]] = $root.mirabuf.material.Appearance.toObject(message.appearances[keys2[j]], options); + object.appearances[keys2[j]] = $root.mirabuf.material.Appearance.toObject( + message.appearances[keys2[j]], + options + ) } - return object; - }; + return object + } /** * Converts this Materials to JSON. @@ -11009,8 +10722,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Materials.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Materials @@ -11022,16 +10735,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Materials.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.material.Materials"; - }; - - return Materials; - })(); + return typeUrlPrefix + "/mirabuf.material.Materials" + } - material.Appearance = (function() { + return Materials + })() + material.Appearance = (function () { /** * Properties of an Appearance. * @memberof mirabuf.material @@ -11055,8 +10767,7 @@ export const mirabuf = $root.mirabuf = (() => { function Appearance(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -11065,7 +10776,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.Appearance * @instance */ - Appearance.prototype.info = null; + Appearance.prototype.info = null /** * albedo map RGBA 0-255 @@ -11073,7 +10784,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.Appearance * @instance */ - Appearance.prototype.albedo = null; + Appearance.prototype.albedo = null /** * roughness value 0-1 @@ -11081,7 +10792,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.Appearance * @instance */ - Appearance.prototype.roughness = 0; + Appearance.prototype.roughness = 0 /** * metallic value 0-1 @@ -11089,7 +10800,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.Appearance * @instance */ - Appearance.prototype.metallic = 0; + Appearance.prototype.metallic = 0 /** * specular value 0-1 @@ -11097,7 +10808,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.Appearance * @instance */ - Appearance.prototype.specular = 0; + Appearance.prototype.specular = 0 /** * Creates a new Appearance instance using the specified properties. @@ -11108,8 +10819,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.Appearance} Appearance instance */ Appearance.create = function create(properties) { - return new Appearance(properties); - }; + return new Appearance(properties) + } /** * Encodes the specified Appearance message. Does not implicitly {@link mirabuf.material.Appearance.verify|verify} messages. @@ -11121,20 +10832,22 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Appearance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.albedo != null && Object.hasOwnProperty.call(message, "albedo")) - $root.mirabuf.Color.encode(message.albedo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.mirabuf.Color.encode( + message.albedo, + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ).ldelim() if (message.roughness != null && Object.hasOwnProperty.call(message, "roughness")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.roughness); + writer.uint32(/* id 3, wireType 1 =*/ 25).double(message.roughness) if (message.metallic != null && Object.hasOwnProperty.call(message, "metallic")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.metallic); + writer.uint32(/* id 4, wireType 1 =*/ 33).double(message.metallic) if (message.specular != null && Object.hasOwnProperty.call(message, "specular")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.specular); - return writer; - }; + writer.uint32(/* id 5, wireType 1 =*/ 41).double(message.specular) + return writer + } /** * Encodes the specified Appearance message, length delimited. Does not implicitly {@link mirabuf.material.Appearance.verify|verify} messages. @@ -11146,8 +10859,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Appearance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes an Appearance message from the specified reader or buffer. @@ -11161,39 +10874,39 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Appearance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.material.Appearance(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.material.Appearance() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.albedo = $root.mirabuf.Color.decode(reader, reader.uint32()); - break; + case 2: { + message.albedo = $root.mirabuf.Color.decode(reader, reader.uint32()) + break } - case 3: { - message.roughness = reader.double(); - break; + case 3: { + message.roughness = reader.double() + break } - case 4: { - message.metallic = reader.double(); - break; + case 4: { + message.metallic = reader.double() + break } - case 5: { - message.specular = reader.double(); - break; + case 5: { + message.specular = reader.double() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes an Appearance message from the specified reader or buffer, length delimited. @@ -11206,10 +10919,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Appearance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies an Appearance message. @@ -11220,29 +10932,23 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Appearance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.albedo != null && message.hasOwnProperty("albedo")) { - let error = $root.mirabuf.Color.verify(message.albedo); - if (error) - return "albedo." + error; + let error = $root.mirabuf.Color.verify(message.albedo) + if (error) return "albedo." + error } if (message.roughness != null && message.hasOwnProperty("roughness")) - if (typeof message.roughness !== "number") - return "roughness: number expected"; + if (typeof message.roughness !== "number") return "roughness: number expected" if (message.metallic != null && message.hasOwnProperty("metallic")) - if (typeof message.metallic !== "number") - return "metallic: number expected"; + if (typeof message.metallic !== "number") return "metallic: number expected" if (message.specular != null && message.hasOwnProperty("specular")) - if (typeof message.specular !== "number") - return "specular: number expected"; - return null; - }; + if (typeof message.specular !== "number") return "specular: number expected" + return null + } /** * Creates an Appearance message from a plain object. Also converts values to their respective internal types. @@ -11253,27 +10959,23 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.Appearance} Appearance */ Appearance.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.material.Appearance) - return object; - let message = new $root.mirabuf.material.Appearance(); + if (object instanceof $root.mirabuf.material.Appearance) return object + let message = new $root.mirabuf.material.Appearance() if (object.info != null) { if (typeof object.info !== "object") - throw TypeError(".mirabuf.material.Appearance.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + throw TypeError(".mirabuf.material.Appearance.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } if (object.albedo != null) { if (typeof object.albedo !== "object") - throw TypeError(".mirabuf.material.Appearance.albedo: object expected"); - message.albedo = $root.mirabuf.Color.fromObject(object.albedo); + throw TypeError(".mirabuf.material.Appearance.albedo: object expected") + message.albedo = $root.mirabuf.Color.fromObject(object.albedo) } - if (object.roughness != null) - message.roughness = Number(object.roughness); - if (object.metallic != null) - message.metallic = Number(object.metallic); - if (object.specular != null) - message.specular = Number(object.specular); - return message; - }; + if (object.roughness != null) message.roughness = Number(object.roughness) + if (object.metallic != null) message.metallic = Number(object.metallic) + if (object.specular != null) message.specular = Number(object.specular) + return message + } /** * Creates a plain object from an Appearance message. Also converts values to other types if specified. @@ -11285,28 +10987,30 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Appearance.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.info = null; - object.albedo = null; - object.roughness = 0; - object.metallic = 0; - object.specular = 0; + object.info = null + object.albedo = null + object.roughness = 0 + object.metallic = 0 + object.specular = 0 } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); + object.info = $root.mirabuf.Info.toObject(message.info, options) if (message.albedo != null && message.hasOwnProperty("albedo")) - object.albedo = $root.mirabuf.Color.toObject(message.albedo, options); + object.albedo = $root.mirabuf.Color.toObject(message.albedo, options) if (message.roughness != null && message.hasOwnProperty("roughness")) - object.roughness = options.json && !isFinite(message.roughness) ? String(message.roughness) : message.roughness; + object.roughness = + options.json && !isFinite(message.roughness) ? String(message.roughness) : message.roughness if (message.metallic != null && message.hasOwnProperty("metallic")) - object.metallic = options.json && !isFinite(message.metallic) ? String(message.metallic) : message.metallic; + object.metallic = + options.json && !isFinite(message.metallic) ? String(message.metallic) : message.metallic if (message.specular != null && message.hasOwnProperty("specular")) - object.specular = options.json && !isFinite(message.specular) ? String(message.specular) : message.specular; - return object; - }; + object.specular = + options.json && !isFinite(message.specular) ? String(message.specular) : message.specular + return object + } /** * Converts this Appearance to JSON. @@ -11316,8 +11020,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Appearance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Appearance @@ -11329,16 +11033,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Appearance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.material.Appearance"; - }; - - return Appearance; - })(); + return typeUrlPrefix + "/mirabuf.material.Appearance" + } - material.PhysicalMaterial = (function() { + return Appearance + })() + material.PhysicalMaterial = (function () { /** * Properties of a PhysicalMaterial. * @memberof mirabuf.material @@ -11366,8 +11069,7 @@ export const mirabuf = $root.mirabuf = (() => { function PhysicalMaterial(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -11376,7 +11078,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial * @instance */ - PhysicalMaterial.prototype.info = null; + PhysicalMaterial.prototype.info = null /** * short description of physical material @@ -11384,7 +11086,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial * @instance */ - PhysicalMaterial.prototype.description = ""; + PhysicalMaterial.prototype.description = "" /** * Thermal Physical properties of the model OPTIONAL @@ -11392,7 +11094,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial * @instance */ - PhysicalMaterial.prototype.thermal = null; + PhysicalMaterial.prototype.thermal = null /** * Mechanical properties of the model OPTIONAL @@ -11400,7 +11102,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial * @instance */ - PhysicalMaterial.prototype.mechanical = null; + PhysicalMaterial.prototype.mechanical = null /** * Physical Strength properties of the model OPTIONAL @@ -11408,7 +11110,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial * @instance */ - PhysicalMaterial.prototype.strength = null; + PhysicalMaterial.prototype.strength = null /** * Frictional force for dampening - Interpolate (0-1) @@ -11416,7 +11118,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial * @instance */ - PhysicalMaterial.prototype.dynamicFriction = 0; + PhysicalMaterial.prototype.dynamicFriction = 0 /** * Frictional force override at stop - Interpolate (0-1) @@ -11424,7 +11126,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial * @instance */ - PhysicalMaterial.prototype.staticFriction = 0; + PhysicalMaterial.prototype.staticFriction = 0 /** * Restitution of the object - Interpolate (0-1) @@ -11432,7 +11134,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial * @instance */ - PhysicalMaterial.prototype.restitution = 0; + PhysicalMaterial.prototype.restitution = 0 /** * should this object deform when encountering large forces - TODO: This needs a proper message and equation field @@ -11440,7 +11142,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial * @instance */ - PhysicalMaterial.prototype.deformable = false; + PhysicalMaterial.prototype.deformable = false /** * generic type to assign some default params @@ -11448,7 +11150,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial * @instance */ - PhysicalMaterial.prototype.matType = 0; + PhysicalMaterial.prototype.matType = 0 /** * Creates a new PhysicalMaterial instance using the specified properties. @@ -11459,8 +11161,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.PhysicalMaterial} PhysicalMaterial instance */ PhysicalMaterial.create = function create(properties) { - return new PhysicalMaterial(properties); - }; + return new PhysicalMaterial(properties) + } /** * Encodes the specified PhysicalMaterial message. Does not implicitly {@link mirabuf.material.PhysicalMaterial.verify|verify} messages. @@ -11472,30 +11174,38 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ PhysicalMaterial.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.description) if (message.thermal != null && Object.hasOwnProperty.call(message, "thermal")) - $root.mirabuf.material.PhysicalMaterial.Thermal.encode(message.thermal, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.mirabuf.material.PhysicalMaterial.Thermal.encode( + message.thermal, + writer.uint32(/* id 3, wireType 2 =*/ 26).fork() + ).ldelim() if (message.mechanical != null && Object.hasOwnProperty.call(message, "mechanical")) - $root.mirabuf.material.PhysicalMaterial.Mechanical.encode(message.mechanical, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.mirabuf.material.PhysicalMaterial.Mechanical.encode( + message.mechanical, + writer.uint32(/* id 4, wireType 2 =*/ 34).fork() + ).ldelim() if (message.strength != null && Object.hasOwnProperty.call(message, "strength")) - $root.mirabuf.material.PhysicalMaterial.Strength.encode(message.strength, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.mirabuf.material.PhysicalMaterial.Strength.encode( + message.strength, + writer.uint32(/* id 5, wireType 2 =*/ 42).fork() + ).ldelim() if (message.dynamicFriction != null && Object.hasOwnProperty.call(message, "dynamicFriction")) - writer.uint32(/* id 6, wireType 5 =*/53).float(message.dynamicFriction); + writer.uint32(/* id 6, wireType 5 =*/ 53).float(message.dynamicFriction) if (message.staticFriction != null && Object.hasOwnProperty.call(message, "staticFriction")) - writer.uint32(/* id 7, wireType 5 =*/61).float(message.staticFriction); + writer.uint32(/* id 7, wireType 5 =*/ 61).float(message.staticFriction) if (message.restitution != null && Object.hasOwnProperty.call(message, "restitution")) - writer.uint32(/* id 8, wireType 5 =*/69).float(message.restitution); + writer.uint32(/* id 8, wireType 5 =*/ 69).float(message.restitution) if (message.deformable != null && Object.hasOwnProperty.call(message, "deformable")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.deformable); + writer.uint32(/* id 9, wireType 0 =*/ 72).bool(message.deformable) if (message.matType != null && Object.hasOwnProperty.call(message, "matType")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.matType); - return writer; - }; + writer.uint32(/* id 10, wireType 0 =*/ 80).int32(message.matType) + return writer + } /** * Encodes the specified PhysicalMaterial message, length delimited. Does not implicitly {@link mirabuf.material.PhysicalMaterial.verify|verify} messages. @@ -11507,8 +11217,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ PhysicalMaterial.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a PhysicalMaterial message from the specified reader or buffer. @@ -11522,59 +11232,68 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PhysicalMaterial.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.material.PhysicalMaterial(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.material.PhysicalMaterial() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.description = reader.string(); - break; + case 2: { + message.description = reader.string() + break } - case 3: { - message.thermal = $root.mirabuf.material.PhysicalMaterial.Thermal.decode(reader, reader.uint32()); - break; + case 3: { + message.thermal = $root.mirabuf.material.PhysicalMaterial.Thermal.decode( + reader, + reader.uint32() + ) + break } - case 4: { - message.mechanical = $root.mirabuf.material.PhysicalMaterial.Mechanical.decode(reader, reader.uint32()); - break; + case 4: { + message.mechanical = $root.mirabuf.material.PhysicalMaterial.Mechanical.decode( + reader, + reader.uint32() + ) + break } - case 5: { - message.strength = $root.mirabuf.material.PhysicalMaterial.Strength.decode(reader, reader.uint32()); - break; + case 5: { + message.strength = $root.mirabuf.material.PhysicalMaterial.Strength.decode( + reader, + reader.uint32() + ) + break } - case 6: { - message.dynamicFriction = reader.float(); - break; + case 6: { + message.dynamicFriction = reader.float() + break } - case 7: { - message.staticFriction = reader.float(); - break; + case 7: { + message.staticFriction = reader.float() + break } - case 8: { - message.restitution = reader.float(); - break; + case 8: { + message.restitution = reader.float() + break } - case 9: { - message.deformable = reader.bool(); - break; + case 9: { + message.deformable = reader.bool() + break } - case 10: { - message.matType = reader.int32(); - break; + case 10: { + message.matType = reader.int32() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a PhysicalMaterial message from the specified reader or buffer, length delimited. @@ -11587,10 +11306,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PhysicalMaterial.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a PhysicalMaterial message. @@ -11601,53 +11319,43 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ PhysicalMaterial.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; + if (!$util.isString(message.description)) return "description: string expected" if (message.thermal != null && message.hasOwnProperty("thermal")) { - let error = $root.mirabuf.material.PhysicalMaterial.Thermal.verify(message.thermal); - if (error) - return "thermal." + error; + let error = $root.mirabuf.material.PhysicalMaterial.Thermal.verify(message.thermal) + if (error) return "thermal." + error } if (message.mechanical != null && message.hasOwnProperty("mechanical")) { - let error = $root.mirabuf.material.PhysicalMaterial.Mechanical.verify(message.mechanical); - if (error) - return "mechanical." + error; + let error = $root.mirabuf.material.PhysicalMaterial.Mechanical.verify(message.mechanical) + if (error) return "mechanical." + error } if (message.strength != null && message.hasOwnProperty("strength")) { - let error = $root.mirabuf.material.PhysicalMaterial.Strength.verify(message.strength); - if (error) - return "strength." + error; + let error = $root.mirabuf.material.PhysicalMaterial.Strength.verify(message.strength) + if (error) return "strength." + error } if (message.dynamicFriction != null && message.hasOwnProperty("dynamicFriction")) - if (typeof message.dynamicFriction !== "number") - return "dynamicFriction: number expected"; + if (typeof message.dynamicFriction !== "number") return "dynamicFriction: number expected" if (message.staticFriction != null && message.hasOwnProperty("staticFriction")) - if (typeof message.staticFriction !== "number") - return "staticFriction: number expected"; + if (typeof message.staticFriction !== "number") return "staticFriction: number expected" if (message.restitution != null && message.hasOwnProperty("restitution")) - if (typeof message.restitution !== "number") - return "restitution: number expected"; + if (typeof message.restitution !== "number") return "restitution: number expected" if (message.deformable != null && message.hasOwnProperty("deformable")) - if (typeof message.deformable !== "boolean") - return "deformable: boolean expected"; + if (typeof message.deformable !== "boolean") return "deformable: boolean expected" if (message.matType != null && message.hasOwnProperty("matType")) switch (message.matType) { - default: - return "matType: enum value expected"; - case 0: - case 1: - break; + default: + return "matType: enum value expected" + case 0: + case 1: + break } - return null; - }; + return null + } /** * Creates a PhysicalMaterial message from a plain object. Also converts values to their respective internal types. @@ -11658,57 +11366,53 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.PhysicalMaterial} PhysicalMaterial */ PhysicalMaterial.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.material.PhysicalMaterial) - return object; - let message = new $root.mirabuf.material.PhysicalMaterial(); + if (object instanceof $root.mirabuf.material.PhysicalMaterial) return object + let message = new $root.mirabuf.material.PhysicalMaterial() if (object.info != null) { if (typeof object.info !== "object") - throw TypeError(".mirabuf.material.PhysicalMaterial.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + throw TypeError(".mirabuf.material.PhysicalMaterial.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } - if (object.description != null) - message.description = String(object.description); + if (object.description != null) message.description = String(object.description) if (object.thermal != null) { if (typeof object.thermal !== "object") - throw TypeError(".mirabuf.material.PhysicalMaterial.thermal: object expected"); - message.thermal = $root.mirabuf.material.PhysicalMaterial.Thermal.fromObject(object.thermal); + throw TypeError(".mirabuf.material.PhysicalMaterial.thermal: object expected") + message.thermal = $root.mirabuf.material.PhysicalMaterial.Thermal.fromObject(object.thermal) } if (object.mechanical != null) { if (typeof object.mechanical !== "object") - throw TypeError(".mirabuf.material.PhysicalMaterial.mechanical: object expected"); - message.mechanical = $root.mirabuf.material.PhysicalMaterial.Mechanical.fromObject(object.mechanical); + throw TypeError(".mirabuf.material.PhysicalMaterial.mechanical: object expected") + message.mechanical = $root.mirabuf.material.PhysicalMaterial.Mechanical.fromObject( + object.mechanical + ) } if (object.strength != null) { if (typeof object.strength !== "object") - throw TypeError(".mirabuf.material.PhysicalMaterial.strength: object expected"); - message.strength = $root.mirabuf.material.PhysicalMaterial.Strength.fromObject(object.strength); - } - if (object.dynamicFriction != null) - message.dynamicFriction = Number(object.dynamicFriction); - if (object.staticFriction != null) - message.staticFriction = Number(object.staticFriction); - if (object.restitution != null) - message.restitution = Number(object.restitution); - if (object.deformable != null) - message.deformable = Boolean(object.deformable); + throw TypeError(".mirabuf.material.PhysicalMaterial.strength: object expected") + message.strength = $root.mirabuf.material.PhysicalMaterial.Strength.fromObject(object.strength) + } + if (object.dynamicFriction != null) message.dynamicFriction = Number(object.dynamicFriction) + if (object.staticFriction != null) message.staticFriction = Number(object.staticFriction) + if (object.restitution != null) message.restitution = Number(object.restitution) + if (object.deformable != null) message.deformable = Boolean(object.deformable) switch (object.matType) { - default: - if (typeof object.matType === "number") { - message.matType = object.matType; - break; - } - break; - case "METAL": - case 0: - message.matType = 0; - break; - case "PLASTIC": - case 1: - message.matType = 1; - break; + default: + if (typeof object.matType === "number") { + message.matType = object.matType + break + } + break + case "METAL": + case 0: + message.matType = 0 + break + case "PLASTIC": + case 1: + message.matType = 1 + break } - return message; - }; + return message + } /** * Creates a plain object from a PhysicalMaterial message. Also converts values to other types if specified. @@ -11720,43 +11424,62 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ PhysicalMaterial.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.info = null; - object.description = ""; - object.thermal = null; - object.mechanical = null; - object.strength = null; - object.dynamicFriction = 0; - object.staticFriction = 0; - object.restitution = 0; - object.deformable = false; - object.matType = options.enums === String ? "METAL" : 0; + object.info = null + object.description = "" + object.thermal = null + object.mechanical = null + object.strength = null + object.dynamicFriction = 0 + object.staticFriction = 0 + object.restitution = 0 + object.deformable = false + object.matType = options.enums === String ? "METAL" : 0 } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); + object.info = $root.mirabuf.Info.toObject(message.info, options) if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + object.description = message.description if (message.thermal != null && message.hasOwnProperty("thermal")) - object.thermal = $root.mirabuf.material.PhysicalMaterial.Thermal.toObject(message.thermal, options); + object.thermal = $root.mirabuf.material.PhysicalMaterial.Thermal.toObject(message.thermal, options) if (message.mechanical != null && message.hasOwnProperty("mechanical")) - object.mechanical = $root.mirabuf.material.PhysicalMaterial.Mechanical.toObject(message.mechanical, options); + object.mechanical = $root.mirabuf.material.PhysicalMaterial.Mechanical.toObject( + message.mechanical, + options + ) if (message.strength != null && message.hasOwnProperty("strength")) - object.strength = $root.mirabuf.material.PhysicalMaterial.Strength.toObject(message.strength, options); + object.strength = $root.mirabuf.material.PhysicalMaterial.Strength.toObject( + message.strength, + options + ) if (message.dynamicFriction != null && message.hasOwnProperty("dynamicFriction")) - object.dynamicFriction = options.json && !isFinite(message.dynamicFriction) ? String(message.dynamicFriction) : message.dynamicFriction; + object.dynamicFriction = + options.json && !isFinite(message.dynamicFriction) + ? String(message.dynamicFriction) + : message.dynamicFriction if (message.staticFriction != null && message.hasOwnProperty("staticFriction")) - object.staticFriction = options.json && !isFinite(message.staticFriction) ? String(message.staticFriction) : message.staticFriction; + object.staticFriction = + options.json && !isFinite(message.staticFriction) + ? String(message.staticFriction) + : message.staticFriction if (message.restitution != null && message.hasOwnProperty("restitution")) - object.restitution = options.json && !isFinite(message.restitution) ? String(message.restitution) : message.restitution; + object.restitution = + options.json && !isFinite(message.restitution) + ? String(message.restitution) + : message.restitution if (message.deformable != null && message.hasOwnProperty("deformable")) - object.deformable = message.deformable; + object.deformable = message.deformable if (message.matType != null && message.hasOwnProperty("matType")) - object.matType = options.enums === String ? $root.mirabuf.material.PhysicalMaterial.MaterialType[message.matType] === undefined ? message.matType : $root.mirabuf.material.PhysicalMaterial.MaterialType[message.matType] : message.matType; - return object; - }; + object.matType = + options.enums === String + ? $root.mirabuf.material.PhysicalMaterial.MaterialType[message.matType] === undefined + ? message.matType + : $root.mirabuf.material.PhysicalMaterial.MaterialType[message.matType] + : message.matType + return object + } /** * Converts this PhysicalMaterial to JSON. @@ -11766,8 +11489,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ PhysicalMaterial.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for PhysicalMaterial @@ -11779,10 +11502,10 @@ export const mirabuf = $root.mirabuf = (() => { */ PhysicalMaterial.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.material.PhysicalMaterial"; - }; + return typeUrlPrefix + "/mirabuf.material.PhysicalMaterial" + } /** * MaterialType enum. @@ -11791,15 +11514,15 @@ export const mirabuf = $root.mirabuf = (() => { * @property {number} METAL=0 METAL value * @property {number} PLASTIC=1 PLASTIC value */ - PhysicalMaterial.MaterialType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "METAL"] = 0; - values[valuesById[1] = "PLASTIC"] = 1; - return values; - })(); - - PhysicalMaterial.Thermal = (function() { + PhysicalMaterial.MaterialType = (function () { + const valuesById = {}, + values = Object.create(valuesById) + values[(valuesById[0] = "METAL")] = 0 + values[(valuesById[1] = "PLASTIC")] = 1 + return values + })() + PhysicalMaterial.Thermal = (function () { /** * Properties of a Thermal. * @memberof mirabuf.material.PhysicalMaterial @@ -11820,8 +11543,7 @@ export const mirabuf = $root.mirabuf = (() => { function Thermal(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -11830,7 +11552,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Thermal * @instance */ - Thermal.prototype.thermalConductivity = 0; + Thermal.prototype.thermalConductivity = 0 /** * J/(g*C) @@ -11838,7 +11560,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Thermal * @instance */ - Thermal.prototype.specificHeat = 0; + Thermal.prototype.specificHeat = 0 /** * um/(m*C) @@ -11846,7 +11568,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Thermal * @instance */ - Thermal.prototype.thermalExpansionCoefficient = 0; + Thermal.prototype.thermalExpansionCoefficient = 0 /** * Creates a new Thermal instance using the specified properties. @@ -11857,8 +11579,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.PhysicalMaterial.Thermal} Thermal instance */ Thermal.create = function create(properties) { - return new Thermal(properties); - }; + return new Thermal(properties) + } /** * Encodes the specified Thermal message. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Thermal.verify|verify} messages. @@ -11870,16 +11592,21 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Thermal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.thermalConductivity != null && Object.hasOwnProperty.call(message, "thermalConductivity")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.thermalConductivity); + if (!writer) writer = $Writer.create() + if ( + message.thermalConductivity != null && + Object.hasOwnProperty.call(message, "thermalConductivity") + ) + writer.uint32(/* id 1, wireType 5 =*/ 13).float(message.thermalConductivity) if (message.specificHeat != null && Object.hasOwnProperty.call(message, "specificHeat")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.specificHeat); - if (message.thermalExpansionCoefficient != null && Object.hasOwnProperty.call(message, "thermalExpansionCoefficient")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.thermalExpansionCoefficient); - return writer; - }; + writer.uint32(/* id 2, wireType 5 =*/ 21).float(message.specificHeat) + if ( + message.thermalExpansionCoefficient != null && + Object.hasOwnProperty.call(message, "thermalExpansionCoefficient") + ) + writer.uint32(/* id 3, wireType 5 =*/ 29).float(message.thermalExpansionCoefficient) + return writer + } /** * Encodes the specified Thermal message, length delimited. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Thermal.verify|verify} messages. @@ -11891,8 +11618,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Thermal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Thermal message from the specified reader or buffer. @@ -11906,31 +11633,31 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Thermal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.material.PhysicalMaterial.Thermal(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.material.PhysicalMaterial.Thermal() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.thermalConductivity = reader.float(); - break; + case 1: { + message.thermalConductivity = reader.float() + break } - case 2: { - message.specificHeat = reader.float(); - break; + case 2: { + message.specificHeat = reader.float() + break } - case 3: { - message.thermalExpansionCoefficient = reader.float(); - break; + case 3: { + message.thermalExpansionCoefficient = reader.float() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Thermal message from the specified reader or buffer, length delimited. @@ -11943,10 +11670,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Thermal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Thermal message. @@ -11957,19 +11683,20 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Thermal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.thermalConductivity != null && message.hasOwnProperty("thermalConductivity")) if (typeof message.thermalConductivity !== "number") - return "thermalConductivity: number expected"; + return "thermalConductivity: number expected" if (message.specificHeat != null && message.hasOwnProperty("specificHeat")) - if (typeof message.specificHeat !== "number") - return "specificHeat: number expected"; - if (message.thermalExpansionCoefficient != null && message.hasOwnProperty("thermalExpansionCoefficient")) + if (typeof message.specificHeat !== "number") return "specificHeat: number expected" + if ( + message.thermalExpansionCoefficient != null && + message.hasOwnProperty("thermalExpansionCoefficient") + ) if (typeof message.thermalExpansionCoefficient !== "number") - return "thermalExpansionCoefficient: number expected"; - return null; - }; + return "thermalExpansionCoefficient: number expected" + return null + } /** * Creates a Thermal message from a plain object. Also converts values to their respective internal types. @@ -11980,17 +11707,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.PhysicalMaterial.Thermal} Thermal */ Thermal.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.material.PhysicalMaterial.Thermal) - return object; - let message = new $root.mirabuf.material.PhysicalMaterial.Thermal(); + if (object instanceof $root.mirabuf.material.PhysicalMaterial.Thermal) return object + let message = new $root.mirabuf.material.PhysicalMaterial.Thermal() if (object.thermalConductivity != null) - message.thermalConductivity = Number(object.thermalConductivity); - if (object.specificHeat != null) - message.specificHeat = Number(object.specificHeat); + message.thermalConductivity = Number(object.thermalConductivity) + if (object.specificHeat != null) message.specificHeat = Number(object.specificHeat) if (object.thermalExpansionCoefficient != null) - message.thermalExpansionCoefficient = Number(object.thermalExpansionCoefficient); - return message; - }; + message.thermalExpansionCoefficient = Number(object.thermalExpansionCoefficient) + return message + } /** * Creates a plain object from a Thermal message. Also converts values to other types if specified. @@ -12002,22 +11727,33 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Thermal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.thermalConductivity = 0; - object.specificHeat = 0; - object.thermalExpansionCoefficient = 0; + object.thermalConductivity = 0 + object.specificHeat = 0 + object.thermalExpansionCoefficient = 0 } if (message.thermalConductivity != null && message.hasOwnProperty("thermalConductivity")) - object.thermalConductivity = options.json && !isFinite(message.thermalConductivity) ? String(message.thermalConductivity) : message.thermalConductivity; + object.thermalConductivity = + options.json && !isFinite(message.thermalConductivity) + ? String(message.thermalConductivity) + : message.thermalConductivity if (message.specificHeat != null && message.hasOwnProperty("specificHeat")) - object.specificHeat = options.json && !isFinite(message.specificHeat) ? String(message.specificHeat) : message.specificHeat; - if (message.thermalExpansionCoefficient != null && message.hasOwnProperty("thermalExpansionCoefficient")) - object.thermalExpansionCoefficient = options.json && !isFinite(message.thermalExpansionCoefficient) ? String(message.thermalExpansionCoefficient) : message.thermalExpansionCoefficient; - return object; - }; + object.specificHeat = + options.json && !isFinite(message.specificHeat) + ? String(message.specificHeat) + : message.specificHeat + if ( + message.thermalExpansionCoefficient != null && + message.hasOwnProperty("thermalExpansionCoefficient") + ) + object.thermalExpansionCoefficient = + options.json && !isFinite(message.thermalExpansionCoefficient) + ? String(message.thermalExpansionCoefficient) + : message.thermalExpansionCoefficient + return object + } /** * Converts this Thermal to JSON. @@ -12027,8 +11763,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Thermal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Thermal @@ -12040,16 +11776,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Thermal.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.material.PhysicalMaterial.Thermal"; - }; - - return Thermal; - })(); + return typeUrlPrefix + "/mirabuf.material.PhysicalMaterial.Thermal" + } - PhysicalMaterial.Mechanical = (function() { + return Thermal + })() + PhysicalMaterial.Mechanical = (function () { /** * Properties of a Mechanical. * @memberof mirabuf.material.PhysicalMaterial @@ -12072,8 +11807,7 @@ export const mirabuf = $root.mirabuf = (() => { function Mechanical(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -12082,7 +11816,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Mechanical * @instance */ - Mechanical.prototype.youngMod = 0; + Mechanical.prototype.youngMod = 0 /** * ? @@ -12090,7 +11824,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Mechanical * @instance */ - Mechanical.prototype.poissonRatio = 0; + Mechanical.prototype.poissonRatio = 0 /** * MPa @@ -12098,7 +11832,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Mechanical * @instance */ - Mechanical.prototype.shearMod = 0; + Mechanical.prototype.shearMod = 0 /** * g/cm^3 @@ -12106,7 +11840,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Mechanical * @instance */ - Mechanical.prototype.density = 0; + Mechanical.prototype.density = 0 /** * ? @@ -12114,7 +11848,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Mechanical * @instance */ - Mechanical.prototype.dampingCoefficient = 0; + Mechanical.prototype.dampingCoefficient = 0 /** * Creates a new Mechanical instance using the specified properties. @@ -12125,8 +11859,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.PhysicalMaterial.Mechanical} Mechanical instance */ Mechanical.create = function create(properties) { - return new Mechanical(properties); - }; + return new Mechanical(properties) + } /** * Encodes the specified Mechanical message. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Mechanical.verify|verify} messages. @@ -12138,20 +11872,19 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Mechanical.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.youngMod != null && Object.hasOwnProperty.call(message, "youngMod")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.youngMod); + writer.uint32(/* id 1, wireType 5 =*/ 13).float(message.youngMod) if (message.poissonRatio != null && Object.hasOwnProperty.call(message, "poissonRatio")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.poissonRatio); + writer.uint32(/* id 2, wireType 5 =*/ 21).float(message.poissonRatio) if (message.shearMod != null && Object.hasOwnProperty.call(message, "shearMod")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.shearMod); + writer.uint32(/* id 3, wireType 5 =*/ 29).float(message.shearMod) if (message.density != null && Object.hasOwnProperty.call(message, "density")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.density); + writer.uint32(/* id 4, wireType 5 =*/ 37).float(message.density) if (message.dampingCoefficient != null && Object.hasOwnProperty.call(message, "dampingCoefficient")) - writer.uint32(/* id 5, wireType 5 =*/45).float(message.dampingCoefficient); - return writer; - }; + writer.uint32(/* id 5, wireType 5 =*/ 45).float(message.dampingCoefficient) + return writer + } /** * Encodes the specified Mechanical message, length delimited. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Mechanical.verify|verify} messages. @@ -12163,8 +11896,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Mechanical.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Mechanical message from the specified reader or buffer. @@ -12178,39 +11911,39 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Mechanical.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.material.PhysicalMaterial.Mechanical(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.material.PhysicalMaterial.Mechanical() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.youngMod = reader.float(); - break; + case 1: { + message.youngMod = reader.float() + break } - case 2: { - message.poissonRatio = reader.float(); - break; + case 2: { + message.poissonRatio = reader.float() + break } - case 3: { - message.shearMod = reader.float(); - break; + case 3: { + message.shearMod = reader.float() + break } - case 4: { - message.density = reader.float(); - break; + case 4: { + message.density = reader.float() + break } - case 5: { - message.dampingCoefficient = reader.float(); - break; + case 5: { + message.dampingCoefficient = reader.float() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Mechanical message from the specified reader or buffer, length delimited. @@ -12223,10 +11956,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Mechanical.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Mechanical message. @@ -12237,25 +11969,19 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Mechanical.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.youngMod != null && message.hasOwnProperty("youngMod")) - if (typeof message.youngMod !== "number") - return "youngMod: number expected"; + if (typeof message.youngMod !== "number") return "youngMod: number expected" if (message.poissonRatio != null && message.hasOwnProperty("poissonRatio")) - if (typeof message.poissonRatio !== "number") - return "poissonRatio: number expected"; + if (typeof message.poissonRatio !== "number") return "poissonRatio: number expected" if (message.shearMod != null && message.hasOwnProperty("shearMod")) - if (typeof message.shearMod !== "number") - return "shearMod: number expected"; + if (typeof message.shearMod !== "number") return "shearMod: number expected" if (message.density != null && message.hasOwnProperty("density")) - if (typeof message.density !== "number") - return "density: number expected"; + if (typeof message.density !== "number") return "density: number expected" if (message.dampingCoefficient != null && message.hasOwnProperty("dampingCoefficient")) - if (typeof message.dampingCoefficient !== "number") - return "dampingCoefficient: number expected"; - return null; - }; + if (typeof message.dampingCoefficient !== "number") return "dampingCoefficient: number expected" + return null + } /** * Creates a Mechanical message from a plain object. Also converts values to their respective internal types. @@ -12266,21 +11992,16 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.PhysicalMaterial.Mechanical} Mechanical */ Mechanical.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.material.PhysicalMaterial.Mechanical) - return object; - let message = new $root.mirabuf.material.PhysicalMaterial.Mechanical(); - if (object.youngMod != null) - message.youngMod = Number(object.youngMod); - if (object.poissonRatio != null) - message.poissonRatio = Number(object.poissonRatio); - if (object.shearMod != null) - message.shearMod = Number(object.shearMod); - if (object.density != null) - message.density = Number(object.density); + if (object instanceof $root.mirabuf.material.PhysicalMaterial.Mechanical) return object + let message = new $root.mirabuf.material.PhysicalMaterial.Mechanical() + if (object.youngMod != null) message.youngMod = Number(object.youngMod) + if (object.poissonRatio != null) message.poissonRatio = Number(object.poissonRatio) + if (object.shearMod != null) message.shearMod = Number(object.shearMod) + if (object.density != null) message.density = Number(object.density) if (object.dampingCoefficient != null) - message.dampingCoefficient = Number(object.dampingCoefficient); - return message; - }; + message.dampingCoefficient = Number(object.dampingCoefficient) + return message + } /** * Creates a plain object from a Mechanical message. Also converts values to other types if specified. @@ -12292,28 +12013,36 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Mechanical.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.youngMod = 0; - object.poissonRatio = 0; - object.shearMod = 0; - object.density = 0; - object.dampingCoefficient = 0; + object.youngMod = 0 + object.poissonRatio = 0 + object.shearMod = 0 + object.density = 0 + object.dampingCoefficient = 0 } if (message.youngMod != null && message.hasOwnProperty("youngMod")) - object.youngMod = options.json && !isFinite(message.youngMod) ? String(message.youngMod) : message.youngMod; + object.youngMod = + options.json && !isFinite(message.youngMod) ? String(message.youngMod) : message.youngMod if (message.poissonRatio != null && message.hasOwnProperty("poissonRatio")) - object.poissonRatio = options.json && !isFinite(message.poissonRatio) ? String(message.poissonRatio) : message.poissonRatio; + object.poissonRatio = + options.json && !isFinite(message.poissonRatio) + ? String(message.poissonRatio) + : message.poissonRatio if (message.shearMod != null && message.hasOwnProperty("shearMod")) - object.shearMod = options.json && !isFinite(message.shearMod) ? String(message.shearMod) : message.shearMod; + object.shearMod = + options.json && !isFinite(message.shearMod) ? String(message.shearMod) : message.shearMod if (message.density != null && message.hasOwnProperty("density")) - object.density = options.json && !isFinite(message.density) ? String(message.density) : message.density; + object.density = + options.json && !isFinite(message.density) ? String(message.density) : message.density if (message.dampingCoefficient != null && message.hasOwnProperty("dampingCoefficient")) - object.dampingCoefficient = options.json && !isFinite(message.dampingCoefficient) ? String(message.dampingCoefficient) : message.dampingCoefficient; - return object; - }; + object.dampingCoefficient = + options.json && !isFinite(message.dampingCoefficient) + ? String(message.dampingCoefficient) + : message.dampingCoefficient + return object + } /** * Converts this Mechanical to JSON. @@ -12323,8 +12052,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Mechanical.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Mechanical @@ -12336,16 +12065,15 @@ export const mirabuf = $root.mirabuf = (() => { */ Mechanical.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.material.PhysicalMaterial.Mechanical"; - }; - - return Mechanical; - })(); + return typeUrlPrefix + "/mirabuf.material.PhysicalMaterial.Mechanical" + } - PhysicalMaterial.Strength = (function() { + return Mechanical + })() + PhysicalMaterial.Strength = (function () { /** * Properties of a Strength. * @memberof mirabuf.material.PhysicalMaterial @@ -12366,8 +12094,7 @@ export const mirabuf = $root.mirabuf = (() => { function Strength(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -12376,7 +12103,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Strength * @instance */ - Strength.prototype.yieldStrength = 0; + Strength.prototype.yieldStrength = 0 /** * MPa @@ -12384,7 +12111,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Strength * @instance */ - Strength.prototype.tensileStrength = 0; + Strength.prototype.tensileStrength = 0 /** * yes / no @@ -12392,7 +12119,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.material.PhysicalMaterial.Strength * @instance */ - Strength.prototype.thermalTreatment = false; + Strength.prototype.thermalTreatment = false /** * Creates a new Strength instance using the specified properties. @@ -12403,8 +12130,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.PhysicalMaterial.Strength} Strength instance */ Strength.create = function create(properties) { - return new Strength(properties); - }; + return new Strength(properties) + } /** * Encodes the specified Strength message. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Strength.verify|verify} messages. @@ -12416,16 +12143,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Strength.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.yieldStrength != null && Object.hasOwnProperty.call(message, "yieldStrength")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.yieldStrength); + writer.uint32(/* id 1, wireType 5 =*/ 13).float(message.yieldStrength) if (message.tensileStrength != null && Object.hasOwnProperty.call(message, "tensileStrength")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.tensileStrength); + writer.uint32(/* id 2, wireType 5 =*/ 21).float(message.tensileStrength) if (message.thermalTreatment != null && Object.hasOwnProperty.call(message, "thermalTreatment")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.thermalTreatment); - return writer; - }; + writer.uint32(/* id 3, wireType 0 =*/ 24).bool(message.thermalTreatment) + return writer + } /** * Encodes the specified Strength message, length delimited. Does not implicitly {@link mirabuf.material.PhysicalMaterial.Strength.verify|verify} messages. @@ -12437,8 +12163,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Strength.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Strength message from the specified reader or buffer. @@ -12452,31 +12178,31 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Strength.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.material.PhysicalMaterial.Strength(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.material.PhysicalMaterial.Strength() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.yieldStrength = reader.float(); - break; + case 1: { + message.yieldStrength = reader.float() + break } - case 2: { - message.tensileStrength = reader.float(); - break; + case 2: { + message.tensileStrength = reader.float() + break } - case 3: { - message.thermalTreatment = reader.bool(); - break; + case 3: { + message.thermalTreatment = reader.bool() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Strength message from the specified reader or buffer, length delimited. @@ -12489,10 +12215,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Strength.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Strength message. @@ -12503,19 +12228,15 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Strength.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.yieldStrength != null && message.hasOwnProperty("yieldStrength")) - if (typeof message.yieldStrength !== "number") - return "yieldStrength: number expected"; + if (typeof message.yieldStrength !== "number") return "yieldStrength: number expected" if (message.tensileStrength != null && message.hasOwnProperty("tensileStrength")) - if (typeof message.tensileStrength !== "number") - return "tensileStrength: number expected"; + if (typeof message.tensileStrength !== "number") return "tensileStrength: number expected" if (message.thermalTreatment != null && message.hasOwnProperty("thermalTreatment")) - if (typeof message.thermalTreatment !== "boolean") - return "thermalTreatment: boolean expected"; - return null; - }; + if (typeof message.thermalTreatment !== "boolean") return "thermalTreatment: boolean expected" + return null + } /** * Creates a Strength message from a plain object. Also converts values to their respective internal types. @@ -12526,17 +12247,13 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.material.PhysicalMaterial.Strength} Strength */ Strength.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.material.PhysicalMaterial.Strength) - return object; - let message = new $root.mirabuf.material.PhysicalMaterial.Strength(); - if (object.yieldStrength != null) - message.yieldStrength = Number(object.yieldStrength); - if (object.tensileStrength != null) - message.tensileStrength = Number(object.tensileStrength); - if (object.thermalTreatment != null) - message.thermalTreatment = Boolean(object.thermalTreatment); - return message; - }; + if (object instanceof $root.mirabuf.material.PhysicalMaterial.Strength) return object + let message = new $root.mirabuf.material.PhysicalMaterial.Strength() + if (object.yieldStrength != null) message.yieldStrength = Number(object.yieldStrength) + if (object.tensileStrength != null) message.tensileStrength = Number(object.tensileStrength) + if (object.thermalTreatment != null) message.thermalTreatment = Boolean(object.thermalTreatment) + return message + } /** * Creates a plain object from a Strength message. Also converts values to other types if specified. @@ -12548,22 +12265,27 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Strength.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.yieldStrength = 0; - object.tensileStrength = 0; - object.thermalTreatment = false; + object.yieldStrength = 0 + object.tensileStrength = 0 + object.thermalTreatment = false } if (message.yieldStrength != null && message.hasOwnProperty("yieldStrength")) - object.yieldStrength = options.json && !isFinite(message.yieldStrength) ? String(message.yieldStrength) : message.yieldStrength; + object.yieldStrength = + options.json && !isFinite(message.yieldStrength) + ? String(message.yieldStrength) + : message.yieldStrength if (message.tensileStrength != null && message.hasOwnProperty("tensileStrength")) - object.tensileStrength = options.json && !isFinite(message.tensileStrength) ? String(message.tensileStrength) : message.tensileStrength; + object.tensileStrength = + options.json && !isFinite(message.tensileStrength) + ? String(message.tensileStrength) + : message.tensileStrength if (message.thermalTreatment != null && message.hasOwnProperty("thermalTreatment")) - object.thermalTreatment = message.thermalTreatment; - return object; - }; + object.thermalTreatment = message.thermalTreatment + return object + } /** * Converts this Strength to JSON. @@ -12573,8 +12295,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Strength.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Strength @@ -12586,31 +12308,29 @@ export const mirabuf = $root.mirabuf = (() => { */ Strength.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.material.PhysicalMaterial.Strength"; - }; - - return Strength; - })(); + return typeUrlPrefix + "/mirabuf.material.PhysicalMaterial.Strength" + } - return PhysicalMaterial; - })(); + return Strength + })() - return material; - })(); + return PhysicalMaterial + })() - mirabuf.signal = (function() { + return material + })() + mirabuf.signal = (function () { /** * Namespace signal. * @memberof mirabuf * @namespace */ - const signal = {}; - - signal.Signals = (function() { + const signal = {} + signal.Signals = (function () { /** * Properties of a Signals. * @memberof mirabuf.signal @@ -12628,11 +12348,10 @@ export const mirabuf = $root.mirabuf = (() => { * @param {mirabuf.signal.ISignals=} [properties] Properties to set */ function Signals(properties) { - this.signalMap = {}; + this.signalMap = {} if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -12641,7 +12360,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.signal.Signals * @instance */ - Signals.prototype.info = null; + Signals.prototype.info = null /** * Contains a full collection of symbols @@ -12649,7 +12368,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.signal.Signals * @instance */ - Signals.prototype.signalMap = $util.emptyObject; + Signals.prototype.signalMap = $util.emptyObject /** * Creates a new Signals instance using the specified properties. @@ -12660,8 +12379,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.signal.Signals} Signals instance */ Signals.create = function create(properties) { - return new Signals(properties); - }; + return new Signals(properties) + } /** * Encodes the specified Signals message. Does not implicitly {@link mirabuf.signal.Signals.verify|verify} messages. @@ -12673,17 +12392,25 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Signals.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.signalMap != null && Object.hasOwnProperty.call(message, "signalMap")) for (let keys = Object.keys(message.signalMap), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.mirabuf.signal.Signal.encode(message.signalMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + writer + .uint32(/* id 2, wireType 2 =*/ 18) + .fork() + .uint32(/* id 1, wireType 2 =*/ 10) + .string(keys[i]) + $root.mirabuf.signal.Signal.encode( + message.signalMap[keys[i]], + writer.uint32(/* id 2, wireType 2 =*/ 18).fork() + ) + .ldelim() + .ldelim() } - return writer; - }; + return writer + } /** * Encodes the specified Signals message, length delimited. Does not implicitly {@link mirabuf.signal.Signals.verify|verify} messages. @@ -12695,8 +12422,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Signals.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Signals message from the specified reader or buffer. @@ -12710,46 +12437,47 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Signals.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.signal.Signals(), key, value; + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.signal.Signals(), + key, + value while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - if (message.signalMap === $util.emptyObject) - message.signalMap = {}; - let end2 = reader.uint32() + reader.pos; - key = ""; - value = null; + case 2: { + if (message.signalMap === $util.emptyObject) message.signalMap = {} + let end2 = reader.uint32() + reader.pos + key = "" + value = null while (reader.pos < end2) { - let tag2 = reader.uint32(); + let tag2 = reader.uint32() switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.mirabuf.signal.Signal.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: + key = reader.string() + break + case 2: + value = $root.mirabuf.signal.Signal.decode(reader, reader.uint32()) + break + default: + reader.skipType(tag2 & 7) + break } } - message.signalMap[key] = value; - break; + message.signalMap[key] = value + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Signals message from the specified reader or buffer, length delimited. @@ -12762,10 +12490,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Signals.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Signals message. @@ -12776,25 +12503,21 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Signals.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.signalMap != null && message.hasOwnProperty("signalMap")) { - if (!$util.isObject(message.signalMap)) - return "signalMap: object expected"; - let key = Object.keys(message.signalMap); + if (!$util.isObject(message.signalMap)) return "signalMap: object expected" + let key = Object.keys(message.signalMap) for (let i = 0; i < key.length; ++i) { - let error = $root.mirabuf.signal.Signal.verify(message.signalMap[key[i]]); - if (error) - return "signalMap." + error; + let error = $root.mirabuf.signal.Signal.verify(message.signalMap[key[i]]) + if (error) return "signalMap." + error } } - return null; - }; + return null + } /** * Creates a Signals message from a plain object. Also converts values to their respective internal types. @@ -12805,26 +12528,25 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.signal.Signals} Signals */ Signals.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.signal.Signals) - return object; - let message = new $root.mirabuf.signal.Signals(); + if (object instanceof $root.mirabuf.signal.Signals) return object + let message = new $root.mirabuf.signal.Signals() if (object.info != null) { if (typeof object.info !== "object") - throw TypeError(".mirabuf.signal.Signals.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + throw TypeError(".mirabuf.signal.Signals.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } if (object.signalMap) { if (typeof object.signalMap !== "object") - throw TypeError(".mirabuf.signal.Signals.signalMap: object expected"); - message.signalMap = {}; + throw TypeError(".mirabuf.signal.Signals.signalMap: object expected") + message.signalMap = {} for (let keys = Object.keys(object.signalMap), i = 0; i < keys.length; ++i) { if (typeof object.signalMap[keys[i]] !== "object") - throw TypeError(".mirabuf.signal.Signals.signalMap: object expected"); - message.signalMap[keys[i]] = $root.mirabuf.signal.Signal.fromObject(object.signalMap[keys[i]]); + throw TypeError(".mirabuf.signal.Signals.signalMap: object expected") + message.signalMap[keys[i]] = $root.mirabuf.signal.Signal.fromObject(object.signalMap[keys[i]]) } } - return message; - }; + return message + } /** * Creates a plain object from a Signals message. Also converts values to other types if specified. @@ -12836,23 +12558,23 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Signals.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.objects || options.defaults) - object.signalMap = {}; - if (options.defaults) - object.info = null; + if (!options) options = {} + let object = {} + if (options.objects || options.defaults) object.signalMap = {} + if (options.defaults) object.info = null if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); - let keys2; + object.info = $root.mirabuf.Info.toObject(message.info, options) + let keys2 if (message.signalMap && (keys2 = Object.keys(message.signalMap)).length) { - object.signalMap = {}; + object.signalMap = {} for (let j = 0; j < keys2.length; ++j) - object.signalMap[keys2[j]] = $root.mirabuf.signal.Signal.toObject(message.signalMap[keys2[j]], options); + object.signalMap[keys2[j]] = $root.mirabuf.signal.Signal.toObject( + message.signalMap[keys2[j]], + options + ) } - return object; - }; + return object + } /** * Converts this Signals to JSON. @@ -12862,8 +12584,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Signals.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Signals @@ -12875,13 +12597,13 @@ export const mirabuf = $root.mirabuf = (() => { */ Signals.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.signal.Signals"; - }; + return typeUrlPrefix + "/mirabuf.signal.Signals" + } - return Signals; - })(); + return Signals + })() /** * IOType is a way to specify Input or Output. @@ -12890,12 +12612,13 @@ export const mirabuf = $root.mirabuf = (() => { * @property {number} INPUT=0 Input Signal * @property {number} OUTPUT=1 Output Signal */ - signal.IOType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INPUT"] = 0; - values[valuesById[1] = "OUTPUT"] = 1; - return values; - })(); + signal.IOType = (function () { + const valuesById = {}, + values = Object.create(valuesById) + values[(valuesById[0] = "INPUT")] = 0 + values[(valuesById[1] = "OUTPUT")] = 1 + return values + })() /** * DeviceType needs to be a type of device that has a supported connection @@ -12909,19 +12632,19 @@ export const mirabuf = $root.mirabuf = (() => { * @property {number} CANBUS=4 CANBUS value * @property {number} CUSTOM=5 CUSTOM value */ - signal.DeviceType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PWM"] = 0; - values[valuesById[1] = "Digital"] = 1; - values[valuesById[2] = "Analog"] = 2; - values[valuesById[3] = "I2C"] = 3; - values[valuesById[4] = "CANBUS"] = 4; - values[valuesById[5] = "CUSTOM"] = 5; - return values; - })(); - - signal.Signal = (function() { + signal.DeviceType = (function () { + const valuesById = {}, + values = Object.create(valuesById) + values[(valuesById[0] = "PWM")] = 0 + values[(valuesById[1] = "Digital")] = 1 + values[(valuesById[2] = "Analog")] = 2 + values[(valuesById[3] = "I2C")] = 3 + values[(valuesById[4] = "CANBUS")] = 4 + values[(valuesById[5] = "CUSTOM")] = 5 + return values + })() + signal.Signal = (function () { /** * Properties of a Signal. * @memberof mirabuf.signal @@ -12937,7 +12660,7 @@ export const mirabuf = $root.mirabuf = (() => { * Constructs a new Signal. * @memberof mirabuf.signal * @classdesc Signal is a way to define a controlling signal. - * + * * TODO: Add Origin * TODO: Decide how this is linked to a exported object * @implements ISignal @@ -12947,8 +12670,7 @@ export const mirabuf = $root.mirabuf = (() => { function Signal(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]] } /** @@ -12957,7 +12679,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.signal.Signal * @instance */ - Signal.prototype.info = null; + Signal.prototype.info = null /** * Is this a Input or Output @@ -12965,7 +12687,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.signal.Signal * @instance */ - Signal.prototype.io = 0; + Signal.prototype.io = 0 /** * The name of a custom input type that is not listed as a device type @@ -12973,7 +12695,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.signal.Signal * @instance */ - Signal.prototype.customType = ""; + Signal.prototype.customType = "" /** * ID for a given signal that exists... PWM 2, CANBUS 4 @@ -12981,7 +12703,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.signal.Signal * @instance */ - Signal.prototype.signalId = 0; + Signal.prototype.signalId = 0 /** * Enum for device type that should always be set @@ -12989,7 +12711,7 @@ export const mirabuf = $root.mirabuf = (() => { * @memberof mirabuf.signal.Signal * @instance */ - Signal.prototype.deviceType = 0; + Signal.prototype.deviceType = 0 /** * Creates a new Signal instance using the specified properties. @@ -13000,8 +12722,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.signal.Signal} Signal instance */ Signal.create = function create(properties) { - return new Signal(properties); - }; + return new Signal(properties) + } /** * Encodes the specified Signal message. Does not implicitly {@link mirabuf.signal.Signal.verify|verify} messages. @@ -13013,20 +12735,19 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Signal.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); + if (!writer) writer = $Writer.create() if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.mirabuf.Info.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/ 10).fork()).ldelim() if (message.io != null && Object.hasOwnProperty.call(message, "io")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.io); + writer.uint32(/* id 2, wireType 0 =*/ 16).int32(message.io) if (message.customType != null && Object.hasOwnProperty.call(message, "customType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.customType); + writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.customType) if (message.signalId != null && Object.hasOwnProperty.call(message, "signalId")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.signalId); + writer.uint32(/* id 4, wireType 0 =*/ 32).uint32(message.signalId) if (message.deviceType != null && Object.hasOwnProperty.call(message, "deviceType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.deviceType); - return writer; - }; + writer.uint32(/* id 5, wireType 0 =*/ 40).int32(message.deviceType) + return writer + } /** * Encodes the specified Signal message, length delimited. Does not implicitly {@link mirabuf.signal.Signal.verify|verify} messages. @@ -13038,8 +12759,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {$protobuf.Writer} Writer */ Signal.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return this.encode(message, writer).ldelim() + } /** * Decodes a Signal message from the specified reader or buffer. @@ -13053,39 +12774,39 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Signal.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.mirabuf.signal.Signal(); + if (!(reader instanceof $Reader)) reader = $Reader.create(reader) + let end = length === undefined ? reader.len : reader.pos + length, + message = new $root.mirabuf.signal.Signal() while (reader.pos < end) { - let tag = reader.uint32(); + let tag = reader.uint32() switch (tag >>> 3) { - case 1: { - message.info = $root.mirabuf.Info.decode(reader, reader.uint32()); - break; + case 1: { + message.info = $root.mirabuf.Info.decode(reader, reader.uint32()) + break } - case 2: { - message.io = reader.int32(); - break; + case 2: { + message.io = reader.int32() + break } - case 3: { - message.customType = reader.string(); - break; + case 3: { + message.customType = reader.string() + break } - case 4: { - message.signalId = reader.uint32(); - break; + case 4: { + message.signalId = reader.uint32() + break } - case 5: { - message.deviceType = reader.int32(); - break; + case 5: { + message.deviceType = reader.int32() + break } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7) + break } } - return message; - }; + return message + } /** * Decodes a Signal message from the specified reader or buffer, length delimited. @@ -13098,10 +12819,9 @@ export const mirabuf = $root.mirabuf = (() => { * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Signal.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (!(reader instanceof $Reader)) reader = new $Reader(reader) + return this.decode(reader, reader.uint32()) + } /** * Verifies a Signal message. @@ -13112,41 +12832,37 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Signal.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; + if (typeof message !== "object" || message === null) return "object expected" if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.mirabuf.Info.verify(message.info); - if (error) - return "info." + error; + let error = $root.mirabuf.Info.verify(message.info) + if (error) return "info." + error } if (message.io != null && message.hasOwnProperty("io")) switch (message.io) { - default: - return "io: enum value expected"; - case 0: - case 1: - break; + default: + return "io: enum value expected" + case 0: + case 1: + break } if (message.customType != null && message.hasOwnProperty("customType")) - if (!$util.isString(message.customType)) - return "customType: string expected"; + if (!$util.isString(message.customType)) return "customType: string expected" if (message.signalId != null && message.hasOwnProperty("signalId")) - if (!$util.isInteger(message.signalId)) - return "signalId: integer expected"; + if (!$util.isInteger(message.signalId)) return "signalId: integer expected" if (message.deviceType != null && message.hasOwnProperty("deviceType")) switch (message.deviceType) { - default: - return "deviceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; + default: + return "deviceType: enum value expected" + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break } - return null; - }; + return null + } /** * Creates a Signal message from a plain object. Also converts values to their respective internal types. @@ -13157,68 +12873,64 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {mirabuf.signal.Signal} Signal */ Signal.fromObject = function fromObject(object) { - if (object instanceof $root.mirabuf.signal.Signal) - return object; - let message = new $root.mirabuf.signal.Signal(); + if (object instanceof $root.mirabuf.signal.Signal) return object + let message = new $root.mirabuf.signal.Signal() if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".mirabuf.signal.Signal.info: object expected"); - message.info = $root.mirabuf.Info.fromObject(object.info); + if (typeof object.info !== "object") throw TypeError(".mirabuf.signal.Signal.info: object expected") + message.info = $root.mirabuf.Info.fromObject(object.info) } switch (object.io) { - default: - if (typeof object.io === "number") { - message.io = object.io; - break; - } - break; - case "INPUT": - case 0: - message.io = 0; - break; - case "OUTPUT": - case 1: - message.io = 1; - break; - } - if (object.customType != null) - message.customType = String(object.customType); - if (object.signalId != null) - message.signalId = object.signalId >>> 0; + default: + if (typeof object.io === "number") { + message.io = object.io + break + } + break + case "INPUT": + case 0: + message.io = 0 + break + case "OUTPUT": + case 1: + message.io = 1 + break + } + if (object.customType != null) message.customType = String(object.customType) + if (object.signalId != null) message.signalId = object.signalId >>> 0 switch (object.deviceType) { - default: - if (typeof object.deviceType === "number") { - message.deviceType = object.deviceType; - break; - } - break; - case "PWM": - case 0: - message.deviceType = 0; - break; - case "Digital": - case 1: - message.deviceType = 1; - break; - case "Analog": - case 2: - message.deviceType = 2; - break; - case "I2C": - case 3: - message.deviceType = 3; - break; - case "CANBUS": - case 4: - message.deviceType = 4; - break; - case "CUSTOM": - case 5: - message.deviceType = 5; - break; - } - return message; - }; + default: + if (typeof object.deviceType === "number") { + message.deviceType = object.deviceType + break + } + break + case "PWM": + case 0: + message.deviceType = 0 + break + case "Digital": + case 1: + message.deviceType = 1 + break + case "Analog": + case 2: + message.deviceType = 2 + break + case "I2C": + case 3: + message.deviceType = 3 + break + case "CANBUS": + case 4: + message.deviceType = 4 + break + case "CUSTOM": + case 5: + message.deviceType = 5 + break + } + return message + } /** * Creates a plain object from a Signal message. Also converts values to other types if specified. @@ -13230,28 +12942,36 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} Plain object */ Signal.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; + if (!options) options = {} + let object = {} if (options.defaults) { - object.info = null; - object.io = options.enums === String ? "INPUT" : 0; - object.customType = ""; - object.signalId = 0; - object.deviceType = options.enums === String ? "PWM" : 0; + object.info = null + object.io = options.enums === String ? "INPUT" : 0 + object.customType = "" + object.signalId = 0 + object.deviceType = options.enums === String ? "PWM" : 0 } if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.mirabuf.Info.toObject(message.info, options); + object.info = $root.mirabuf.Info.toObject(message.info, options) if (message.io != null && message.hasOwnProperty("io")) - object.io = options.enums === String ? $root.mirabuf.signal.IOType[message.io] === undefined ? message.io : $root.mirabuf.signal.IOType[message.io] : message.io; + object.io = + options.enums === String + ? $root.mirabuf.signal.IOType[message.io] === undefined + ? message.io + : $root.mirabuf.signal.IOType[message.io] + : message.io if (message.customType != null && message.hasOwnProperty("customType")) - object.customType = message.customType; - if (message.signalId != null && message.hasOwnProperty("signalId")) - object.signalId = message.signalId; + object.customType = message.customType + if (message.signalId != null && message.hasOwnProperty("signalId")) object.signalId = message.signalId if (message.deviceType != null && message.hasOwnProperty("deviceType")) - object.deviceType = options.enums === String ? $root.mirabuf.signal.DeviceType[message.deviceType] === undefined ? message.deviceType : $root.mirabuf.signal.DeviceType[message.deviceType] : message.deviceType; - return object; - }; + object.deviceType = + options.enums === String + ? $root.mirabuf.signal.DeviceType[message.deviceType] === undefined + ? message.deviceType + : $root.mirabuf.signal.DeviceType[message.deviceType] + : message.deviceType + return object + } /** * Converts this Signal to JSON. @@ -13261,8 +12981,8 @@ export const mirabuf = $root.mirabuf = (() => { * @returns {Object.} JSON object */ Signal.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return this.constructor.toObject(this, $protobuf.util.toJSONOptions) + } /** * Gets the default type url for Signal @@ -13274,18 +12994,18 @@ export const mirabuf = $root.mirabuf = (() => { */ Signal.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + typeUrlPrefix = "type.googleapis.com" } - return typeUrlPrefix + "/mirabuf.signal.Signal"; - }; + return typeUrlPrefix + "/mirabuf.signal.Signal" + } - return Signal; - })(); + return Signal + })() - return signal; - })(); + return signal + })() - return mirabuf; -})(); + return mirabuf +})()) -export { $root as default }; +export { $root as default } diff --git a/fission/src/samples/JoltExample.tsx b/fission/src/samples/JoltExample.tsx index 130f4562e2..13a3c3a10e 100644 --- a/fission/src/samples/JoltExample.tsx +++ b/fission/src/samples/JoltExample.tsx @@ -2,113 +2,112 @@ * This example will be used to showcase how Jolt physics works. */ -import * as THREE from 'three'; -import Stats from 'stats.js'; -import JOLT from '../util/loading/JoltSyncLoader.ts'; -import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; +import * as THREE from "three" +import Stats from "stats.js" +import JOLT from "../util/loading/JoltSyncLoader.ts" +import { OrbitControls } from "three/addons/controls/OrbitControls.js" -import { useEffect, useRef } from 'react'; -import Jolt from '@barclah/jolt-physics'; +import { useEffect, useRef } from "react" +import Jolt from "@barclah/jolt-physics" import { mirabuf } from "../proto/mirabuf" -import { LoadMirabufRemote } from '../mirabuf/MirabufLoader.ts'; -import { JoltVec3_ThreeVector3, JoltQuat_ThreeQuaternion } from '../util/TypeConversions.ts'; -import { COUNT_OBJECT_LAYERS, LAYER_MOVING, LAYER_NOT_MOVING } from '../util/threejs/MeshCreation.ts'; -import MirabufInstance from '../mirabuf/MirabufInstance.ts'; -import MirabufParser, { ParseErrorSeverity } from '../mirabuf/MirabufParser.ts'; +import { LoadMirabufRemote } from "../mirabuf/MirabufLoader.ts" +import { JoltVec3_ThreeVector3, JoltQuat_ThreeQuaternion } from "../util/TypeConversions.ts" +import { COUNT_OBJECT_LAYERS, LAYER_MOVING, LAYER_NOT_MOVING } from "../util/threejs/MeshCreation.ts" +import MirabufInstance from "../mirabuf/MirabufInstance.ts" +import MirabufParser, { ParseErrorSeverity } from "../mirabuf/MirabufParser.ts" -const clock = new THREE.Clock(); -let time = 0; +const clock = new THREE.Clock() +let time = 0 -let stats: Stats; +let stats: Stats -let renderer: THREE.WebGLRenderer; -let camera: THREE.PerspectiveCamera; -let scene: THREE.Scene; +let renderer: THREE.WebGLRenderer +let camera: THREE.PerspectiveCamera +let scene: THREE.Scene -let joltInterface: Jolt.JoltInterface; +let joltInterface: Jolt.JoltInterface // let physicsSystem: Jolt.PhysicsSystem; // let bodyInterface: Jolt.BodyInterface; -const dynamicObjects: THREE.Mesh[] = []; +const dynamicObjects: THREE.Mesh[] = [] const MIRA_FILE = "test_mira/Team_2471_(2018)_v7.mira" // const MIRA_FILE = "test_mira/Dozer_v2.mira" -let controls: OrbitControls; - +let controls: OrbitControls // vvv Below are the functions required to initialize everything and draw a basic floor with collisions. vvv function setupCollisionFiltering(settings: Jolt.JoltSettings) { - const objectFilter = new JOLT.ObjectLayerPairFilterTable(COUNT_OBJECT_LAYERS); - objectFilter.EnableCollision(LAYER_NOT_MOVING, LAYER_MOVING); - objectFilter.EnableCollision(LAYER_MOVING, LAYER_MOVING); - - const BP_LAYER_NOT_MOVING = new JOLT.BroadPhaseLayer(LAYER_NOT_MOVING); - const BP_LAYER_MOVING = new JOLT.BroadPhaseLayer(LAYER_MOVING); - const COUNT_BROAD_PHASE_LAYERS = 2; - - const bpInterface = new JOLT.BroadPhaseLayerInterfaceTable(COUNT_OBJECT_LAYERS, COUNT_BROAD_PHASE_LAYERS); - bpInterface.MapObjectToBroadPhaseLayer(LAYER_NOT_MOVING, BP_LAYER_NOT_MOVING); - bpInterface.MapObjectToBroadPhaseLayer(LAYER_MOVING, BP_LAYER_MOVING); - - settings.mObjectLayerPairFilter = objectFilter; - settings.mBroadPhaseLayerInterface = bpInterface; - settings.mObjectVsBroadPhaseLayerFilter = new JOLT.ObjectVsBroadPhaseLayerFilterTable(settings.mBroadPhaseLayerInterface, COUNT_BROAD_PHASE_LAYERS, settings.mObjectLayerPairFilter, COUNT_OBJECT_LAYERS); + const objectFilter = new JOLT.ObjectLayerPairFilterTable(COUNT_OBJECT_LAYERS) + objectFilter.EnableCollision(LAYER_NOT_MOVING, LAYER_MOVING) + objectFilter.EnableCollision(LAYER_MOVING, LAYER_MOVING) + + const BP_LAYER_NOT_MOVING = new JOLT.BroadPhaseLayer(LAYER_NOT_MOVING) + const BP_LAYER_MOVING = new JOLT.BroadPhaseLayer(LAYER_MOVING) + const COUNT_BROAD_PHASE_LAYERS = 2 + + const bpInterface = new JOLT.BroadPhaseLayerInterfaceTable(COUNT_OBJECT_LAYERS, COUNT_BROAD_PHASE_LAYERS) + bpInterface.MapObjectToBroadPhaseLayer(LAYER_NOT_MOVING, BP_LAYER_NOT_MOVING) + bpInterface.MapObjectToBroadPhaseLayer(LAYER_MOVING, BP_LAYER_MOVING) + + settings.mObjectLayerPairFilter = objectFilter + settings.mBroadPhaseLayerInterface = bpInterface + settings.mObjectVsBroadPhaseLayerFilter = new JOLT.ObjectVsBroadPhaseLayerFilterTable( + settings.mBroadPhaseLayerInterface, + COUNT_BROAD_PHASE_LAYERS, + settings.mObjectLayerPairFilter, + COUNT_OBJECT_LAYERS + ) } function initPhysics() { - const settings = new JOLT.JoltSettings(); - setupCollisionFiltering(settings); - joltInterface = new JOLT.JoltInterface(settings); - JOLT.destroy(settings); + const settings = new JOLT.JoltSettings() + setupCollisionFiltering(settings) + joltInterface = new JOLT.JoltInterface(settings) + JOLT.destroy(settings) // physicsSystem = joltInterface.GetPhysicsSystem(); // bodyInterface = physicsSystem.GetBodyInterface(); } function initGraphics() { - camera = new THREE.PerspectiveCamera( - 75, - window.innerWidth / window.innerHeight, - 0.1, - 1000 - ); - - camera.position.set(-5, 4, 5); - - scene = new THREE.Scene(); - - renderer = new THREE.WebGLRenderer(); - renderer.setClearColor(0x121212); - renderer.setPixelRatio(window.devicePixelRatio); - renderer.shadowMap.enabled = true; - renderer.shadowMap.type = THREE.PCFSoftShadowMap; - renderer.setSize(window.innerWidth, window.innerHeight); - - controls = new OrbitControls(camera, renderer.domElement); - controls.update(); - - const directionalLight = new THREE.DirectionalLight(0xffffff, 3.0); - directionalLight.position.set(-1.0, 3.0, 2.0); - directionalLight.castShadow = true; - scene.add(directionalLight); - - const shadowMapSize = Math.min(4096, renderer.capabilities.maxTextureSize); - const shadowCamSize = 15; - console.debug(`Shadow Map Size: ${shadowMapSize}`); - - directionalLight.shadow.camera.top = shadowCamSize; - directionalLight.shadow.camera.bottom = -shadowCamSize; - directionalLight.shadow.camera.left = -shadowCamSize; - directionalLight.shadow.camera.right = shadowCamSize; - directionalLight.shadow.mapSize = new THREE.Vector2(shadowMapSize, shadowMapSize); - directionalLight.shadow.blurSamples = 16; - directionalLight.shadow.normalBias = 0.01; - directionalLight.shadow.bias = 0.00; - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.1); - scene.add(ambientLight); + camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000) + + camera.position.set(-5, 4, 5) + + scene = new THREE.Scene() + + renderer = new THREE.WebGLRenderer() + renderer.setClearColor(0x121212) + renderer.setPixelRatio(window.devicePixelRatio) + renderer.shadowMap.enabled = true + renderer.shadowMap.type = THREE.PCFSoftShadowMap + renderer.setSize(window.innerWidth, window.innerHeight) + + controls = new OrbitControls(camera, renderer.domElement) + controls.update() + + const directionalLight = new THREE.DirectionalLight(0xffffff, 3.0) + directionalLight.position.set(-1.0, 3.0, 2.0) + directionalLight.castShadow = true + scene.add(directionalLight) + + const shadowMapSize = Math.min(4096, renderer.capabilities.maxTextureSize) + const shadowCamSize = 15 + console.debug(`Shadow Map Size: ${shadowMapSize}`) + + directionalLight.shadow.camera.top = shadowCamSize + directionalLight.shadow.camera.bottom = -shadowCamSize + directionalLight.shadow.camera.left = -shadowCamSize + directionalLight.shadow.camera.right = shadowCamSize + directionalLight.shadow.mapSize = new THREE.Vector2(shadowMapSize, shadowMapSize) + directionalLight.shadow.blurSamples = 16 + directionalLight.shadow.normalBias = 0.01 + directionalLight.shadow.bias = 0.0 + + const ambientLight = new THREE.AmbientLight(0xffffff, 0.1) + scene.add(ambientLight) // TODO: Add controls. @@ -117,101 +116,99 @@ function initGraphics() { function updatePhysics(deltaTime: number) { // If below 55hz run 2 steps. Otherwise things run very slow. - const numSteps = deltaTime > 1.0 / 55.0 ? 2 : 1; - joltInterface.Step(deltaTime, numSteps); + const numSteps = deltaTime > 1.0 / 55.0 ? 2 : 1 + joltInterface.Step(deltaTime, numSteps) } function render() { - stats.update(); - requestAnimationFrame(render); - controls.update(); + stats.update() + requestAnimationFrame(render) + controls.update() // Prevents a problem when rendering at 30hz. Referred to as the spiral of death. - let deltaTime = clock.getDelta(); - deltaTime = Math.min(deltaTime, 1.0 / 30.0); + let deltaTime = clock.getDelta() + deltaTime = Math.min(deltaTime, 1.0 / 30.0) // Update transforms. for (let i = 0, j = dynamicObjects.length; i < j; i++) { - const threeObj = dynamicObjects[i]; - const body = threeObj.userData.body; - threeObj.position.copy(JoltVec3_ThreeVector3(body.GetPosition())); - threeObj.quaternion.copy(JoltQuat_ThreeQuaternion(body.GetRotation())); + const threeObj = dynamicObjects[i] + const body = threeObj.userData.body + threeObj.position.copy(JoltVec3_ThreeVector3(body.GetPosition())) + threeObj.quaternion.copy(JoltQuat_ThreeQuaternion(body.GetRotation())) if (body.GetBodyType() === JOLT.EBodyType_SoftBody) { // TODO: Special soft body handle. } } - time += deltaTime; - updatePhysics(1.0 / 60.0); + time += deltaTime + updatePhysics(1.0 / 60.0) // controls.update(deltaTime); // TODO: Add controls? - renderer.render(scene, camera); + renderer.render(scene, camera) } function MyThree() { - console.log("Running..."); + console.log("Running...") - const refContainer = useRef(null); - const urlParams = new URLSearchParams(document.location.search); - let mira_path = MIRA_FILE; + const refContainer = useRef(null) + const urlParams = new URLSearchParams(document.location.search) + let mira_path = MIRA_FILE - urlParams.forEach((v, k) => console.debug(`${k}: ${v}`)); + urlParams.forEach((v, k) => console.debug(`${k}: ${v}`)) if (urlParams.has("mira")) { - mira_path = `test_mira/${urlParams.get("mira")!}`; - console.debug(`Selected Mirabuf File: ${mira_path}`); + mira_path = `test_mira/${urlParams.get("mira")!}` + console.debug(`Selected Mirabuf File: ${mira_path}`) } console.log(urlParams) const addMiraToScene = (assembly: mirabuf.Assembly | undefined) => { if (!assembly) { - console.error('Assembly is undefined'); - return; + console.error("Assembly is undefined") + return } - const parser = new MirabufParser(assembly); + const parser = new MirabufParser(assembly) if (parser.maxErrorSeverity >= ParseErrorSeverity.Unimportable) { - console.error(`Assembly Parser produced significant errors for '${assembly.info!.name!}'`); - return; + console.error(`Assembly Parser produced significant errors for '${assembly.info!.name!}'`) + return } - - const instance = new MirabufInstance(parser); - instance.AddToScene(scene); + + const instance = new MirabufInstance(parser) + instance.AddToScene(scene) } useEffect(() => { LoadMirabufRemote(mira_path) - .then( - (assembly: mirabuf.Assembly | undefined) => addMiraToScene(assembly) - ).catch( - _ => LoadMirabufRemote(MIRA_FILE).then( - (assembly: mirabuf.Assembly | undefined) => addMiraToScene(assembly) - ) - ).catch(console.error); - - initGraphics(); - + .then((assembly: mirabuf.Assembly | undefined) => addMiraToScene(assembly)) + .catch(_ => + LoadMirabufRemote(MIRA_FILE).then((assembly: mirabuf.Assembly | undefined) => addMiraToScene(assembly)) + ) + .catch(console.error) + + initGraphics() + if (refContainer.current) { - refContainer.current.innerHTML = ""; + refContainer.current.innerHTML = "" refContainer.current.appendChild(renderer.domElement) - stats = new Stats(); - stats.dom.style.position = 'absolute'; - stats.dom.style.top = '0px'; - refContainer.current.appendChild(stats.dom); + stats = new Stats() + stats.dom.style.position = "absolute" + stats.dom.style.top = "0px" + refContainer.current.appendChild(stats.dom) } - initPhysics(); - render(); + initPhysics() + render() // createFloor(); - }, []); + }, []) return (
- ); + ) } -export default MyThree; +export default MyThree diff --git a/fission/src/systems/World.ts b/fission/src/systems/World.ts index 4b25755a52..3619788f31 100644 --- a/fission/src/systems/World.ts +++ b/fission/src/systems/World.ts @@ -1,53 +1,58 @@ -import * as THREE from "three"; +import * as THREE from "three" -import PhysicsSystem from "./physics/PhysicsSystem"; -import SceneRenderer from "./scene/SceneRenderer"; -import SimulationSystem from "./simulation/SimulationSystem"; +import PhysicsSystem from "./physics/PhysicsSystem" +import SceneRenderer from "./scene/SceneRenderer" +import SimulationSystem from "./simulation/SimulationSystem" class World { + private static _isAlive: boolean = false + private static _clock: THREE.Clock + + private static _sceneRenderer: SceneRenderer + private static _physicsSystem: PhysicsSystem + private static _simulationSystem: SimulationSystem + + public static get isAlive() { + return World._isAlive + } + + public static get SceneRenderer() { + return World._sceneRenderer + } + public static get PhysicsSystem() { + return World._physicsSystem + } + public static get SimulationSystem() { + return World._simulationSystem + } - private static _isAlive: boolean = false; - private static _clock: THREE.Clock; - - private static _sceneRenderer: SceneRenderer; - private static _physicsSystem: PhysicsSystem; - private static _simulationSystem: SimulationSystem; - - public static get isAlive() { return World._isAlive; } - - public static get SceneRenderer() { return World._sceneRenderer; } - public static get PhysicsSystem() { return World._physicsSystem; } - public static get SimulationSystem() { return World._simulationSystem; } - public static InitWorld() { - if (World._isAlive) - return; + if (World._isAlive) return - World._clock = new THREE.Clock(); - World._isAlive = true; + World._clock = new THREE.Clock() + World._isAlive = true - World._sceneRenderer = new SceneRenderer(); - World._physicsSystem = new PhysicsSystem(); - World._simulationSystem = new SimulationSystem(); + World._sceneRenderer = new SceneRenderer() + World._physicsSystem = new PhysicsSystem() + World._simulationSystem = new SimulationSystem() } public static DestroyWorld() { - if (!World._isAlive) - return; + if (!World._isAlive) return - World._isAlive = false; + World._isAlive = false - World._physicsSystem.Destroy(); - World._sceneRenderer.Destroy(); - World._simulationSystem.Destroy(); + World._physicsSystem.Destroy() + World._sceneRenderer.Destroy() + World._simulationSystem.Destroy() } public static UpdateWorld() { - const deltaT = World._clock.getDelta(); - World._simulationSystem.Update(deltaT); - World._physicsSystem.Update(deltaT); - World._sceneRenderer.Update(deltaT); + const deltaT = World._clock.getDelta() + World._simulationSystem.Update(deltaT) + World._physicsSystem.Update(deltaT) + World._sceneRenderer.Update(deltaT) } } -export default World; \ No newline at end of file +export default World diff --git a/fission/src/systems/WorldSystem.ts b/fission/src/systems/WorldSystem.ts index f45891980c..7da09611b2 100644 --- a/fission/src/systems/WorldSystem.ts +++ b/fission/src/systems/WorldSystem.ts @@ -1,5 +1,5 @@ abstract class WorldSystem { - public abstract Update(deltaT: number): void; - public abstract Destroy(): void; + public abstract Update(deltaT: number): void + public abstract Destroy(): void } -export default WorldSystem; \ No newline at end of file +export default WorldSystem diff --git a/fission/src/systems/physics/Mechanism.ts b/fission/src/systems/physics/Mechanism.ts index 1aaa31cfec..0761203f4c 100644 --- a/fission/src/systems/physics/Mechanism.ts +++ b/fission/src/systems/physics/Mechanism.ts @@ -1,29 +1,29 @@ -import Jolt from "@barclah/jolt-physics"; -import { LayerReserve } from "./PhysicsSystem"; +import Jolt from "@barclah/jolt-physics" +import { LayerReserve } from "./PhysicsSystem" export interface MechanismConstraint { - parentBody: Jolt.BodyID, - childBody: Jolt.BodyID, + parentBody: Jolt.BodyID + childBody: Jolt.BodyID constraint: Jolt.Constraint } class Mechanism { - public rootBody: string; - public nodeToBody: Map; - public constraints: Array; - public stepListeners: Array; - public layerReserve: LayerReserve | undefined; + public rootBody: string + public nodeToBody: Map + public constraints: Array + public stepListeners: Array + public layerReserve: LayerReserve | undefined public constructor(rootBody: string, bodyMap: Map, layerReserve?: LayerReserve) { - this.rootBody = rootBody; - this.nodeToBody = bodyMap; - this.constraints = []; - this.stepListeners = []; - this.layerReserve = layerReserve; + this.rootBody = rootBody + this.nodeToBody = bodyMap + this.constraints = [] + this.stepListeners = [] + this.layerReserve = layerReserve } public AddConstraint(mechConstraint: MechanismConstraint) { - this.constraints.push(mechConstraint); + this.constraints.push(mechConstraint) } public AddStepListener(listener: Jolt.PhysicsStepListener) { @@ -31,8 +31,8 @@ class Mechanism { } public GetBodyByNodeId(nodeId: string) { - return this.nodeToBody.get(nodeId); + return this.nodeToBody.get(nodeId) } } -export default Mechanism; \ No newline at end of file +export default Mechanism diff --git a/fission/src/systems/physics/PhysicsSystem.ts b/fission/src/systems/physics/PhysicsSystem.ts index d6d8256385..3a0f164f5a 100644 --- a/fission/src/systems/physics/PhysicsSystem.ts +++ b/fission/src/systems/physics/PhysicsSystem.ts @@ -1,26 +1,34 @@ -import { MirabufFloatArr_JoltVec3, MirabufVector3_JoltVec3, ThreeMatrix4_JoltMat44, ThreeVector3_JoltVec3, _JoltQuat } from "../../util/TypeConversions"; -import JOLT from "../../util/loading/JoltSyncLoader"; -import Jolt from "@barclah/jolt-physics"; -import * as THREE from 'three'; -import { mirabuf } from '../../proto/mirabuf'; -import MirabufParser, { GAMEPIECE_SUFFIX, GROUNDED_JOINT_ID, RigidNodeReadOnly } from "../../mirabuf/MirabufParser"; -import WorldSystem from "../WorldSystem"; -import Mechanism from "./Mechanism"; +import { + MirabufFloatArr_JoltVec3, + MirabufVector3_JoltVec3, + ThreeMatrix4_JoltMat44, + ThreeVector3_JoltVec3, + _JoltQuat, +} from "../../util/TypeConversions" +import JOLT from "../../util/loading/JoltSyncLoader" +import Jolt from "@barclah/jolt-physics" +import * as THREE from "three" +import { mirabuf } from "../../proto/mirabuf" +import MirabufParser, { GAMEPIECE_SUFFIX, GROUNDED_JOINT_ID, RigidNodeReadOnly } from "../../mirabuf/MirabufParser" +import WorldSystem from "../WorldSystem" +import Mechanism from "./Mechanism" /** * Layers used for determining enabled/disabled collisions. */ -const LAYER_FIELD = 0; // Used for grounded rigid node of a field as well as any rigid nodes jointed to it. -const LAYER_GENERAL_DYNAMIC = 1; // Used for game pieces or any general dynamic objects that can collide with anything and everything. -const RobotLayers: number[] = [ // Reserved layers for robots. Robot layers have no collision with themselves but have collision with everything else. - 2, 3, 4, 5, 6, 7, 8, 9 -]; +const LAYER_FIELD = 0 // Used for grounded rigid node of a field as well as any rigid nodes jointed to it. +const LAYER_GENERAL_DYNAMIC = 1 // Used for game pieces or any general dynamic objects that can collide with anything and everything. +const RobotLayers: number[] = [ + // Reserved layers for robots. Robot layers have no collision with themselves but have collision with everything else. + 2, + 3, 4, 5, 6, 7, 8, 9, +] // Please update this accordingly. -const COUNT_OBJECT_LAYERS = 10; +const COUNT_OBJECT_LAYERS = 10 -export const SIMULATION_PERIOD = 1.0 / 120.0; -const STANDARD_SUB_STEPS = 3; +export const SIMULATION_PERIOD = 1.0 / 120.0 +const STANDARD_SUB_STEPS = 3 /** * The PhysicsSystem handles all Jolt Phyiscs interactions within Synthesis. @@ -28,41 +36,45 @@ const STANDARD_SUB_STEPS = 3; * Fields, and Game pieces, and simulate them. */ class PhysicsSystem extends WorldSystem { - - private _joltInterface: Jolt.JoltInterface; - private _joltPhysSystem: Jolt.PhysicsSystem; - private _joltBodyInterface: Jolt.BodyInterface; - private _bodies: Array; + private _joltInterface: Jolt.JoltInterface + private _joltPhysSystem: Jolt.PhysicsSystem + private _joltBodyInterface: Jolt.BodyInterface + private _bodies: Array private _constraints: Array /** * Creates a PhysicsSystem object. */ constructor() { - super(); + super() - this._bodies = []; - this._constraints = []; + this._bodies = [] + this._constraints = [] - const joltSettings = new JOLT.JoltSettings(); - SetupCollisionFiltering(joltSettings); + const joltSettings = new JOLT.JoltSettings() + SetupCollisionFiltering(joltSettings) - this._joltInterface = new JOLT.JoltInterface(joltSettings); - JOLT.destroy(joltSettings); + this._joltInterface = new JOLT.JoltInterface(joltSettings) + JOLT.destroy(joltSettings) - this._joltPhysSystem = this._joltInterface.GetPhysicsSystem(); - this._joltBodyInterface = this._joltPhysSystem.GetBodyInterface(); + this._joltPhysSystem = this._joltInterface.GetPhysicsSystem() + this._joltBodyInterface = this._joltPhysSystem.GetBodyInterface() - this._joltPhysSystem.SetGravity(new JOLT.Vec3(0, -9.8, 0)); + this._joltPhysSystem.SetGravity(new JOLT.Vec3(0, -9.8, 0)) - const ground = this.CreateBox(new THREE.Vector3(5.0, 0.5, 5.0), undefined, new THREE.Vector3(0.0, -2.0, 0.0), undefined); - this._joltBodyInterface.AddBody(ground.GetID(), JOLT.EActivation_Activate); + const ground = this.CreateBox( + new THREE.Vector3(5.0, 0.5, 5.0), + undefined, + new THREE.Vector3(0.0, -2.0, 0.0), + undefined + ) + this._joltBodyInterface.AddBody(ground.GetID(), JOLT.EActivation_Activate) } /** * TEMPORARY * Create a box. - * + * * @param halfExtents The half extents of the Box. * @param mass Mass of the Box. Leave undefined to make Box static. * @param position Posiition of the Box (default: 0, 0, 0) @@ -70,38 +82,39 @@ class PhysicsSystem extends WorldSystem { * @returns Reference to Jolt Body */ public CreateBox( - halfExtents: THREE.Vector3, - mass: number | undefined, - position: THREE.Vector3 | undefined, - rotation: THREE.Euler | THREE.Quaternion | undefined) { - const size = ThreeVector3_JoltVec3(halfExtents); - const shape = new JOLT.BoxShape(size, 0.1); - JOLT.destroy(size); - - const pos = position ? ThreeVector3_JoltVec3(position) : new JOLT.Vec3(0.0, 0.0, 0.0); - const rot = _JoltQuat(rotation); + halfExtents: THREE.Vector3, + mass: number | undefined, + position: THREE.Vector3 | undefined, + rotation: THREE.Euler | THREE.Quaternion | undefined + ) { + const size = ThreeVector3_JoltVec3(halfExtents) + const shape = new JOLT.BoxShape(size, 0.1) + JOLT.destroy(size) + + const pos = position ? ThreeVector3_JoltVec3(position) : new JOLT.Vec3(0.0, 0.0, 0.0) + const rot = _JoltQuat(rotation) const creationSettings = new JOLT.BodyCreationSettings( shape, pos, rot, mass ? JOLT.EMotionType_Dynamic : JOLT.EMotionType_Static, mass ? LAYER_GENERAL_DYNAMIC : LAYER_FIELD - ); + ) if (mass) { - creationSettings.mMassPropertiesOverride.mMass = mass; + creationSettings.mMassPropertiesOverride.mMass = mass } - const body = this._joltBodyInterface.CreateBody(creationSettings); - JOLT.destroy(pos); - JOLT.destroy(rot); - JOLT.destroy(creationSettings); + const body = this._joltBodyInterface.CreateBody(creationSettings) + JOLT.destroy(pos) + JOLT.destroy(rot) + JOLT.destroy(creationSettings) - this._bodies.push(body.GetID()); - return body; + this._bodies.push(body.GetID()) + return body } /** * This creates a body in Jolt. Mostly used for Unit test validation. - * + * * @param shape Shape to impart on the body. * @param mass Mass of the body. * @param position Position of the body. @@ -109,127 +122,152 @@ class PhysicsSystem extends WorldSystem { * @returns Resulting Body object. */ public CreateBody( - shape: Jolt.Shape, - mass: number | undefined, - position: THREE.Vector3 | undefined, - rotation: THREE.Euler | THREE.Quaternion | undefined) { - const pos = position ? ThreeVector3_JoltVec3(position) : new JOLT.Vec3(0.0, 0.0, 0.0); - const rot = _JoltQuat(rotation); + shape: Jolt.Shape, + mass: number | undefined, + position: THREE.Vector3 | undefined, + rotation: THREE.Euler | THREE.Quaternion | undefined + ) { + const pos = position ? ThreeVector3_JoltVec3(position) : new JOLT.Vec3(0.0, 0.0, 0.0) + const rot = _JoltQuat(rotation) const creationSettings = new JOLT.BodyCreationSettings( shape, pos, rot, mass ? JOLT.EMotionType_Dynamic : JOLT.EMotionType_Static, mass ? LAYER_GENERAL_DYNAMIC : LAYER_FIELD - ); + ) if (mass) { - creationSettings.mMassPropertiesOverride.mMass = mass; + creationSettings.mMassPropertiesOverride.mMass = mass } - const body = this._joltBodyInterface.CreateBody(creationSettings); - JOLT.destroy(pos); - JOLT.destroy(rot); - JOLT.destroy(creationSettings); + const body = this._joltBodyInterface.CreateBody(creationSettings) + JOLT.destroy(pos) + JOLT.destroy(rot) + JOLT.destroy(creationSettings) - this._bodies.push(body.GetID()); - return body; + this._bodies.push(body.GetID()) + return body } /** * Utility function for creating convex hulls. Mostly used for Unit test validation. - * + * * @param points Flat pack array of vector 3 components. * @param density Density of the convex hull. * @returns Resulting shape. */ public CreateConvexHull(points: Float32Array, density: number = 1.0): Jolt.ShapeResult { if (points.length % 3) { - throw new Error(`Invalid size of points: ${points.length}`); + throw new Error(`Invalid size of points: ${points.length}`) } - const settings = new JOLT.ConvexHullShapeSettings(); - settings.mPoints.clear(); - settings.mPoints.reserve(points.length / 3.0); + const settings = new JOLT.ConvexHullShapeSettings() + settings.mPoints.clear() + settings.mPoints.reserve(points.length / 3.0) for (let i = 0; i < points.length; i += 3) { - settings.mPoints.push_back(new JOLT.Vec3(points[i], points[i + 1], points[i + 2])); + settings.mPoints.push_back(new JOLT.Vec3(points[i], points[i + 1], points[i + 2])) } - settings.mDensity = density; - return settings.Create(); + settings.mDensity = density + return settings.Create() } public CreateMechanismFromParser(parser: MirabufParser): Mechanism { - const layer = parser.assembly.dynamic ? new LayerReserve() : undefined; + const layer = parser.assembly.dynamic ? new LayerReserve() : undefined // const layer = undefined; console.log(`Using layer ${layer?.layer}`) - const bodyMap = this.CreateBodiesFromParser(parser, layer); - const rootBody = parser.rootNode; - const mechanism = new Mechanism(rootBody, bodyMap, layer); - this.CreateJointsFromParser(parser, mechanism); - return mechanism; + const bodyMap = this.CreateBodiesFromParser(parser, layer) + const rootBody = parser.rootNode + const mechanism = new Mechanism(rootBody, bodyMap, layer) + this.CreateJointsFromParser(parser, mechanism) + return mechanism } /** * Creates all the joints for a mirabuf assembly given an already compiled mapping of rigid nodes to bodies. - * + * * @param parser Mirabuf parser with complete set of rigid nodes and assembly data. * @param mechainsm Mapping of the name of rigid groups to Jolt bodies. Retrieved from CreateBodiesFromParser. */ public CreateJointsFromParser(parser: MirabufParser, mechanism: Mechanism) { - const jointData = parser.assembly.data!.joints!; - for (const [jGuid, jInst] of (Object.entries(jointData.jointInstances!) as [string, mirabuf.joint.JointInstance][])) { - if (jGuid == GROUNDED_JOINT_ID) - continue; + const jointData = parser.assembly.data!.joints! + for (const [jGuid, jInst] of Object.entries(jointData.jointInstances!) as [ + string, + mirabuf.joint.JointInstance, + ][]) { + if (jGuid == GROUNDED_JOINT_ID) continue - const rnA = parser.partToNodeMap.get(jInst.parentPart!); - const rnB = parser.partToNodeMap.get(jInst.childPart!); + const rnA = parser.partToNodeMap.get(jInst.parentPart!) + const rnB = parser.partToNodeMap.get(jInst.childPart!) if (!rnA || !rnB) { - console.warn(`Skipping joint '${jInst.info!.name!}'. Couldn't find associated rigid nodes.`); - continue; + console.warn(`Skipping joint '${jInst.info!.name!}'. Couldn't find associated rigid nodes.`) + continue } else if (rnA.id == rnB.id) { - console.warn(`Skipping joint '${jInst.info!.name!}'. Jointing the same parts. Likely in issue with Fusion Design structure.`); - continue; + console.warn( + `Skipping joint '${jInst.info!.name!}'. Jointing the same parts. Likely in issue with Fusion Design structure.` + ) + continue } - const jDef = parser.assembly.data!.joints!.jointDefinitions![jInst.jointReference!]! as mirabuf.joint.Joint; - const bodyIdA = mechanism.GetBodyByNodeId(rnA.id); - const bodyIdB = mechanism.GetBodyByNodeId(rnB.id); + const jDef = parser.assembly.data!.joints!.jointDefinitions![jInst.jointReference!]! as mirabuf.joint.Joint + const bodyIdA = mechanism.GetBodyByNodeId(rnA.id) + const bodyIdB = mechanism.GetBodyByNodeId(rnB.id) if (!bodyIdA || !bodyIdB) { - console.warn(`Skipping joint '${jInst.info!.name!}'. Failed to find rigid nodes' associated bodies.`); - continue; + console.warn(`Skipping joint '${jInst.info!.name!}'. Failed to find rigid nodes' associated bodies.`) + continue } - const bodyA = this.GetBody(bodyIdA); - const bodyB = this.GetBody(bodyIdB); + const bodyA = this.GetBody(bodyIdA) + const bodyB = this.GetBody(bodyIdB) const constraints: Jolt.Constraint[] = [] - let listener: Jolt.PhysicsStepListener | undefined = undefined; + let listener: Jolt.PhysicsStepListener | undefined = undefined switch (jDef.jointMotionType!) { case mirabuf.joint.JointMotion.REVOLUTE: if (this.IsWheel(jDef)) { if (parser.directedGraph.GetAdjacencyList(rnA.id).length > 0) { - const res = this.CreateWheelConstraint(jInst, jDef, bodyA, bodyB, parser.assembly.info!.version!); + const res = this.CreateWheelConstraint( + jInst, + jDef, + bodyA, + bodyB, + parser.assembly.info!.version! + ) constraints.push(res[0]) constraints.push(res[1]) listener = res[2] } else { - const res = this.CreateWheelConstraint(jInst, jDef, bodyB, bodyA, parser.assembly.info!.version!); + const res = this.CreateWheelConstraint( + jInst, + jDef, + bodyB, + bodyA, + parser.assembly.info!.version! + ) constraints.push(res[0]) constraints.push(res[1]) listener = res[2] } } else { - constraints.push(this.CreateHingeConstraint(jInst, jDef, bodyA, bodyB, parser.assembly.info!.version!)); + constraints.push( + this.CreateHingeConstraint(jInst, jDef, bodyA, bodyB, parser.assembly.info!.version!) + ) } - break; + break case mirabuf.joint.JointMotion.SLIDER: - constraints.push(this.CreateSliderConstraint(jInst, jDef, bodyA, bodyB)); - break; + constraints.push(this.CreateSliderConstraint(jInst, jDef, bodyA, bodyB)) + break default: - console.debug('Unsupported joint detected. Skipping...'); - break; + console.debug("Unsupported joint detected. Skipping...") + break } if (constraints.length > 0) { - constraints.forEach(x => mechanism.AddConstraint({ parentBody: bodyIdA, childBody: bodyIdB, constraint: x })) + constraints.forEach(x => + mechanism.AddConstraint({ + parentBody: bodyIdA, + childBody: bodyIdB, + constraint: x, + }) + ) } if (listener) { mechanism.AddStepListener(listener) @@ -239,7 +277,7 @@ class PhysicsSystem extends WorldSystem { /** * Creates a Hinge constraint. - * + * * @param jointInstance Joint instance. * @param jointDefinition Joint definition. * @param bodyA Parent body to connect. @@ -248,283 +286,305 @@ class PhysicsSystem extends WorldSystem { * @returns Resulting Jolt Hinge Constraint. */ private CreateHingeConstraint( - jointInstance: mirabuf.joint.JointInstance, jointDefinition: mirabuf.joint.Joint, - bodyA: Jolt.Body, bodyB: Jolt.Body, versionNum: number): Jolt.Constraint { + jointInstance: mirabuf.joint.JointInstance, + jointDefinition: mirabuf.joint.Joint, + bodyA: Jolt.Body, + bodyB: Jolt.Body, + versionNum: number + ): Jolt.Constraint { // HINGE CONSTRAINT - const hingeConstraintSettings = new JOLT.HingeConstraintSettings(); - + const hingeConstraintSettings = new JOLT.HingeConstraintSettings() + const jointOrigin = jointDefinition.origin ? MirabufVector3_JoltVec3(jointDefinition.origin as mirabuf.Vector3) - : new JOLT.Vec3(0, 0, 0); + : new JOLT.Vec3(0, 0, 0) // TODO: Offset transformation for robot builder. const jointOriginOffset = jointInstance.offset ? MirabufVector3_JoltVec3(jointInstance.offset as mirabuf.Vector3) - : new JOLT.Vec3(0, 0, 0); + : new JOLT.Vec3(0, 0, 0) - const anchorPoint = jointOrigin.Add(jointOriginOffset); - hingeConstraintSettings.mPoint1 = hingeConstraintSettings.mPoint2 = anchorPoint; + const anchorPoint = jointOrigin.Add(jointOriginOffset) + hingeConstraintSettings.mPoint1 = hingeConstraintSettings.mPoint2 = anchorPoint - const rotationalFreedom = jointDefinition.rotational!.rotationalFreedom!; + const rotationalFreedom = jointDefinition.rotational!.rotationalFreedom! - const miraAxis = rotationalFreedom.axis! as mirabuf.Vector3; - let axis: Jolt.Vec3; + const miraAxis = rotationalFreedom.axis! as mirabuf.Vector3 + let axis: Jolt.Vec3 // No scaling, these are unit vectors if (versionNum < 5) { - axis = new JOLT.Vec3(-miraAxis.x ?? 0, miraAxis.y ?? 0, miraAxis.z! ?? 0); + axis = new JOLT.Vec3(-miraAxis.x ?? 0, miraAxis.y ?? 0, miraAxis.z! ?? 0) } else { - axis = new JOLT.Vec3(miraAxis.x! ?? 0, miraAxis.y! ?? 0, miraAxis.z! ?? 0); + axis = new JOLT.Vec3(miraAxis.x! ?? 0, miraAxis.y! ?? 0, miraAxis.z! ?? 0) } - hingeConstraintSettings.mHingeAxis1 = hingeConstraintSettings.mHingeAxis2 - = axis.Normalized(); - hingeConstraintSettings.mNormalAxis1 = hingeConstraintSettings.mNormalAxis2 - = getPerpendicular(hingeConstraintSettings.mHingeAxis1); + hingeConstraintSettings.mHingeAxis1 = hingeConstraintSettings.mHingeAxis2 = axis.Normalized() + hingeConstraintSettings.mNormalAxis1 = hingeConstraintSettings.mNormalAxis2 = getPerpendicular( + hingeConstraintSettings.mHingeAxis1 + ) // Some values that are meant to be exactly PI are perceived as being past it, causing unexpected beavior. // This safety check caps the values to be within [-PI, PI] wth minimal difference in precision. - const piSafetyCheck = (v: number) => Math.min(3.14158, Math.max(-3.14158, v)); - - if (rotationalFreedom.limits && Math.abs((rotationalFreedom.limits.upper ?? 0) - (rotationalFreedom.limits.lower ?? 0)) > 0.001) { - const currentPos = piSafetyCheck(rotationalFreedom.value ?? 0); - const upper = piSafetyCheck(rotationalFreedom.limits.upper ?? 0) - currentPos; - const lower = piSafetyCheck(rotationalFreedom.limits.lower ?? 0) - currentPos; - - hingeConstraintSettings.mLimitsMin = -upper; - hingeConstraintSettings.mLimitsMax = -lower; + const piSafetyCheck = (v: number) => Math.min(3.14158, Math.max(-3.14158, v)) + + if ( + rotationalFreedom.limits && + Math.abs((rotationalFreedom.limits.upper ?? 0) - (rotationalFreedom.limits.lower ?? 0)) > 0.001 + ) { + const currentPos = piSafetyCheck(rotationalFreedom.value ?? 0) + const upper = piSafetyCheck(rotationalFreedom.limits.upper ?? 0) - currentPos + const lower = piSafetyCheck(rotationalFreedom.limits.lower ?? 0) - currentPos + + hingeConstraintSettings.mLimitsMin = -upper + hingeConstraintSettings.mLimitsMax = -lower } - - const constraint = hingeConstraintSettings.Create(bodyA, bodyB); - this._joltPhysSystem.AddConstraint(constraint); - return constraint; + const constraint = hingeConstraintSettings.Create(bodyA, bodyB) + this._joltPhysSystem.AddConstraint(constraint) + + return constraint } /** * Creates a new slider constraint. - * + * * @param jointInstance Joint instance. * @param jointDefinition Joint definition. * @param bodyA Parent body to connect. * @param bodyB Child body to connect. - * + * * @returns Resulting Jolt constraint. */ private CreateSliderConstraint( - jointInstance: mirabuf.joint.JointInstance, jointDefinition: mirabuf.joint.Joint, - bodyA: Jolt.Body, bodyB: Jolt.Body): Jolt.Constraint { + jointInstance: mirabuf.joint.JointInstance, + jointDefinition: mirabuf.joint.Joint, + bodyA: Jolt.Body, + bodyB: Jolt.Body + ): Jolt.Constraint { + const sliderConstraintSettings = new JOLT.SliderConstraintSettings() - const sliderConstraintSettings = new JOLT.SliderConstraintSettings(); - const jointOrigin = jointDefinition.origin ? MirabufVector3_JoltVec3(jointDefinition.origin as mirabuf.Vector3) - : new JOLT.Vec3(0, 0, 0); + : new JOLT.Vec3(0, 0, 0) // TODO: Offset transformation for robot builder. const jointOriginOffset = jointInstance.offset ? MirabufVector3_JoltVec3(jointInstance.offset as mirabuf.Vector3) - : new JOLT.Vec3(0, 0, 0); - - const anchorPoint = jointOrigin.Add(jointOriginOffset); - sliderConstraintSettings.mPoint1 = sliderConstraintSettings.mPoint2 = anchorPoint; + : new JOLT.Vec3(0, 0, 0) - const prismaticFreedom = jointDefinition.prismatic!.prismaticFreedom!; + const anchorPoint = jointOrigin.Add(jointOriginOffset) + sliderConstraintSettings.mPoint1 = sliderConstraintSettings.mPoint2 = anchorPoint - const miraAxis = prismaticFreedom.axis! as mirabuf.Vector3; - const axis = new JOLT.Vec3(miraAxis.x! ?? 0, miraAxis.y! ?? 0, miraAxis.z! ?? 0); + const prismaticFreedom = jointDefinition.prismatic!.prismaticFreedom! - sliderConstraintSettings.mSliderAxis1 = sliderConstraintSettings.mSliderAxis2 - = axis.Normalized(); - sliderConstraintSettings.mNormalAxis1 = sliderConstraintSettings.mNormalAxis2 - = getPerpendicular(sliderConstraintSettings.mSliderAxis1); + const miraAxis = prismaticFreedom.axis! as mirabuf.Vector3 + const axis = new JOLT.Vec3(miraAxis.x! ?? 0, miraAxis.y! ?? 0, miraAxis.z! ?? 0) - if (prismaticFreedom.limits && Math.abs((prismaticFreedom.limits.upper ?? 0) - (prismaticFreedom.limits.lower ?? 0)) > 0.001) { + sliderConstraintSettings.mSliderAxis1 = sliderConstraintSettings.mSliderAxis2 = axis.Normalized() + sliderConstraintSettings.mNormalAxis1 = sliderConstraintSettings.mNormalAxis2 = getPerpendicular( + sliderConstraintSettings.mSliderAxis1 + ) - const currentPos = (prismaticFreedom.value ?? 0) * 0.01; - const upper = ((prismaticFreedom.limits.upper ?? 0) * 0.01) - currentPos; - const lower = ((prismaticFreedom.limits.lower ?? 0) * 0.01) - currentPos; + if ( + prismaticFreedom.limits && + Math.abs((prismaticFreedom.limits.upper ?? 0) - (prismaticFreedom.limits.lower ?? 0)) > 0.001 + ) { + const currentPos = (prismaticFreedom.value ?? 0) * 0.01 + const upper = (prismaticFreedom.limits.upper ?? 0) * 0.01 - currentPos + const lower = (prismaticFreedom.limits.lower ?? 0) * 0.01 - currentPos // Calculate mid point - const midPoint = (upper + lower) / 2.0; - const halfRange = Math.abs((upper - lower) / 2.0); - + const midPoint = (upper + lower) / 2.0 + const halfRange = Math.abs((upper - lower) / 2.0) + // Move the anchor points - sliderConstraintSettings.mPoint2 - = anchorPoint.Add(axis.Normalized().Mul(midPoint)); + sliderConstraintSettings.mPoint2 = anchorPoint.Add(axis.Normalized().Mul(midPoint)) - sliderConstraintSettings.mLimitsMax = halfRange; - sliderConstraintSettings.mLimitsMin = -halfRange; + sliderConstraintSettings.mLimitsMax = halfRange + sliderConstraintSettings.mLimitsMin = -halfRange } - - const constraint = sliderConstraintSettings.Create(bodyA, bodyB); - - this._constraints.push(constraint); - this._joltPhysSystem.AddConstraint(constraint); - return constraint; - } + const constraint = sliderConstraintSettings.Create(bodyA, bodyB) + this._constraints.push(constraint) + this._joltPhysSystem.AddConstraint(constraint) + + return constraint + } public CreateWheelConstraint( - jointInstance: mirabuf.joint.JointInstance, jointDefinition: mirabuf.joint.Joint, - bodyMain: Jolt.Body, bodyWheel: Jolt.Body, versionNum: number): [Jolt.Constraint, Jolt.VehicleConstraint, Jolt.PhysicsStepListener] { + jointInstance: mirabuf.joint.JointInstance, + jointDefinition: mirabuf.joint.Joint, + bodyMain: Jolt.Body, + bodyWheel: Jolt.Body, + versionNum: number + ): [Jolt.Constraint, Jolt.VehicleConstraint, Jolt.PhysicsStepListener] { // HINGE CONSTRAINT - const fixedSettings = new JOLT.FixedConstraintSettings(); - + const fixedSettings = new JOLT.FixedConstraintSettings() + const jointOrigin = jointDefinition.origin ? MirabufVector3_JoltVec3(jointDefinition.origin as mirabuf.Vector3) - : new JOLT.Vec3(0, 0, 0); + : new JOLT.Vec3(0, 0, 0) const jointOriginOffset = jointInstance.offset ? MirabufVector3_JoltVec3(jointInstance.offset as mirabuf.Vector3) - : new JOLT.Vec3(0, 0, 0); + : new JOLT.Vec3(0, 0, 0) - const anchorPoint = jointOrigin.Add(jointOriginOffset); - fixedSettings.mPoint1 = fixedSettings.mPoint2 = anchorPoint; + const anchorPoint = jointOrigin.Add(jointOriginOffset) + fixedSettings.mPoint1 = fixedSettings.mPoint2 = anchorPoint - const rotationalFreedom = jointDefinition.rotational!.rotationalFreedom!; + const rotationalFreedom = jointDefinition.rotational!.rotationalFreedom! - const miraAxis = rotationalFreedom.axis! as mirabuf.Vector3; - let axis: Jolt.Vec3; + const miraAxis = rotationalFreedom.axis! as mirabuf.Vector3 + let axis: Jolt.Vec3 // No scaling, these are unit vectors if (versionNum < 5) { - axis = new JOLT.Vec3(-miraAxis.x ?? 0, miraAxis.y ?? 0, miraAxis.z ?? 0); + axis = new JOLT.Vec3(-miraAxis.x ?? 0, miraAxis.y ?? 0, miraAxis.z ?? 0) } else { - axis = new JOLT.Vec3(miraAxis.x ?? 0, miraAxis.y ?? 0, miraAxis.z ?? 0); + axis = new JOLT.Vec3(miraAxis.x ?? 0, miraAxis.y ?? 0, miraAxis.z ?? 0) } - const bounds = bodyWheel.GetShape().GetLocalBounds(); - const radius = (bounds.mMax.GetY() - bounds.mMin.GetY()) / 2.0; - - const wheelSettings = new JOLT.WheelSettingsWV(); - wheelSettings.mPosition = anchorPoint.Add(axis.Mul(0.1)); - wheelSettings.mMaxSteerAngle = 0.0; - wheelSettings.mMaxHandBrakeTorque = 0.0; - wheelSettings.mRadius = radius * 1.05; - wheelSettings.mWidth = 0.1; - wheelSettings.mSuspensionMinLength = 0.0000003; - wheelSettings.mSuspensionMaxLength = 0.0000006; - wheelSettings.mInertia = 1; - - const friction = new JOLT.LinearCurve(); - friction.Clear(); - friction.AddPoint(1,1); - friction.AddPoint(0,1); - wheelSettings.mLongitudinalFriction = friction; - - const vehicleSettings = new JOLT.VehicleConstraintSettings(); - - vehicleSettings.mWheels.clear(); - vehicleSettings.mWheels.push_back(wheelSettings); - - const controllerSettings = new JOLT.WheeledVehicleControllerSettings(); - controllerSettings.mEngine.mMaxTorque = 1500.0; - controllerSettings.mTransmission.mClutchStrength = 10.0; - controllerSettings.mTransmission.mGearRatios.clear(); - controllerSettings.mTransmission.mGearRatios.push_back(2); - controllerSettings.mTransmission.mMode = JOLT.ETransmissionMode_Auto; - vehicleSettings.mController = controllerSettings; - - vehicleSettings.mAntiRollBars.clear(); - - const vehicleConstraint = new JOLT.VehicleConstraint(bodyMain, vehicleSettings); - const fixedConstraint = JOLT.castObject(fixedSettings.Create(bodyMain, bodyWheel), JOLT.TwoBodyConstraint); + const bounds = bodyWheel.GetShape().GetLocalBounds() + const radius = (bounds.mMax.GetY() - bounds.mMin.GetY()) / 2.0 + + const wheelSettings = new JOLT.WheelSettingsWV() + wheelSettings.mPosition = anchorPoint.Add(axis.Mul(0.1)) + wheelSettings.mMaxSteerAngle = 0.0 + wheelSettings.mMaxHandBrakeTorque = 0.0 + wheelSettings.mRadius = radius * 1.05 + wheelSettings.mWidth = 0.1 + wheelSettings.mSuspensionMinLength = 0.0000003 + wheelSettings.mSuspensionMaxLength = 0.0000006 + wheelSettings.mInertia = 1 + + const friction = new JOLT.LinearCurve() + friction.Clear() + friction.AddPoint(1, 1) + friction.AddPoint(0, 1) + wheelSettings.mLongitudinalFriction = friction + + const vehicleSettings = new JOLT.VehicleConstraintSettings() + + vehicleSettings.mWheels.clear() + vehicleSettings.mWheels.push_back(wheelSettings) + + const controllerSettings = new JOLT.WheeledVehicleControllerSettings() + controllerSettings.mEngine.mMaxTorque = 1500.0 + controllerSettings.mTransmission.mClutchStrength = 10.0 + controllerSettings.mTransmission.mGearRatios.clear() + controllerSettings.mTransmission.mGearRatios.push_back(2) + controllerSettings.mTransmission.mMode = JOLT.ETransmissionMode_Auto + vehicleSettings.mController = controllerSettings + + vehicleSettings.mAntiRollBars.clear() + + const vehicleConstraint = new JOLT.VehicleConstraint(bodyMain, vehicleSettings) + const fixedConstraint = JOLT.castObject(fixedSettings.Create(bodyMain, bodyWheel), JOLT.TwoBodyConstraint) // Wheel Collision Tester - const tester = new JOLT.VehicleCollisionTesterCastCylinder(bodyWheel.GetObjectLayer(), 0.05); - vehicleConstraint.SetVehicleCollisionTester(tester); - const listener = new JOLT.VehicleConstraintStepListener(vehicleConstraint); - this._joltPhysSystem.AddStepListener(listener); + const tester = new JOLT.VehicleCollisionTesterCastCylinder(bodyWheel.GetObjectLayer(), 0.05) + vehicleConstraint.SetVehicleCollisionTester(tester) + const listener = new JOLT.VehicleConstraintStepListener(vehicleConstraint) + this._joltPhysSystem.AddStepListener(listener) - this._joltPhysSystem.AddConstraint(vehicleConstraint); - this._joltPhysSystem.AddConstraint(fixedConstraint); + this._joltPhysSystem.AddConstraint(vehicleConstraint) + this._joltPhysSystem.AddConstraint(fixedConstraint) - this._constraints.push(fixedConstraint, vehicleConstraint); - return [fixedConstraint, vehicleConstraint, listener]; + this._constraints.push(fixedConstraint, vehicleConstraint) + return [fixedConstraint, vehicleConstraint, listener] } private IsWheel(jDef: mirabuf.joint.Joint) { - return (jDef.info!.name! != 'grounded') && (jDef.userData) && ((new Map(Object.entries(jDef.userData.data!)).get('wheel') ?? 'false') == 'true') + return ( + jDef.info!.name! != "grounded" && + jDef.userData && + (new Map(Object.entries(jDef.userData.data!)).get("wheel") ?? "false") == "true" + ) } /** * Creates a map, mapping the name of RigidNodes to Jolt BodyIDs - * + * * @param parser MirabufParser containing properly parsed RigidNodes * @returns Mapping of Jolt BodyIDs */ public CreateBodiesFromParser(parser: MirabufParser, layerReserve?: LayerReserve): Map { - const rnToBodies = new Map(); + const rnToBodies = new Map() if ((parser.assembly.dynamic && !layerReserve) || layerReserve?.isReleased) { - throw new Error('No layer reserve for dynamic assembly'); + throw new Error("No layer reserve for dynamic assembly") } - const reservedLayer: number | undefined = layerReserve?.layer; - - filterNonPhysicsNodes(parser.rigidNodes, parser.assembly).forEach(rn => { + const reservedLayer: number | undefined = layerReserve?.layer - const compoundShapeSettings = new JOLT.StaticCompoundShapeSettings(); - let shapesAdded = 0; + filterNonPhysicsNodes(parser.rigidNodes, parser.assembly).forEach(rn => { + const compoundShapeSettings = new JOLT.StaticCompoundShapeSettings() + let shapesAdded = 0 - let totalMass = 0; - const comAccum = new mirabuf.Vector3(); + let totalMass = 0 + const comAccum = new mirabuf.Vector3() - const minBounds = new JOLT.Vec3(1000000.0, 1000000.0, 1000000.0); - const maxBounds = new JOLT.Vec3(-1000000.0, -1000000.0, -1000000.0); + const minBounds = new JOLT.Vec3(1000000.0, 1000000.0, 1000000.0) + const maxBounds = new JOLT.Vec3(-1000000.0, -1000000.0, -1000000.0) const rnLayer: number = reservedLayer ? reservedLayer - : (rn.id.endsWith(GAMEPIECE_SUFFIX) ? LAYER_GENERAL_DYNAMIC : LAYER_FIELD); + : rn.id.endsWith(GAMEPIECE_SUFFIX) + ? LAYER_GENERAL_DYNAMIC + : LAYER_FIELD rn.parts.forEach(partId => { - const partInstance = parser.assembly.data!.parts!.partInstances![partId]!; - if (partInstance.skipCollider == null || partInstance == undefined || partInstance.skipCollider == false) { - const partDefinition = parser.assembly.data!.parts!.partDefinitions![partInstance.partDefinitionReference!]!; - - const partShapeResult = this.CreateShapeSettingsFromPart(partDefinition); - - if (partShapeResult) { + const partInstance = parser.assembly.data!.parts!.partInstances![partId]! + if ( + partInstance.skipCollider == null || + partInstance == undefined || + partInstance.skipCollider == false + ) { + const partDefinition = + parser.assembly.data!.parts!.partDefinitions![partInstance.partDefinitionReference!]! - const [shapeSettings, partMin, partMax] = partShapeResult; - - const transform = ThreeMatrix4_JoltMat44(parser.globalTransforms.get(partId)!); - const translation = transform.GetTranslation(); - const rotation = transform.GetQuaternion(); - compoundShapeSettings.AddShape( - translation, - rotation, - shapeSettings, - 0 - ); - shapesAdded++; - - this.UpdateMinMaxBounds(transform.Multiply3x3(partMin), minBounds, maxBounds); - this.UpdateMinMaxBounds(transform.Multiply3x3(partMax), minBounds, maxBounds); - - JOLT.destroy(partMin); - JOLT.destroy(partMax); - JOLT.destroy(transform); - - if (partDefinition.physicalData && partDefinition.physicalData.com && partDefinition.physicalData.mass) { - const mass = partDefinition.massOverride ? partDefinition.massOverride! : partDefinition.physicalData.mass!; - totalMass += mass; - comAccum.x += partDefinition.physicalData.com.x! * mass / 100.0; - comAccum.y += partDefinition.physicalData.com.y! * mass / 100.0; - comAccum.z += partDefinition.physicalData.com.z! * mass / 100.0; + const partShapeResult = this.CreateShapeSettingsFromPart(partDefinition) + + if (partShapeResult) { + const [shapeSettings, partMin, partMax] = partShapeResult + + const transform = ThreeMatrix4_JoltMat44(parser.globalTransforms.get(partId)!) + const translation = transform.GetTranslation() + const rotation = transform.GetQuaternion() + compoundShapeSettings.AddShape(translation, rotation, shapeSettings, 0) + shapesAdded++ + + this.UpdateMinMaxBounds(transform.Multiply3x3(partMin), minBounds, maxBounds) + this.UpdateMinMaxBounds(transform.Multiply3x3(partMax), minBounds, maxBounds) + + JOLT.destroy(partMin) + JOLT.destroy(partMax) + JOLT.destroy(transform) + + if ( + partDefinition.physicalData && + partDefinition.physicalData.com && + partDefinition.physicalData.mass + ) { + const mass = partDefinition.massOverride + ? partDefinition.massOverride! + : partDefinition.physicalData.mass! + totalMass += mass + comAccum.x += (partDefinition.physicalData.com.x! * mass) / 100.0 + comAccum.y += (partDefinition.physicalData.com.y! * mass) / 100.0 + comAccum.z += (partDefinition.physicalData.com.z! * mass) / 100.0 } } } - }); + }) if (shapesAdded > 0) { - - const shapeResult = compoundShapeSettings.Create(); + const shapeResult = compoundShapeSettings.Create() if (!shapeResult.IsValid || shapeResult.HasError()) { - console.error(`Failed to create shape for RigidNode ${rn.id}\n${shapeResult.GetError().c_str()}`); + console.error(`Failed to create shape for RigidNode ${rn.id}\n${shapeResult.GetError().c_str()}`) } - const shape = shapeResult.Get(); + const shape = shapeResult.Get() if (rn.isDynamic) { - shape.GetMassProperties().mMass = totalMass == 0.0 ? 1 : totalMass; + shape.GetMassProperties().mMass = totalMass == 0.0 ? 1 : totalMass } const bodySettings = new JOLT.BodyCreationSettings( @@ -533,98 +593,94 @@ class PhysicsSystem extends WorldSystem { new JOLT.Quat(0, 0, 0, 1), rn.isDynamic ? JOLT.EMotionType_Dynamic : JOLT.EMotionType_Static, rnLayer - ); - const body = this._joltBodyInterface.CreateBody(bodySettings); - this._joltBodyInterface.AddBody(body.GetID(), JOLT.EActivation_Activate); - body.SetAllowSleeping(false); - rnToBodies.set(rn.id, body.GetID()); + ) + const body = this._joltBodyInterface.CreateBody(bodySettings) + this._joltBodyInterface.AddBody(body.GetID(), JOLT.EActivation_Activate) + body.SetAllowSleeping(false) + rnToBodies.set(rn.id, body.GetID()) // Little testing components - body.SetRestitution(0.4); + body.SetRestitution(0.4) } // Cleanup - JOLT.destroy(compoundShapeSettings); - }); + JOLT.destroy(compoundShapeSettings) + }) - return rnToBodies; + return rnToBodies } /** * Creates the Jolt ShapeSettings for a given part using the Part Definition of said part. - * + * * @param partDefinition Definition of the part to create. * @returns If successful, the created convex hull shape settings from the given Part Definition. */ - private CreateShapeSettingsFromPart(partDefinition: mirabuf.IPartDefinition): [Jolt.ShapeSettings, Jolt.Vec3, Jolt.Vec3] | undefined | null { - const settings = new JOLT.ConvexHullShapeSettings(); + private CreateShapeSettingsFromPart( + partDefinition: mirabuf.IPartDefinition + ): [Jolt.ShapeSettings, Jolt.Vec3, Jolt.Vec3] | undefined | null { + const settings = new JOLT.ConvexHullShapeSettings() - const min = new JOLT.Vec3(1000000.0, 1000000.0, 1000000.0); - const max = new JOLT.Vec3(-1000000.0, -1000000.0, -1000000.0); + const min = new JOLT.Vec3(1000000.0, 1000000.0, 1000000.0) + const max = new JOLT.Vec3(-1000000.0, -1000000.0, -1000000.0) - const points = settings.mPoints; + const points = settings.mPoints partDefinition.bodies!.forEach(body => { if (body.triangleMesh && body.triangleMesh.mesh && body.triangleMesh.mesh.verts) { - const vertArr = body.triangleMesh.mesh.verts; + const vertArr = body.triangleMesh.mesh.verts for (let i = 0; i < body.triangleMesh.mesh.verts.length; i += 3) { - const vert = MirabufFloatArr_JoltVec3(vertArr, i); - points.push_back(vert); - this.UpdateMinMaxBounds(vert, min, max); - JOLT.destroy(vert); + const vert = MirabufFloatArr_JoltVec3(vertArr, i) + points.push_back(vert) + this.UpdateMinMaxBounds(vert, min, max) + JOLT.destroy(vert) } } - }); + }) if (points.size() < 4) { - JOLT.destroy(settings); - JOLT.destroy(min); - JOLT.destroy(max); - return; + JOLT.destroy(settings) + JOLT.destroy(min) + JOLT.destroy(max) + return } else { - return [settings, min, max]; + return [settings, min, max] } } /** * Helper function to update min and max vector bounds. - * + * * @param v Vector to add to min, max, bounds. * @param min Minimum vector of the bounds. * @param max Maximum vector of the bounds. */ private UpdateMinMaxBounds(v: Jolt.Vec3, min: Jolt.Vec3, max: Jolt.Vec3) { - if (v.GetX() < min.GetX()) - min.SetX(v.GetX()); - if (v.GetY() < min.GetY()) - min.SetY(v.GetY()); - if (v.GetZ() < min.GetZ()) - min.SetZ(v.GetZ()); - - if (v.GetX() > max.GetX()) - max.SetX(v.GetX()); - if (v.GetY() > max.GetY()) - max.SetY(v.GetY()); - if (v.GetZ() > max.GetZ()) - max.SetZ(v.GetZ()); + if (v.GetX() < min.GetX()) min.SetX(v.GetX()) + if (v.GetY() < min.GetY()) min.SetY(v.GetY()) + if (v.GetZ() < min.GetZ()) min.SetZ(v.GetZ()) + + if (v.GetX() > max.GetX()) max.SetX(v.GetX()) + if (v.GetY() > max.GetY()) max.SetY(v.GetY()) + if (v.GetZ() > max.GetZ()) max.SetZ(v.GetZ()) } /** * Destroys bodies. - * + * * @param bodies Bodies to destroy. */ public DestroyBodies(...bodies: Jolt.Body[]) { bodies.forEach(x => { - this._joltBodyInterface.RemoveBody(x.GetID()); - this._joltBodyInterface.DestroyBody(x.GetID()); - }); + this._joltBodyInterface.RemoveBody(x.GetID()) + this._joltBodyInterface.DestroyBody(x.GetID()) + }) } public DestroyBodyIds(...bodies: Jolt.BodyID[]) { bodies.forEach(x => { - this._joltBodyInterface.RemoveBody(x); - this._joltBodyInterface.DestroyBody(x); - }); + this._joltBodyInterface.RemoveBody(x) + this._joltBodyInterface.DestroyBody(x) + }) } public DestroyMechanism(mech: Mechanism) { @@ -633,44 +689,48 @@ class PhysicsSystem extends WorldSystem { }) mech.constraints.forEach(x => { this._joltPhysSystem.RemoveConstraint(x.constraint) - }); + }) mech.nodeToBody.forEach(x => { - this._joltBodyInterface.RemoveBody(x); + this._joltBodyInterface.RemoveBody(x) // this._joltBodyInterface.DestroyBody(x); - }); - console.log('Mechanism destroyed') + }) + console.log("Mechanism destroyed") } public GetBody(bodyId: Jolt.BodyID) { - return this._joltPhysSystem.GetBodyLockInterface().TryGetBody(bodyId); + return this._joltPhysSystem.GetBodyLockInterface().TryGetBody(bodyId) } public Update(_: number): void { - this._joltInterface.Step(SIMULATION_PERIOD, STANDARD_SUB_STEPS); + this._joltInterface.Step(SIMULATION_PERIOD, STANDARD_SUB_STEPS) } public Destroy(): void { this._constraints.forEach(x => { - this._joltPhysSystem.RemoveConstraint(x); + this._joltPhysSystem.RemoveConstraint(x) // JOLT.destroy(x); - }); - this._constraints = []; + }) + this._constraints = [] // Destroy Jolt Bodies. - this.DestroyBodyIds(...this._bodies); - this._bodies = []; + this.DestroyBodyIds(...this._bodies) + this._bodies = [] - JOLT.destroy(this._joltBodyInterface); - JOLT.destroy(this._joltInterface); + JOLT.destroy(this._joltBodyInterface) + JOLT.destroy(this._joltInterface) } } export class LayerReserve { - private _layer: number; - private _isReleased: boolean; + private _layer: number + private _isReleased: boolean - public get layer() { return this._layer } - public get isReleased() { return this._isReleased } + public get layer() { + return this._layer + } + public get isReleased() { + return this._isReleased + } public constructor() { this._layer = RobotLayers.shift()! @@ -679,92 +739,91 @@ export class LayerReserve { public Release() { if (!this._isReleased) { - RobotLayers.push(this._layer); - this._isReleased = true; + RobotLayers.push(this._layer) + this._isReleased = true } } } /** * Initialize collision groups and filtering for Jolt. - * + * * @param settings Jolt object used for applying filters. */ function SetupCollisionFiltering(settings: Jolt.JoltSettings) { - const objectFilter = new JOLT.ObjectLayerPairFilterTable(COUNT_OBJECT_LAYERS); - + const objectFilter = new JOLT.ObjectLayerPairFilterTable(COUNT_OBJECT_LAYERS) + // Enable Field layer collisions - objectFilter.EnableCollision(LAYER_GENERAL_DYNAMIC, LAYER_GENERAL_DYNAMIC); - objectFilter.EnableCollision(LAYER_FIELD, LAYER_GENERAL_DYNAMIC); + objectFilter.EnableCollision(LAYER_GENERAL_DYNAMIC, LAYER_GENERAL_DYNAMIC) + objectFilter.EnableCollision(LAYER_FIELD, LAYER_GENERAL_DYNAMIC) for (let i = 0; i < RobotLayers.length; i++) { - objectFilter.EnableCollision(LAYER_FIELD, RobotLayers[i]); - objectFilter.EnableCollision(LAYER_GENERAL_DYNAMIC, RobotLayers[i]); + objectFilter.EnableCollision(LAYER_FIELD, RobotLayers[i]) + objectFilter.EnableCollision(LAYER_GENERAL_DYNAMIC, RobotLayers[i]) } // Enable Collisions between other robots for (let i = 0; i < RobotLayers.length - 1; i++) { for (let j = i + 1; j < RobotLayers.length; j++) { - objectFilter.EnableCollision(RobotLayers[i], RobotLayers[j]); + objectFilter.EnableCollision(RobotLayers[i], RobotLayers[j]) } } - const BP_LAYER_FIELD = new JOLT.BroadPhaseLayer(LAYER_FIELD); - const BP_LAYER_GENERAL_DYNAMIC = new JOLT.BroadPhaseLayer(LAYER_GENERAL_DYNAMIC); + const BP_LAYER_FIELD = new JOLT.BroadPhaseLayer(LAYER_FIELD) + const BP_LAYER_GENERAL_DYNAMIC = new JOLT.BroadPhaseLayer(LAYER_GENERAL_DYNAMIC) - const bpRobotLayers = new Array(RobotLayers.length); + const bpRobotLayers = new Array(RobotLayers.length) for (let i = 0; i < bpRobotLayers.length; i++) { - bpRobotLayers[i] = new JOLT.BroadPhaseLayer(RobotLayers[i]); + bpRobotLayers[i] = new JOLT.BroadPhaseLayer(RobotLayers[i]) } - const COUNT_BROAD_PHASE_LAYERS = 2 + RobotLayers.length; + const COUNT_BROAD_PHASE_LAYERS = 2 + RobotLayers.length + + const bpInterface = new JOLT.BroadPhaseLayerInterfaceTable(COUNT_OBJECT_LAYERS, COUNT_BROAD_PHASE_LAYERS) - const bpInterface = new JOLT.BroadPhaseLayerInterfaceTable(COUNT_OBJECT_LAYERS, COUNT_BROAD_PHASE_LAYERS); - - bpInterface.MapObjectToBroadPhaseLayer(LAYER_FIELD, BP_LAYER_FIELD); - bpInterface.MapObjectToBroadPhaseLayer(LAYER_GENERAL_DYNAMIC, BP_LAYER_GENERAL_DYNAMIC); + bpInterface.MapObjectToBroadPhaseLayer(LAYER_FIELD, BP_LAYER_FIELD) + bpInterface.MapObjectToBroadPhaseLayer(LAYER_GENERAL_DYNAMIC, BP_LAYER_GENERAL_DYNAMIC) for (let i = 0; i < bpRobotLayers.length; i++) { - bpInterface.MapObjectToBroadPhaseLayer(RobotLayers[i], bpRobotLayers[i]); + bpInterface.MapObjectToBroadPhaseLayer(RobotLayers[i], bpRobotLayers[i]) } - settings.mObjectLayerPairFilter = objectFilter; - settings.mBroadPhaseLayerInterface = bpInterface; + settings.mObjectLayerPairFilter = objectFilter + settings.mBroadPhaseLayerInterface = bpInterface settings.mObjectVsBroadPhaseLayerFilter = new JOLT.ObjectVsBroadPhaseLayerFilterTable( settings.mBroadPhaseLayerInterface, COUNT_BROAD_PHASE_LAYERS, settings.mObjectLayerPairFilter, COUNT_OBJECT_LAYERS - ); + ) } function filterNonPhysicsNodes(nodes: RigidNodeReadOnly[], mira: mirabuf.Assembly): RigidNodeReadOnly[] { return nodes.filter(x => { for (const part of x.parts) { - const inst = mira.data!.parts!.partInstances![part]!; - const def = mira.data!.parts!.partDefinitions![inst.partDefinitionReference!]!; + const inst = mira.data!.parts!.partInstances![part]! + const def = mira.data!.parts!.partDefinitions![inst.partDefinitionReference!]! if (def.bodies && def.bodies.length > 0) { - return true; + return true } } - return false; - }); + return false + }) } function getPerpendicular(vec: Jolt.Vec3): Jolt.Vec3 { - return tryGetPerpendicular(vec, new JOLT.Vec3(0, 1, 0)) - ?? tryGetPerpendicular(vec, new JOLT.Vec3(0, 0, 1))!; + return tryGetPerpendicular(vec, new JOLT.Vec3(0, 1, 0)) ?? tryGetPerpendicular(vec, new JOLT.Vec3(0, 0, 1))! } function tryGetPerpendicular(vec: Jolt.Vec3, toCheck: Jolt.Vec3): Jolt.Vec3 | undefined { if (Math.abs(Math.abs(vec.Dot(toCheck)) - 1.0) < 0.0001) { - return undefined; + return undefined } - const a = vec.Dot(toCheck); + const a = vec.Dot(toCheck) return new JOLT.Vec3( toCheck.GetX() - vec.GetX() * a, toCheck.GetY() - vec.GetY() * a, toCheck.GetZ() - vec.GetZ() * a - ).Normalized(); + ).Normalized() } -export default PhysicsSystem; \ No newline at end of file +export default PhysicsSystem diff --git a/fission/src/systems/scene/SceneObject.ts b/fission/src/systems/scene/SceneObject.ts index 9c1f175835..be714b6c12 100644 --- a/fission/src/systems/scene/SceneObject.ts +++ b/fission/src/systems/scene/SceneObject.ts @@ -1,30 +1,29 @@ abstract class SceneObject { - private _id: number | null = null; + private _id: number | null = null public get id() { - return this._id!; + return this._id! } public set id(sceneId: number) { - if (this._id) - return; - this._id = sceneId; + if (this._id) return + this._id = sceneId } /** * Setup is executed after an ID is assigned and the SceneObject is registered with the SceneRenderer */ - public abstract Setup(): void; + public abstract Setup(): void /** * Update is executed just before rendering of the scene to allow for uniform and rendering parameter updates. */ - public abstract Update(): void; + public abstract Update(): void /** * Dispose is executed just before the SceneObject is unregistered and removed from the SceneRenderer. */ - public abstract Dispose(): void; + public abstract Dispose(): void } -export default SceneObject; \ No newline at end of file +export default SceneObject diff --git a/fission/src/systems/scene/SceneRenderer.ts b/fission/src/systems/scene/SceneRenderer.ts index daaf2fdf4f..ef27f40eec 100644 --- a/fission/src/systems/scene/SceneRenderer.ts +++ b/fission/src/systems/scene/SceneRenderer.ts @@ -1,101 +1,94 @@ -import * as THREE from 'three'; -import SceneObject from './SceneObject'; -import WorldSystem from '../WorldSystem'; +import * as THREE from "three" +import SceneObject from "./SceneObject" +import WorldSystem from "../WorldSystem" -const CLEAR_COLOR = 0x121212; -const GROUND_COLOR = 0x73937E +const CLEAR_COLOR = 0x121212 +const GROUND_COLOR = 0x73937e -let nextSceneObjectId = 1; +let nextSceneObjectId = 1 class SceneRenderer extends WorldSystem { + private _mainCamera: THREE.PerspectiveCamera + private _scene: THREE.Scene + private _renderer: THREE.WebGLRenderer - private _mainCamera: THREE.PerspectiveCamera; - private _scene: THREE.Scene; - private _renderer: THREE.WebGLRenderer; - - private _sceneObjects: Map; + private _sceneObjects: Map public get sceneObjects() { - return this._sceneObjects; + return this._sceneObjects } public get mainCamera() { - return this._mainCamera; + return this._mainCamera } public get scene() { - return this._scene; + return this._scene } public get renderer(): THREE.WebGLRenderer { - return this._renderer; + return this._renderer } public constructor() { - super(); - - this._sceneObjects = new Map(); - - this._mainCamera = new THREE.PerspectiveCamera( - 75, - window.innerWidth / window.innerHeight, - 0.1, - 1000 - ); - this._mainCamera.position.set(-2.5, 2, 2.5); - - - this._scene = new THREE.Scene(); - - this._renderer = new THREE.WebGLRenderer(); - this._renderer.setClearColor(CLEAR_COLOR); - this._renderer.setPixelRatio(window.devicePixelRatio); - this._renderer.shadowMap.enabled = true; - this._renderer.shadowMap.type = THREE.PCFSoftShadowMap; - this._renderer.setSize(window.innerWidth, window.innerHeight); - - const directionalLight = new THREE.DirectionalLight(0xffffff, 3.0); - directionalLight.position.set(-1.0, 3.0, 2.0); - directionalLight.castShadow = true; - this._scene.add(directionalLight); - - const shadowMapSize = Math.min(4096, this._renderer.capabilities.maxTextureSize); - const shadowCamSize = 15; - console.debug(`Shadow Map Size: ${shadowMapSize}`); - - directionalLight.shadow.camera.top = shadowCamSize; - directionalLight.shadow.camera.bottom = -shadowCamSize; - directionalLight.shadow.camera.left = -shadowCamSize; - directionalLight.shadow.camera.right = shadowCamSize; - directionalLight.shadow.mapSize = new THREE.Vector2(shadowMapSize, shadowMapSize); - directionalLight.shadow.blurSamples = 16; - directionalLight.shadow.normalBias = 0.01; - directionalLight.shadow.bias = 0.00; - - const ambientLight = new THREE.AmbientLight(0xffffff, 0.1); - this._scene.add(ambientLight); - - const ground = new THREE.Mesh(new THREE.BoxGeometry(10, 1, 10), this.CreateToonMaterial(GROUND_COLOR)); - ground.position.set(0.0, -2.0, 0.0); - ground.receiveShadow = true; - ground.castShadow = true; - this._scene.add(ground); + super() + + this._sceneObjects = new Map() + + this._mainCamera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000) + this._mainCamera.position.set(-2.5, 2, 2.5) + + this._scene = new THREE.Scene() + + this._renderer = new THREE.WebGLRenderer() + this._renderer.setClearColor(CLEAR_COLOR) + this._renderer.setPixelRatio(window.devicePixelRatio) + this._renderer.shadowMap.enabled = true + this._renderer.shadowMap.type = THREE.PCFSoftShadowMap + this._renderer.setSize(window.innerWidth, window.innerHeight) + + const directionalLight = new THREE.DirectionalLight(0xffffff, 3.0) + directionalLight.position.set(-1.0, 3.0, 2.0) + directionalLight.castShadow = true + this._scene.add(directionalLight) + + const shadowMapSize = Math.min(4096, this._renderer.capabilities.maxTextureSize) + const shadowCamSize = 15 + console.debug(`Shadow Map Size: ${shadowMapSize}`) + + directionalLight.shadow.camera.top = shadowCamSize + directionalLight.shadow.camera.bottom = -shadowCamSize + directionalLight.shadow.camera.left = -shadowCamSize + directionalLight.shadow.camera.right = shadowCamSize + directionalLight.shadow.mapSize = new THREE.Vector2(shadowMapSize, shadowMapSize) + directionalLight.shadow.blurSamples = 16 + directionalLight.shadow.normalBias = 0.01 + directionalLight.shadow.bias = 0.0 + + const ambientLight = new THREE.AmbientLight(0xffffff, 0.1) + this._scene.add(ambientLight) + + const ground = new THREE.Mesh(new THREE.BoxGeometry(10, 1, 10), this.CreateToonMaterial(GROUND_COLOR)) + ground.position.set(0.0, -2.0, 0.0) + ground.receiveShadow = true + ground.castShadow = true + this._scene.add(ground) } public UpdateCanvasSize() { - this._renderer.setSize(window.innerWidth, window.innerHeight); + this._renderer.setSize(window.innerWidth, window.innerHeight) // No idea why height would be zero, but just incase. - this._mainCamera.aspect = window.innerWidth / window.innerHeight; - this._mainCamera.updateProjectionMatrix(); + this._mainCamera.aspect = window.innerWidth / window.innerHeight + this._mainCamera.updateProjectionMatrix() } public Update(_: number): void { this._sceneObjects.forEach(obj => { - obj.Update(); - }); + obj.Update() + }) // controls.update(deltaTime); // TODO: Add controls? - this._renderer.render(this._scene, this._mainCamera); + this._renderer.render(this._scene, this._mainCamera) } public Destroy(): void { @@ -103,44 +96,47 @@ class SceneRenderer extends WorldSystem { } public RegisterSceneObject(obj: T): number { - const id = nextSceneObjectId++; - obj.id = id; - this._sceneObjects.set(id, obj); - obj.Setup(); - return id; + const id = nextSceneObjectId++ + obj.id = id + this._sceneObjects.set(id, obj) + obj.Setup() + return id } public RemoveAllSceneObjects() { - this._sceneObjects.forEach(obj => obj.Dispose()); - this._sceneObjects.clear(); + this._sceneObjects.forEach(obj => obj.Dispose()) + this._sceneObjects.clear() } public RemoveSceneObject(id: number) { const obj = this._sceneObjects.get(id) if (this._sceneObjects.delete(id)) { - obj!.Dispose(); + obj!.Dispose() } } public CreateSphere(radius: number, material?: THREE.Material | undefined): THREE.Mesh { - const geo = new THREE.SphereGeometry(radius); + const geo = new THREE.SphereGeometry(radius) if (material) { - return new THREE.Mesh(geo, material); + return new THREE.Mesh(geo, material) } else { - return new THREE.Mesh(geo, this.CreateToonMaterial()); + return new THREE.Mesh(geo, this.CreateToonMaterial()) } } public CreateToonMaterial(color: THREE.ColorRepresentation = 0xff00aa, steps: number = 5): THREE.MeshToonMaterial { - const format = ( this._renderer.capabilities.isWebGL2 ) ? THREE.RedFormat : THREE.LuminanceFormat; - const colors = new Uint8Array(steps); - for ( let c = 0; c < colors.length; c ++ ) { - colors[c] = 128 + (c / colors.length) * 128; + const format = this._renderer.capabilities.isWebGL2 ? THREE.RedFormat : THREE.LuminanceFormat + const colors = new Uint8Array(steps) + for (let c = 0; c < colors.length; c++) { + colors[c] = 128 + (c / colors.length) * 128 } - const gradientMap = new THREE.DataTexture(colors, colors.length, 1, format); - gradientMap.needsUpdate = true; - return new THREE.MeshToonMaterial({color: color, gradientMap: gradientMap}); + const gradientMap = new THREE.DataTexture(colors, colors.length, 1, format) + gradientMap.needsUpdate = true + return new THREE.MeshToonMaterial({ + color: color, + gradientMap: gradientMap, + }) } } -export default SceneRenderer; \ No newline at end of file +export default SceneRenderer diff --git a/fission/src/systems/simulation/Brain.ts b/fission/src/systems/simulation/Brain.ts index 82bcf94dd9..a047d65671 100644 --- a/fission/src/systems/simulation/Brain.ts +++ b/fission/src/systems/simulation/Brain.ts @@ -1,17 +1,16 @@ -import Mechanism from "../physics/Mechanism"; +import Mechanism from "../physics/Mechanism" abstract class Brain { - - protected _mechanism: Mechanism; - + protected _mechanism: Mechanism + constructor(mechansim: Mechanism) { - this._mechanism = mechansim; + this._mechanism = mechansim } - public abstract Update(deltaT: number): void; + public abstract Update(deltaT: number): void - public abstract Enable(): void; - public abstract Disable(): void; + public abstract Enable(): void + public abstract Disable(): void } -export default Brain; \ No newline at end of file +export default Brain diff --git a/fission/src/systems/simulation/SimulationSystem.ts b/fission/src/systems/simulation/SimulationSystem.ts index ce95d15d46..a512eadc6d 100644 --- a/fission/src/systems/simulation/SimulationSystem.ts +++ b/fission/src/systems/simulation/SimulationSystem.ts @@ -1,113 +1,110 @@ -import JOLT from "@/util/loading/JoltSyncLoader"; -import Mechanism from "../physics/Mechanism"; -import WorldSystem from "../WorldSystem"; -import Brain from "./Brain"; -import Driver from "./driver/Driver"; -import Stimulus from "./stimulus/Stimulus"; -import HingeDriver from "./driver/HingeDriver"; -import WheelDriver from "./driver/WheelDriver"; -import SliderDriver from "./driver/SliderDriver"; -import HingeStimulus from "./stimulus/HingeStimulus"; -import WheelRotationStimulus from "./stimulus/WheelStimulus"; -import SliderStimulus from "./stimulus/SliderStimulus"; -import ChassisStimulus from "./stimulus/ChassisStimulus"; +import JOLT from "@/util/loading/JoltSyncLoader" +import Mechanism from "../physics/Mechanism" +import WorldSystem from "../WorldSystem" +import Brain from "./Brain" +import Driver from "./driver/Driver" +import Stimulus from "./stimulus/Stimulus" +import HingeDriver from "./driver/HingeDriver" +import WheelDriver from "./driver/WheelDriver" +import SliderDriver from "./driver/SliderDriver" +import HingeStimulus from "./stimulus/HingeStimulus" +import WheelRotationStimulus from "./stimulus/WheelStimulus" +import SliderStimulus from "./stimulus/SliderStimulus" +import ChassisStimulus from "./stimulus/ChassisStimulus" class SimulationSystem extends WorldSystem { - - private _simMechanisms: Map; + private _simMechanisms: Map constructor() { - super(); + super() - this._simMechanisms = new Map(); + this._simMechanisms = new Map() } public RegisterMechanism(mechanism: Mechanism) { - if (this._simMechanisms.has(mechanism)) - return; + if (this._simMechanisms.has(mechanism)) return - this._simMechanisms.set(mechanism, new SimulationLayer(mechanism)); + this._simMechanisms.set(mechanism, new SimulationLayer(mechanism)) } public GetSimulationLayer(mechanism: Mechanism): SimulationLayer | undefined { - return this._simMechanisms.get(mechanism); + return this._simMechanisms.get(mechanism) } public Update(deltaT: number): void { - this._simMechanisms.forEach(simLayer => simLayer.Update(deltaT)); + this._simMechanisms.forEach(simLayer => simLayer.Update(deltaT)) } public Destroy(): void { - this._simMechanisms.forEach(simLayer => simLayer.SetBrain(undefined)); - this._simMechanisms.clear(); + this._simMechanisms.forEach(simLayer => simLayer.SetBrain(undefined)) + this._simMechanisms.clear() } public UnregisterMechanism(mech: Mechanism): boolean { - const layer = this._simMechanisms.get(mech); + const layer = this._simMechanisms.get(mech) if (this._simMechanisms.delete(mech)) { layer?.SetBrain(undefined) - return true; + return true } else { - return false; + return false } } - } class SimulationLayer { - private _mechanism: Mechanism; - private _brain?: Brain; + private _mechanism: Mechanism + private _brain?: Brain - private _drivers: Driver[]; - private _stimuli: Stimulus[]; + private _drivers: Driver[] + private _stimuli: Stimulus[] - public get brain() { return this._brain; } + public get brain() { + return this._brain + } constructor(mechanism: Mechanism) { - this._mechanism = mechanism; + this._mechanism = mechanism // Generate standard drivers and stimuli - this._drivers = []; - this._stimuli = []; + this._drivers = [] + this._stimuli = [] this._mechanism.constraints.forEach(x => { if (x.constraint.GetSubType() == JOLT.EConstraintSubType_Hinge) { - const hinge = JOLT.castObject(x.constraint, JOLT.HingeConstraint); - const driver = new HingeDriver(hinge); - this._drivers.push(driver); - const stim = new HingeStimulus(hinge); - this._stimuli.push(stim); + const hinge = JOLT.castObject(x.constraint, JOLT.HingeConstraint) + const driver = new HingeDriver(hinge) + this._drivers.push(driver) + const stim = new HingeStimulus(hinge) + this._stimuli.push(stim) } else if (x.constraint.GetSubType() == JOLT.EConstraintSubType_Vehicle) { - const vehicle = JOLT.castObject(x.constraint, JOLT.VehicleConstraint); - const driver = new WheelDriver(vehicle); - this._drivers.push(driver); - const stim = new WheelRotationStimulus(vehicle.GetWheel(0)); - this._stimuli.push(stim); + const vehicle = JOLT.castObject(x.constraint, JOLT.VehicleConstraint) + const driver = new WheelDriver(vehicle) + this._drivers.push(driver) + const stim = new WheelRotationStimulus(vehicle.GetWheel(0)) + this._stimuli.push(stim) } else if (x.constraint.GetSubType() == JOLT.EConstraintSubType_Slider) { - const slider = JOLT.castObject(x.constraint, JOLT.SliderConstraint); - const driver = new SliderDriver(slider); - this._drivers.push(driver); - const stim = new SliderStimulus(slider); - this._stimuli.push(stim); + const slider = JOLT.castObject(x.constraint, JOLT.SliderConstraint) + const driver = new SliderDriver(slider) + this._drivers.push(driver) + const stim = new SliderStimulus(slider) + this._stimuli.push(stim) } - }); - this._stimuli.push(new ChassisStimulus(mechanism.nodeToBody.get(mechanism.rootBody)!)); + }) + this._stimuli.push(new ChassisStimulus(mechanism.nodeToBody.get(mechanism.rootBody)!)) } public Update(deltaT: number) { - this._brain?.Update(deltaT); - this._drivers.forEach(x => x.Update(deltaT)); - this._stimuli.forEach(x => x.Update(deltaT)); + this._brain?.Update(deltaT) + this._drivers.forEach(x => x.Update(deltaT)) + this._stimuli.forEach(x => x.Update(deltaT)) } public SetBrain(brain: T | undefined) { - if (this._brain) - this._brain.Disable(); + if (this._brain) this._brain.Disable() + + this._brain = brain - this._brain = brain; - - if (this._brain) - this._brain.Enable(); + if (this._brain) this._brain.Enable() } } -export default SimulationSystem; \ No newline at end of file +export default SimulationSystem diff --git a/fission/src/systems/simulation/driver/Driver.ts b/fission/src/systems/simulation/driver/Driver.ts index 19361c0361..39c3aefa0e 100644 --- a/fission/src/systems/simulation/driver/Driver.ts +++ b/fission/src/systems/simulation/driver/Driver.ts @@ -1,5 +1,5 @@ abstract class Driver { - public abstract Update(deltaT: number): void; + public abstract Update(deltaT: number): void } -export default Driver; \ No newline at end of file +export default Driver diff --git a/fission/src/systems/simulation/driver/HingeDriver.ts b/fission/src/systems/simulation/driver/HingeDriver.ts index 5e5c680baf..172a7cc095 100644 --- a/fission/src/systems/simulation/driver/HingeDriver.ts +++ b/fission/src/systems/simulation/driver/HingeDriver.ts @@ -1,91 +1,89 @@ -import Jolt from "@barclah/jolt-physics"; -import Driver from "./Driver"; -import { SIMULATION_PERIOD } from "@/systems/physics/PhysicsSystem"; -import JOLT from "@/util/loading/JoltSyncLoader"; +import Jolt from "@barclah/jolt-physics" +import Driver from "./Driver" +import { SIMULATION_PERIOD } from "@/systems/physics/PhysicsSystem" +import JOLT from "@/util/loading/JoltSyncLoader" class HingeDriver extends Driver { + private _constraint: Jolt.HingeConstraint - private _constraint: Jolt.HingeConstraint; - - private _controlMode: DriverControlMode = DriverControlMode.Velocity; - private _targetVelocity: number = 0.0; - private _targetAngle: number; + private _controlMode: DriverControlMode = DriverControlMode.Velocity + private _targetVelocity: number = 0.0 + private _targetAngle: number public get targetVelocity(): number { - return this._targetVelocity; + return this._targetVelocity } public set targetVelocity(radsPerSec: number) { - this._targetVelocity = radsPerSec; + this._targetVelocity = radsPerSec } public get targetAngle(): number { - return this._targetAngle; + return this._targetAngle } public set targetAngle(rads: number) { - this._targetAngle = rads; + this._targetAngle = rads } public set minTorqueLimit(nm: number) { - const motorSettings = this._constraint.GetMotorSettings(); - motorSettings.mMinTorqueLimit = nm; + const motorSettings = this._constraint.GetMotorSettings() + motorSettings.mMinTorqueLimit = nm } public set maxTorqueLimit(nm: number) { - const motorSettings = this._constraint.GetMotorSettings(); - motorSettings.mMaxTorqueLimit = nm; + const motorSettings = this._constraint.GetMotorSettings() + motorSettings.mMaxTorqueLimit = nm } public get controlMode(): DriverControlMode { - return this._controlMode; + return this._controlMode } public set controlMode(mode: DriverControlMode) { - this._controlMode = mode; + this._controlMode = mode switch (mode) { case DriverControlMode.Velocity: - this._constraint.SetMotorState(JOLT.EMotorState_Velocity); - break; + this._constraint.SetMotorState(JOLT.EMotorState_Velocity) + break case DriverControlMode.Position: - this._constraint.SetMotorState(JOLT.EMotorState_Position); - break; + this._constraint.SetMotorState(JOLT.EMotorState_Position) + break default: // idk - break; + break } } public constructor(constraint: Jolt.HingeConstraint) { - super(); + super() - this._constraint = constraint; + this._constraint = constraint - const motorSettings = this._constraint.GetMotorSettings(); - const springSettings = motorSettings.mSpringSettings; + const motorSettings = this._constraint.GetMotorSettings() + const springSettings = motorSettings.mSpringSettings // These values were selected based on the suggestions of the documentation for stiff control. - springSettings.mFrequency = 20 * (1.0 / SIMULATION_PERIOD); - springSettings.mDamping = 0.995; + springSettings.mFrequency = 20 * (1.0 / SIMULATION_PERIOD) + springSettings.mDamping = 0.995 - motorSettings.mSpringSettings = springSettings; - motorSettings.mMinTorqueLimit = -50.0; - motorSettings.mMaxTorqueLimit = 50.0; + motorSettings.mSpringSettings = springSettings + motorSettings.mMinTorqueLimit = -50.0 + motorSettings.mMaxTorqueLimit = 50.0 - this._targetAngle = this._constraint.GetCurrentAngle(); + this._targetAngle = this._constraint.GetCurrentAngle() - this.controlMode = DriverControlMode.Velocity; + this.controlMode = DriverControlMode.Velocity } public Update(_: number): void { if (this._controlMode == DriverControlMode.Velocity) { - this._constraint.SetTargetAngularVelocity(this._targetVelocity); + this._constraint.SetTargetAngularVelocity(this._targetVelocity) } else if (this._controlMode == DriverControlMode.Position) { - this._constraint.SetTargetAngle(this._targetAngle); + this._constraint.SetTargetAngle(this._targetAngle) } - } } export enum DriverControlMode { Velocity = 0, - Position = 1 + Position = 1, } -export default HingeDriver; \ No newline at end of file +export default HingeDriver diff --git a/fission/src/systems/simulation/driver/SliderDriver.ts b/fission/src/systems/simulation/driver/SliderDriver.ts index 9e6891f974..3fb4aa5d5a 100644 --- a/fission/src/systems/simulation/driver/SliderDriver.ts +++ b/fission/src/systems/simulation/driver/SliderDriver.ts @@ -1,51 +1,53 @@ -import Jolt from "@barclah/jolt-physics"; -import Driver from "./Driver"; -import { SIMULATION_PERIOD } from "@/systems/physics/PhysicsSystem"; -import JOLT from "@/util/loading/JoltSyncLoader"; +import Jolt from "@barclah/jolt-physics" +import Driver from "./Driver" +import { SIMULATION_PERIOD } from "@/systems/physics/PhysicsSystem" +import JOLT from "@/util/loading/JoltSyncLoader" class SliderDriver extends Driver { - - private _constraint: Jolt.SliderConstraint; - private _targetPosition: number = 0.0; + private _constraint: Jolt.SliderConstraint + private _targetPosition: number = 0.0 public get targetPosition(): number { - return this._targetPosition; + return this._targetPosition } public set targetPosition(position: number) { - this._targetPosition = Math.max(this._constraint.GetLimitsMin(), Math.min(this._constraint.GetLimitsMax(), position)); + this._targetPosition = Math.max( + this._constraint.GetLimitsMin(), + Math.min(this._constraint.GetLimitsMax(), position) + ) } public set minForceLimit(newtons: number) { - const motorSettings = this._constraint.GetMotorSettings(); - motorSettings.mMinForceLimit = newtons; + const motorSettings = this._constraint.GetMotorSettings() + motorSettings.mMinForceLimit = newtons } public set maxForceLimit(newtons: number) { - const motorSettings = this._constraint.GetMotorSettings(); - motorSettings.mMaxForceLimit = newtons; + const motorSettings = this._constraint.GetMotorSettings() + motorSettings.mMaxForceLimit = newtons } public constructor(constraint: Jolt.SliderConstraint) { - super(); + super() - this._constraint = constraint; + this._constraint = constraint - const motorSettings = this._constraint.GetMotorSettings(); - const springSettings = motorSettings.mSpringSettings; - springSettings.mFrequency = 20 * (1.0 / SIMULATION_PERIOD); - springSettings.mDamping = 0.995; + const motorSettings = this._constraint.GetMotorSettings() + const springSettings = motorSettings.mSpringSettings + springSettings.mFrequency = 20 * (1.0 / SIMULATION_PERIOD) + springSettings.mDamping = 0.995 - motorSettings.mSpringSettings = springSettings; - motorSettings.mMinForceLimit = -125.0; - motorSettings.mMaxForceLimit = 125.0; + motorSettings.mSpringSettings = springSettings + motorSettings.mMinForceLimit = -125.0 + motorSettings.mMaxForceLimit = 125.0 - this._constraint.SetMotorState(JOLT.EMotorState_Position); + this._constraint.SetMotorState(JOLT.EMotorState_Position) - this.targetPosition = this._constraint.GetCurrentPosition(); + this.targetPosition = this._constraint.GetCurrentPosition() } public Update(_: number): void { - this._constraint.SetTargetPosition(this._targetPosition); + this._constraint.SetTargetPosition(this._targetPosition) } } -export default SliderDriver; \ No newline at end of file +export default SliderDriver diff --git a/fission/src/systems/simulation/driver/WheelDriver.ts b/fission/src/systems/simulation/driver/WheelDriver.ts index d2b8c492ee..c39433ff18 100644 --- a/fission/src/systems/simulation/driver/WheelDriver.ts +++ b/fission/src/systems/simulation/driver/WheelDriver.ts @@ -1,38 +1,37 @@ -import Jolt from "@barclah/jolt-physics"; -import Driver from "./Driver"; -import JOLT from "@/util/loading/JoltSyncLoader"; +import Jolt from "@barclah/jolt-physics" +import Driver from "./Driver" +import JOLT from "@/util/loading/JoltSyncLoader" class WheelDriver extends Driver { + private _constraint: Jolt.VehicleConstraint + private _wheel: Jolt.WheelWV - private _constraint: Jolt.VehicleConstraint; - private _wheel: Jolt.WheelWV; - - private _targetWheelSpeed: number = 0.0; + private _targetWheelSpeed: number = 0.0 public get targetWheelSpeed(): number { - return this._targetWheelSpeed; + return this._targetWheelSpeed } public set targetWheelSpeed(radsPerSec: number) { - this._targetWheelSpeed = radsPerSec; + this._targetWheelSpeed = radsPerSec } public constructor(constraint: Jolt.VehicleConstraint) { - super(); + super() + + this._constraint = constraint + this._wheel = JOLT.castObject(this._constraint.GetWheel(0), JOLT.WheelWV) - this._constraint = constraint; - this._wheel = JOLT.castObject(this._constraint.GetWheel(0), JOLT.WheelWV); - - console.log(`Wheel X: ${constraint.GetVehicleBody().GetCenterOfMassPosition().GetX().toFixed(5)}`); + console.log(`Wheel X: ${constraint.GetVehicleBody().GetCenterOfMassPosition().GetX().toFixed(5)}`) if (constraint.GetVehicleBody().GetCenterOfMassPosition().GetX() < 0) { - this._targetWheelSpeed = 10.0; + this._targetWheelSpeed = 10.0 } else { - this._targetWheelSpeed = 10.0; + this._targetWheelSpeed = 10.0 } } public Update(_: number): void { - this._wheel.SetAngularVelocity(this._targetWheelSpeed); + this._wheel.SetAngularVelocity(this._targetWheelSpeed) } } -export default WheelDriver; \ No newline at end of file +export default WheelDriver diff --git a/fission/src/systems/simulation/stimulus/ChassisStimulus.ts b/fission/src/systems/simulation/stimulus/ChassisStimulus.ts index 6149ec2779..fa59a64f1b 100644 --- a/fission/src/systems/simulation/stimulus/ChassisStimulus.ts +++ b/fission/src/systems/simulation/stimulus/ChassisStimulus.ts @@ -1,32 +1,32 @@ -import Jolt from "@barclah/jolt-physics"; -import Stimulus from "./Stimulus"; -import World from "@/systems/World"; +import Jolt from "@barclah/jolt-physics" +import Stimulus from "./Stimulus" +import World from "@/systems/World" class ChassisStimulus extends Stimulus { - private _body: Jolt.Body; - private _mass: number; + private _body: Jolt.Body + private _mass: number public get linearVelocity(): Jolt.Vec3 { - return this._body.GetLinearVelocity(); + return this._body.GetLinearVelocity() } public get angularVelocity(): Jolt.Vec3 { - return this._body.GetAngularVelocity(); + return this._body.GetAngularVelocity() } public get acceleration(): Jolt.Vec3 { - return this._body.GetAccumulatedForce().Div(this._mass); + return this._body.GetAccumulatedForce().Div(this._mass) } public get rotation(): Jolt.Vec3 { - return this._body.GetRotation().GetEulerAngles(); + return this._body.GetRotation().GetEulerAngles() } public constructor(bodyId: Jolt.BodyID) { - super(); - - this._body = World.PhysicsSystem.GetBody(bodyId); - this._mass = this._body.GetShape().GetMassProperties().mMass; + super() + + this._body = World.PhysicsSystem.GetBody(bodyId) + this._mass = this._body.GetShape().GetMassProperties().mMass } - - public Update(_: number): void { } + + public Update(_: number): void {} } -export default ChassisStimulus; \ No newline at end of file +export default ChassisStimulus diff --git a/fission/src/systems/simulation/stimulus/EncoderStimulus.ts b/fission/src/systems/simulation/stimulus/EncoderStimulus.ts index 1daf39b438..bee93b4923 100644 --- a/fission/src/systems/simulation/stimulus/EncoderStimulus.ts +++ b/fission/src/systems/simulation/stimulus/EncoderStimulus.ts @@ -1,15 +1,14 @@ -import Stimulus from "./Stimulus"; +import Stimulus from "./Stimulus" abstract class EncoderStimulus extends Stimulus { - - public abstract get positionValue(): number; - public abstract get velocityValue(): number; + public abstract get positionValue(): number + public abstract get velocityValue(): number protected constructor() { - super(); + super() } - public abstract Update(_: number): void; + public abstract Update(_: number): void } -export default EncoderStimulus; \ No newline at end of file +export default EncoderStimulus diff --git a/fission/src/systems/simulation/stimulus/HingeStimulus.ts b/fission/src/systems/simulation/stimulus/HingeStimulus.ts index 91770de696..bcb8464275 100644 --- a/fission/src/systems/simulation/stimulus/HingeStimulus.ts +++ b/fission/src/systems/simulation/stimulus/HingeStimulus.ts @@ -1,43 +1,45 @@ -import Jolt from "@barclah/jolt-physics"; -import EncoderStimulus from "./EncoderStimulus"; +import Jolt from "@barclah/jolt-physics" +import EncoderStimulus from "./EncoderStimulus" class HingeStimulus extends EncoderStimulus { - private _accum: boolean = false; - private _hingeAngleAccum: number = 0.0; - private _hinge: Jolt.HingeConstraint; + private _accum: boolean = false + private _hingeAngleAccum: number = 0.0 + private _hinge: Jolt.HingeConstraint public get positionValue(): number { if (this._accum) { - return this._hingeAngleAccum; + return this._hingeAngleAccum } else { - return this._hinge.GetCurrentAngle(); + return this._hinge.GetCurrentAngle() } } public get velocityValue(): number { - return 0.0; + return 0.0 } public set accum(shouldAccum: boolean) { if (!this._accum && shouldAccum) { - this.resetAccum(); + this.resetAccum() } - this._accum = shouldAccum; + this._accum = shouldAccum } public constructor(hinge: Jolt.HingeConstraint) { - super(); + super() + + this._hinge = hinge + } - this._hinge = hinge; - } - public Update(deltaT: number): void { if (this._accum) { - this._hingeAngleAccum += this._hinge.GetTargetAngularVelocity() * deltaT; + this._hingeAngleAccum += this._hinge.GetTargetAngularVelocity() * deltaT } } - public resetAccum() { this._hingeAngleAccum = 0.0; } + public resetAccum() { + this._hingeAngleAccum = 0.0 + } } -export default HingeStimulus; \ No newline at end of file +export default HingeStimulus diff --git a/fission/src/systems/simulation/stimulus/SliderStimulus.ts b/fission/src/systems/simulation/stimulus/SliderStimulus.ts index 6567aed629..0e66eb63b6 100644 --- a/fission/src/systems/simulation/stimulus/SliderStimulus.ts +++ b/fission/src/systems/simulation/stimulus/SliderStimulus.ts @@ -1,29 +1,28 @@ -import Jolt from "@barclah/jolt-physics"; -import EncoderStimulus from "./EncoderStimulus"; +import Jolt from "@barclah/jolt-physics" +import EncoderStimulus from "./EncoderStimulus" class SliderStimulus extends EncoderStimulus { - - private _slider: Jolt.SliderConstraint; - private _velocity: number = 0.0; + private _slider: Jolt.SliderConstraint + private _velocity: number = 0.0 public get positionValue(): number { - return this._slider.GetCurrentPosition(); + return this._slider.GetCurrentPosition() } public get velocityValue(): number { - return this._velocity; + return this._velocity } - + public constructor(slider: Jolt.SliderConstraint) { - super(); + super() - this._slider = slider; + this._slider = slider } - private _lastPosition: number = 0.0; + private _lastPosition: number = 0.0 public Update(deltaT: number): void { - this._velocity = (this._slider.GetCurrentPosition() - this._lastPosition) / deltaT; - this._lastPosition = this._slider.GetCurrentPosition(); + this._velocity = (this._slider.GetCurrentPosition() - this._lastPosition) / deltaT + this._lastPosition = this._slider.GetCurrentPosition() } } -export default SliderStimulus; \ No newline at end of file +export default SliderStimulus diff --git a/fission/src/systems/simulation/stimulus/Stimulus.ts b/fission/src/systems/simulation/stimulus/Stimulus.ts index 576cf632f8..5dd744cce8 100644 --- a/fission/src/systems/simulation/stimulus/Stimulus.ts +++ b/fission/src/systems/simulation/stimulus/Stimulus.ts @@ -1,5 +1,5 @@ abstract class Stimulus { - public abstract Update(deltaT: number): void; + public abstract Update(deltaT: number): void } -export default Stimulus; \ No newline at end of file +export default Stimulus diff --git a/fission/src/systems/simulation/stimulus/WheelStimulus.ts b/fission/src/systems/simulation/stimulus/WheelStimulus.ts index 4edce43cd1..cfb6206085 100644 --- a/fission/src/systems/simulation/stimulus/WheelStimulus.ts +++ b/fission/src/systems/simulation/stimulus/WheelStimulus.ts @@ -1,46 +1,48 @@ -import Jolt from "@barclah/jolt-physics"; -import EncoderStimulus from "./EncoderStimulus"; +import Jolt from "@barclah/jolt-physics" +import EncoderStimulus from "./EncoderStimulus" /** - * + * */ class WheelRotationStimulus extends EncoderStimulus { - private _accum: boolean = true; - private _wheelRotationAccum = 0.0; - private _wheel: Jolt.Wheel; - + private _accum: boolean = true + private _wheelRotationAccum = 0.0 + private _wheel: Jolt.Wheel + public get positionValue(): number { if (this._accum) { - return this._wheelRotationAccum; + return this._wheelRotationAccum } else { - return this._wheel.GetRotationAngle(); + return this._wheel.GetRotationAngle() } } public get velocityValue(): number { - return this._wheel.GetAngularVelocity(); + return this._wheel.GetAngularVelocity() } public set accum(shouldAccum: boolean) { if (!this._accum && shouldAccum) { - this.resetAccum(); + this.resetAccum() } - this._accum = shouldAccum; + this._accum = shouldAccum } public constructor(wheel: Jolt.Wheel) { - super(); + super() - this._wheel = wheel; + this._wheel = wheel } public Update(deltaT: number): void { if (this._accum) { - this._wheelRotationAccum += this._wheel.GetAngularVelocity() * deltaT; + this._wheelRotationAccum += this._wheel.GetAngularVelocity() * deltaT } } - public resetAccum() { this._wheelRotationAccum = 0.0; } + public resetAccum() { + this._wheelRotationAccum = 0.0 + } } -export default WheelRotationStimulus; \ No newline at end of file +export default WheelRotationStimulus diff --git a/fission/src/systems/simulation/synthesis_brain/Behavior.ts b/fission/src/systems/simulation/synthesis_brain/Behavior.ts index 90fb1b1bdc..5745035a0c 100644 --- a/fission/src/systems/simulation/synthesis_brain/Behavior.ts +++ b/fission/src/systems/simulation/synthesis_brain/Behavior.ts @@ -1,18 +1,21 @@ -import Driver from "../driver/Driver"; -import Stimulus from "../stimulus/Stimulus"; +import Driver from "../driver/Driver" +import Stimulus from "../stimulus/Stimulus" abstract class Behavior { + private _drivers: Driver[] + private _stimuli: Stimulus[] - private _drivers: Driver[]; - private _stimuli: Stimulus[]; - - protected get drivers() { return this._drivers; } - protected get stimuli() { return this._stimuli; } + protected get drivers() { + return this._drivers + } + protected get stimuli() { + return this._stimuli + } constructor(drivers: Driver[], stimuli: Stimulus[]) { - this._drivers = drivers; - this._stimuli = stimuli; + this._drivers = drivers + this._stimuli = stimuli } } -export default Behavior; \ No newline at end of file +export default Behavior diff --git a/fission/src/systems/simulation/synthesis_brain/SynthesisBrain.ts b/fission/src/systems/simulation/synthesis_brain/SynthesisBrain.ts index d17a1e993f..5c9020ffd1 100644 --- a/fission/src/systems/simulation/synthesis_brain/SynthesisBrain.ts +++ b/fission/src/systems/simulation/synthesis_brain/SynthesisBrain.ts @@ -1,21 +1,19 @@ -import Mechanism from "@/systems/physics/Mechanism"; -import Brain from "../Brain"; -import Behavior from "./Behavior"; +import Mechanism from "@/systems/physics/Mechanism" +import Brain from "../Brain" +import Behavior from "./Behavior" class SynthesisBrain extends Brain { - - public _behaviors: Behavior[] = []; + public _behaviors: Behavior[] = [] public constructor(mechanism: Mechanism) { - super(mechanism); + super(mechanism) } - public Update(_: number): void { } - public Enable(): void { } + public Update(_: number): void {} + public Enable(): void {} public Disable(): void { - this._behaviors = []; + this._behaviors = [] } - } -export default SynthesisBrain; \ No newline at end of file +export default SynthesisBrain diff --git a/fission/src/test/MirabufParser.test.ts b/fission/src/test/MirabufParser.test.ts index 881471d42f..84d91a1582 100644 --- a/fission/src/test/MirabufParser.test.ts +++ b/fission/src/test/MirabufParser.test.ts @@ -1,47 +1,47 @@ -import { describe, test, expect } from "vitest"; +import { describe, test, expect } from "vitest" -import { mirabuf } from "../proto/mirabuf"; -import MirabufParser, { RigidNodeReadOnly } from "../mirabuf/MirabufParser"; -import { LoadMirabufLocal } from "../mirabuf/MirabufLoader"; +import { mirabuf } from "../proto/mirabuf" +import MirabufParser, { RigidNodeReadOnly } from "../mirabuf/MirabufParser" +import { LoadMirabufLocal } from "../mirabuf/MirabufLoader" -describe('Mirabuf Parser Tests', () => { - test('Generate Rigid Nodes (Dozer_v9.mira)', () => { - const spikeMira = LoadMirabufLocal('./public/Downloadables/Mira/Robots/Dozer_v9.mira'); +describe("Mirabuf Parser Tests", () => { + test("Generate Rigid Nodes (Dozer_v9.mira)", () => { + const spikeMira = LoadMirabufLocal("./public/Downloadables/Mira/Robots/Dozer_v9.mira") - const t = new MirabufParser(spikeMira); - const rn = t.rigidNodes; + const t = new MirabufParser(spikeMira) + const rn = t.rigidNodes - expect(filterNonPhysicsNodes(rn, spikeMira).length).toBe(7); - }); + expect(filterNonPhysicsNodes(rn, spikeMira).length).toBe(7) + }) - test('Generate Rigid Nodes (FRC_Field_2018_v14.mira)', () => { - const field = LoadMirabufLocal('./public/Downloadables/Mira/Fields/FRC Field 2018_v13.mira'); + test("Generate Rigid Nodes (FRC_Field_2018_v14.mira)", () => { + const field = LoadMirabufLocal("./public/Downloadables/Mira/Fields/FRC Field 2018_v13.mira") - const t = new MirabufParser(field); + const t = new MirabufParser(field) - expect(filterNonPhysicsNodes(t.rigidNodes, field).length).toBe(34); - }); + expect(filterNonPhysicsNodes(t.rigidNodes, field).length).toBe(34) + }) - test('Generate Rigid Nodes (Team_2471_(2018)_v7.mira)', () => { - const mm = LoadMirabufLocal('./public/Downloadables/Mira/Robots/Team 2471 (2018)_v7.mira'); + test("Generate Rigid Nodes (Team_2471_(2018)_v7.mira)", () => { + const mm = LoadMirabufLocal("./public/Downloadables/Mira/Robots/Team 2471 (2018)_v7.mira") - const t = new MirabufParser(mm); + const t = new MirabufParser(mm) - expect(filterNonPhysicsNodes(t.rigidNodes, mm).length).toBe(10); - }); -}); + expect(filterNonPhysicsNodes(t.rigidNodes, mm).length).toBe(10) + }) +}) function filterNonPhysicsNodes(nodes: RigidNodeReadOnly[], mira: mirabuf.Assembly): RigidNodeReadOnly[] { return nodes.filter(x => { for (const part of x.parts) { - const inst = mira.data!.parts!.partInstances![part]!; - const def = mira.data!.parts!.partDefinitions![inst.partDefinitionReference!]!; + const inst = mira.data!.parts!.partInstances![part]! + const def = mira.data!.parts!.partDefinitions![inst.partDefinitionReference!]! if (def.bodies && def.bodies.length > 0) { - return true; + return true } } - return false; - }); + return false + }) } // function printRigidNodeParts(nodes: RigidNodeReadOnly[], mira: mirabuf.Assembly) { @@ -50,4 +50,4 @@ function filterNonPhysicsNodes(nodes: RigidNodeReadOnly[], mira: mirabuf.Assembl // x.parts.forEach(y => console.log(`-> '${mira.data!.parts!.partInstances![y]!.info!.name!}'`)); // console.log(''); // }); -// } \ No newline at end of file +// } diff --git a/fission/src/test/PhysicsSystem.test.ts b/fission/src/test/PhysicsSystem.test.ts index 71246ece9b..692989e8e9 100644 --- a/fission/src/test/PhysicsSystem.test.ts +++ b/fission/src/test/PhysicsSystem.test.ts @@ -1,85 +1,69 @@ -import { test, expect, describe, assert } from 'vitest'; -import PhysicsSystem, { LayerReserve } from '../systems/physics/PhysicsSystem'; -import { LoadMirabufLocal } from '@/mirabuf/MirabufLoader'; -import MirabufParser from '@/mirabuf/MirabufParser'; +import { test, expect, describe, assert } from "vitest" +import PhysicsSystem, { LayerReserve } from "../systems/physics/PhysicsSystem" +import { LoadMirabufLocal } from "@/mirabuf/MirabufLoader" +import MirabufParser from "@/mirabuf/MirabufParser" -describe('Physics Sansity Checks', () => { - test('Convex Hull Shape (Cube)', () => { - const points: Float32Array = new Float32Array( - [ - 0.5, -0.5, 0.5, - -0.5, -0.5, 0.5, - -0.5, -0.5, -0.5, - 0.5, -0.5, -0.5, - 0.5, 0.5, 0.5, - -0.5, 0.5, 0.5, - -0.5, 0.5, -0.5, - 0.5, 0.5, -0.5, - ] - ); +describe("Physics Sansity Checks", () => { + test("Convex Hull Shape (Cube)", () => { + const points: Float32Array = new Float32Array([ + 0.5, -0.5, 0.5, -0.5, -0.5, 0.5, -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, -0.5, + 0.5, -0.5, 0.5, 0.5, -0.5, + ]) - const system = new PhysicsSystem(); - const shapeResult = system.CreateConvexHull(points); + const system = new PhysicsSystem() + const shapeResult = system.CreateConvexHull(points) - assert(shapeResult.HasError() == false, shapeResult.GetError().c_str()); - expect(shapeResult.IsValid()).toBe(true); - - const shape = shapeResult.Get(); + assert(shapeResult.HasError() == false, shapeResult.GetError().c_str()) + expect(shapeResult.IsValid()).toBe(true) - expect(shape.GetVolume() - 1.0).toBeLessThan(0.001); - expect(shape.GetCenterOfMass().Length()).toBe(0.0); + const shape = shapeResult.Get() - shape.Release(); - system.Destroy(); + expect(shape.GetVolume() - 1.0).toBeLessThan(0.001) + expect(shape.GetCenterOfMass().Length()).toBe(0.0) - }); - test('Convex Hull Shape (Tetrahedron)', () => { - const points: Float32Array = new Float32Array( - [ - 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, - 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0 - ] - ); + shape.Release() + system.Destroy() + }) + test("Convex Hull Shape (Tetrahedron)", () => { + const points: Float32Array = new Float32Array([0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0]) - const system = new PhysicsSystem(); - const shapeResult = system.CreateConvexHull(points); + const system = new PhysicsSystem() + const shapeResult = system.CreateConvexHull(points) - assert(shapeResult.HasError() == false, shapeResult.GetError().c_str()); - expect(shapeResult.IsValid()).toBe(true); - - const shape = shapeResult.Get(); - const bounds = shape.GetLocalBounds(); - const boxSize = bounds.mMax.Sub(bounds.mMin); - - expect(boxSize.GetX() - 1.0).toBeLessThan(0.001); - expect(boxSize.GetY() - 1.0).toBeLessThan(0.001); - expect(boxSize.GetZ() - 1.0).toBeLessThan(0.001); - expect(shape.GetVolume() - (1.0 / 6.0)).toBeLessThan(0.001); - expect(shape.GetMassProperties().mMass - 6.0).toBeLessThan(0.001); + assert(shapeResult.HasError() == false, shapeResult.GetError().c_str()) + expect(shapeResult.IsValid()).toBe(true) - shape.Release(); - system.Destroy(); - }); -}); + const shape = shapeResult.Get() + const bounds = shape.GetLocalBounds() + const boxSize = bounds.mMax.Sub(bounds.mMin) -describe('Mirabuf Physics Loading', () => { - test('Body Loading (Dozer)', () => { - const assembly = LoadMirabufLocal('./public/Downloadables/Mira/Robots/Dozer_v9.mira'); - const parser = new MirabufParser(assembly); - const physSystem = new PhysicsSystem(); - const mapping = physSystem.CreateBodiesFromParser(parser, new LayerReserve()); + expect(boxSize.GetX() - 1.0).toBeLessThan(0.001) + expect(boxSize.GetY() - 1.0).toBeLessThan(0.001) + expect(boxSize.GetZ() - 1.0).toBeLessThan(0.001) + expect(shape.GetVolume() - 1.0 / 6.0).toBeLessThan(0.001) + expect(shape.GetMassProperties().mMass - 6.0).toBeLessThan(0.001) - expect(mapping.size).toBe(7); - }); + shape.Release() + system.Destroy() + }) +}) - test('Body Loading (Team_2471_(2018)_v7.mira)', () => { - const assembly = LoadMirabufLocal('./public/Downloadables/Mira/Robots/Team 2471 (2018)_v7.mira'); - const parser = new MirabufParser(assembly); - const physSystem = new PhysicsSystem(); - const mapping = physSystem.CreateBodiesFromParser(parser, new LayerReserve()); +describe("Mirabuf Physics Loading", () => { + test("Body Loading (Dozer)", () => { + const assembly = LoadMirabufLocal("./public/Downloadables/Mira/Robots/Dozer_v9.mira") + const parser = new MirabufParser(assembly) + const physSystem = new PhysicsSystem() + const mapping = physSystem.CreateBodiesFromParser(parser, new LayerReserve()) - expect(mapping.size).toBe(10); - }); -}); \ No newline at end of file + expect(mapping.size).toBe(7) + }) + + test("Body Loading (Team_2471_(2018)_v7.mira)", () => { + const assembly = LoadMirabufLocal("./public/Downloadables/Mira/Robots/Team 2471 (2018)_v7.mira") + const parser = new MirabufParser(assembly) + const physSystem = new PhysicsSystem() + const mapping = physSystem.CreateBodiesFromParser(parser, new LayerReserve()) + + expect(mapping.size).toBe(10) + }) +}) diff --git a/fission/src/test/World.test.ts b/fission/src/test/World.test.ts index 2ffb335834..b3c4bdfcaf 100644 --- a/fission/src/test/World.test.ts +++ b/fission/src/test/World.test.ts @@ -1,19 +1,18 @@ -import World from "@/systems/World"; -import { describe, test, expect, beforeEach, vi } from "vitest"; - -describe('World Tests', () => { +import World from "@/systems/World" +import { describe, test, expect, beforeEach, vi } from "vitest" +describe("World Tests", () => { beforeEach(() => { - vi.resetAllMocks(); - }); + vi.resetAllMocks() + }) - test('World Sanity Check', () => { - expect(World.isAlive).toBeFalsy(); + test("World Sanity Check", () => { + expect(World.isAlive).toBeFalsy() // TODO: Find a way to mock window global // World.InitWorld(); // expect(World.isAlive).toBeTruthy(); // expect(World.SceneRenderer).toBeTruthy(); // expect(World.DestroyWorld).toBeTruthy(); - }); -}) \ No newline at end of file + }) +}) diff --git a/fission/src/test/aps/APS.test.ts b/fission/src/test/aps/APS.test.ts index 3e7da5f219..2721a33633 100644 --- a/fission/src/test/aps/APS.test.ts +++ b/fission/src/test/aps/APS.test.ts @@ -1,11 +1,11 @@ -import APS from "@/aps/APS"; -import { describe, expect, test } from "vitest"; +import APS from "@/aps/APS" +import { describe, expect, test } from "vitest" -describe('APS', () => { - test('Generate Random Strings (10)', () => { - const s = APS.genRandomString(10); +describe("APS", () => { + test("Generate Random Strings (10)", () => { + const s = APS.genRandomString(10) - (async () => { + ;(async () => { const [v, c] = await APS.codeChallenge() console.log(`${v}`) console.log(`${c}`) @@ -18,7 +18,7 @@ describe('APS', () => { expect(matches![0]).toBe(s) }) - test('Generate Random Strings (50)', () => { + test("Generate Random Strings (50)", () => { const s = APS.genRandomString(50) expect(s.length).toBe(50) @@ -28,7 +28,7 @@ describe('APS', () => { expect(matches![0]).toBe(s) }) - test('Generate Random Strings (75)', () => { + test("Generate Random Strings (75)", () => { const s = APS.genRandomString(75) expect(s.length).toBe(75) @@ -37,4 +37,4 @@ describe('APS', () => { expect(matches!.length).toBeGreaterThanOrEqual(1) expect(matches![0]).toBe(s) }) -}) \ No newline at end of file +}) diff --git a/fission/src/test/util/Queue.test.ts b/fission/src/test/util/Queue.test.ts index 13b0a9f985..c9a4cde694 100644 --- a/fission/src/test/util/Queue.test.ts +++ b/fission/src/test/util/Queue.test.ts @@ -1,76 +1,76 @@ -import { test, expect, describe } from 'vitest'; +import { test, expect, describe } from "vitest" -import Queue from '../../util/Queue'; -import { Random } from '../../util/Random'; +import Queue from "../../util/Queue" +import { Random } from "../../util/Random" -describe('Queue Tests', () => { - test('Create Empty', () => { - const q = new Queue(); - expect(q.Dequeue()).toBeUndefined(); - expect(q.size).toBe(0); - }); +describe("Queue Tests", () => { + test("Create Empty", () => { + const q = new Queue() + expect(q.Dequeue()).toBeUndefined() + expect(q.size).toBe(0) + }) - test('Single Element', () => { - const q = new Queue(); - const element = 5; - q.Enqueue(element); + test("Single Element", () => { + const q = new Queue() + const element = 5 + q.Enqueue(element) - expect(q.size).toBe(1); - expect(q.Dequeue()).toBe(element); - expect(q.size).toBe(0); - }); + expect(q.size).toBe(1) + expect(q.Dequeue()).toBe(element) + expect(q.size).toBe(0) + }) - test('Five Elements', () => { - const q = new Queue(); - const elements = [ 1, 4, 5, 2, 6 ]; - q.Enqueue(...elements); + test("Five Elements", () => { + const q = new Queue() + const elements = [1, 4, 5, 2, 6] + q.Enqueue(...elements) - let expectedSize = elements.length; + let expectedSize = elements.length for (const element of elements) { - expect(q.size).toBe(expectedSize); - expect(q.Dequeue()).toBe(element); - expectedSize--; + expect(q.size).toBe(expectedSize) + expect(q.Dequeue()).toBe(element) + expectedSize-- } - expect(q.size).toBe(0); - expect(q.Dequeue()).toBeUndefined(); - }); + expect(q.size).toBe(0) + expect(q.Dequeue()).toBeUndefined() + }) - test('Add 5, Remove 3, Add 8, Remove All', () => { - const q = new Queue(); - const elementsA = [ 1, 4, 5, 2, 6 ]; - const elementsB = [ 1, 4, 5, 2, 6, 9, 10, 54 ]; + test("Add 5, Remove 3, Add 8, Remove All", () => { + const q = new Queue() + const elementsA = [1, 4, 5, 2, 6] + const elementsB = [1, 4, 5, 2, 6, 9, 10, 54] - q.Enqueue(...elementsA); - expect(q.size).toBe(5); + q.Enqueue(...elementsA) + expect(q.size).toBe(5) for (let i = 0; i < 3; i++) { - expect(q.Dequeue()).toBe(elementsA[i]); - expect(q.size).toBe(elementsA.length - (i + 1)); + expect(q.Dequeue()).toBe(elementsA[i]) + expect(q.size).toBe(elementsA.length - (i + 1)) } - q.Enqueue(...elementsB); - expect(q.size).toBe(10); + q.Enqueue(...elementsB) + expect(q.size).toBe(10) for (let i = 0; i < 2; i++) { - expect(q.Dequeue()).toBe(elementsA[i + 3]); - expect(q.size).toBe(9 - i); + expect(q.Dequeue()).toBe(elementsA[i + 3]) + expect(q.size).toBe(9 - i) } for (let i = 0; i < 8; i++) { - expect(q.Dequeue()).toBe(elementsB[i]); - expect(q.size).toBe(7 - i); + expect(q.Dequeue()).toBe(elementsB[i]) + expect(q.size).toBe(7 - i) } - expect(q.size).toBe(0); - expect(q.Dequeue()).toBeUndefined(); - }); + expect(q.size).toBe(0) + expect(q.Dequeue()).toBeUndefined() + }) - test('Queue Clone (100 Elements)', () => { - const q1 = new Queue(); + test("Queue Clone (100 Elements)", () => { + const q1 = new Queue() for (let i = 0; i < 100; i++) { - q1.Enqueue(Math.floor(Random() * 400)); + q1.Enqueue(Math.floor(Random() * 400)) } - const q2 = q1.Clone(); - expect(q2.size).toBe(q1.size); + const q2 = q1.Clone() + expect(q2.size).toBe(q1.size) for (let i = 0; i < q1.size; i++) { - expect(q2.Dequeue()).toBe(q1.Dequeue()); + expect(q2.Dequeue()).toBe(q1.Dequeue()) } - }); -}); \ No newline at end of file + }) +}) diff --git a/fission/src/test/util/Random.test.ts b/fission/src/test/util/Random.test.ts index c19ab10d68..e26c78f1eb 100644 --- a/fission/src/test/util/Random.test.ts +++ b/fission/src/test/util/Random.test.ts @@ -1,13 +1,13 @@ -import { test, expect, describe } from 'vitest'; -import * as Random from '../../util/Random'; +import { test, expect, describe } from "vitest" +import * as Random from "../../util/Random" -describe('Random Number Generator Tests', () => { - test('Range Compliance', () => { - Random.SeedRandomGen(67542431); +describe("Random Number Generator Tests", () => { + test("Range Compliance", () => { + Random.SeedRandomGen(67542431) for (let i = 0; i < 99; i++) { - const a = Random.Random(); - expect(a).toBeLessThan(1.0); - expect(a).toBeGreaterThanOrEqual(0.0); + const a = Random.Random() + expect(a).toBeLessThan(1.0) + expect(a).toBeGreaterThanOrEqual(0.0) } - }); -}); \ No newline at end of file + }) +}) diff --git a/fission/src/test/util/TypeConversions.test.ts b/fission/src/test/util/TypeConversions.test.ts index a3049957b2..7988c2905c 100644 --- a/fission/src/test/util/TypeConversions.test.ts +++ b/fission/src/test/util/TypeConversions.test.ts @@ -1,165 +1,151 @@ -import { test, expect, describe } from 'vitest'; -import * as THREE from 'three'; -import { JoltMat44_ThreeMatrix4, MirabufTransform_ThreeMatrix4, ThreeEuler_JoltQuat, ThreeMatrix4_JoltMat44, ThreeQuaternion_JoltQuat, ThreeVector3_JoltVec3, _JoltQuat } from '../../util/TypeConversions'; -import { mirabuf } from '../../proto/mirabuf'; -import JOLT from '../../util/loading/JoltSyncLoader'; -import Jolt from '@barclah/jolt-physics'; - -describe('Three to Jolt Conversions', async () => { - +import { test, expect, describe } from "vitest" +import * as THREE from "three" +import { + JoltMat44_ThreeMatrix4, + MirabufTransform_ThreeMatrix4, + ThreeEuler_JoltQuat, + ThreeMatrix4_JoltMat44, + ThreeQuaternion_JoltQuat, + ThreeVector3_JoltVec3, + _JoltQuat, +} from "../../util/TypeConversions" +import { mirabuf } from "../../proto/mirabuf" +import JOLT from "../../util/loading/JoltSyncLoader" +import Jolt from "@barclah/jolt-physics" + +describe("Three to Jolt Conversions", async () => { function compareMat(tM: THREE.Matrix4, jM: Jolt.Mat44) { - const threeArr = tM.toArray(); + const threeArr = tM.toArray() for (let c = 0; c < 4; c++) { - const column = jM.GetColumn4(c); + const column = jM.GetColumn4(c) for (let r = 0; r < 4; r++) { - expect(threeArr[c * 4 + r]).toBeCloseTo(column.GetComponent(r), 4); + expect(threeArr[c * 4 + r]).toBeCloseTo(column.GetComponent(r), 4) } - JOLT.destroy(column); + JOLT.destroy(column) } - const threeTranslation = new THREE.Vector3(); - const threeRotation = new THREE.Quaternion(); - const threeScale = new THREE.Vector3(); - tM.decompose(threeTranslation, threeRotation, threeScale); + const threeTranslation = new THREE.Vector3() + const threeRotation = new THREE.Quaternion() + const threeScale = new THREE.Vector3() + tM.decompose(threeTranslation, threeRotation, threeScale) - const joltTranslation = jM.GetTranslation(); - const joltRotation = jM.GetQuaternion(); - const joltScale = new JOLT.Vec3(1, 1, 1); + const joltTranslation = jM.GetTranslation() + const joltRotation = jM.GetQuaternion() + const joltScale = new JOLT.Vec3(1, 1, 1) - expect(joltTranslation.GetX()).toBeCloseTo(threeTranslation.x, 4); - expect(joltTranslation.GetY()).toBeCloseTo(threeTranslation.y, 4); - expect(joltTranslation.GetZ()).toBeCloseTo(threeTranslation.z, 4); + expect(joltTranslation.GetX()).toBeCloseTo(threeTranslation.x, 4) + expect(joltTranslation.GetY()).toBeCloseTo(threeTranslation.y, 4) + expect(joltTranslation.GetZ()).toBeCloseTo(threeTranslation.z, 4) // JOLT.destroy(joltTranslation); // Causes error for some reason? - expect(joltRotation.GetX()).toBeCloseTo(threeRotation.x, 4); - expect(joltRotation.GetY()).toBeCloseTo(threeRotation.y, 4); - expect(joltRotation.GetZ()).toBeCloseTo(threeRotation.z, 4); - expect(joltRotation.GetW()).toBeCloseTo(threeRotation.w, 4); - JOLT.destroy(joltRotation); - expect(joltScale.GetX()).toBeCloseTo(threeScale.x, 4); - expect(joltScale.GetY()).toBeCloseTo(threeScale.y, 4); - expect(joltScale.GetZ()).toBeCloseTo(threeScale.z, 4); - JOLT.destroy(joltScale); + expect(joltRotation.GetX()).toBeCloseTo(threeRotation.x, 4) + expect(joltRotation.GetY()).toBeCloseTo(threeRotation.y, 4) + expect(joltRotation.GetZ()).toBeCloseTo(threeRotation.z, 4) + expect(joltRotation.GetW()).toBeCloseTo(threeRotation.w, 4) + JOLT.destroy(joltRotation) + expect(joltScale.GetX()).toBeCloseTo(threeScale.x, 4) + expect(joltScale.GetY()).toBeCloseTo(threeScale.y, 4) + expect(joltScale.GetZ()).toBeCloseTo(threeScale.z, 4) + JOLT.destroy(joltScale) } - test('THREE.Vector3 -> Jolt.Vec3', () => { - const a = new THREE.Vector3(2, 4, 1); - const joltVec = ThreeVector3_JoltVec3(a); - - expect(joltVec.GetX()).toBe(a.x); - expect(joltVec.GetY()).toBe(a.y); - expect(joltVec.GetZ()).toBe(a.z); - expect(joltVec.Length() - a.length()).toBeLessThan(0.0001); - }); - - test('THREE.Euler -> Jolt.Quat', () => { - const a = new THREE.Euler(30, 60, 15); - const joltQuat = ThreeEuler_JoltQuat(a); - const threeQuat = new THREE.Quaternion(); - threeQuat.setFromEuler(a); - - expect(joltQuat.GetX() - threeQuat.x).toBeLessThan(0.0001); - expect(joltQuat.GetY() - threeQuat.y).toBeLessThan(0.0001); - expect(joltQuat.GetZ() - threeQuat.z).toBeLessThan(0.0001); - expect(joltQuat.GetW() - threeQuat.w).toBeLessThan(0.0001); - }); - - test('THREE.Quaternion -> Jolt.Quat', () => { - const a = new THREE.Quaternion(0.285, 0.450, 0.237, 0.812); - a.normalize(); - const joltQuat = ThreeQuaternion_JoltQuat(a); - - expect(joltQuat.GetX() - a.x).toBeLessThan(0.0001); - expect(joltQuat.GetY() - a.y).toBeLessThan(0.0001); - expect(joltQuat.GetZ() - a.z).toBeLessThan(0.0001); - expect(joltQuat.GetW() - a.w).toBeLessThan(0.0001); - }); - - test('THREE.Quaterion -> Jolt.Quat (General Func)', () => { - const a = new THREE.Quaternion(0.285, 0.450, 0.237, 0.812); - a.normalize(); - const joltQuat = _JoltQuat(a); - - expect(joltQuat.GetX() - a.x).toBeLessThan(0.0001); - expect(joltQuat.GetY() - a.y).toBeLessThan(0.0001); - expect(joltQuat.GetZ() - a.z).toBeLessThan(0.0001); - expect(joltQuat.GetW() - a.w).toBeLessThan(0.0001); - }); - - test('THREE.Euler -> Jolt.Quat (General Func)', () => { - const a = new THREE.Euler(30, 60, 15); - const joltQuat = _JoltQuat(a); - const threeQuat = new THREE.Quaternion(); - threeQuat.setFromEuler(a); - - expect(joltQuat.GetX() - threeQuat.x).toBeLessThan(0.0001); - expect(joltQuat.GetY() - threeQuat.y).toBeLessThan(0.0001); - expect(joltQuat.GetZ() - threeQuat.z).toBeLessThan(0.0001); - expect(joltQuat.GetW() - threeQuat.w).toBeLessThan(0.0001); - }); - - test('undefined -> Jolt.Quat (General Func)', () => { - const joltQuat = _JoltQuat(undefined); - - expect(joltQuat.GetX()).toBe(0.0); - expect(joltQuat.GetY()).toBe(0.0); - expect(joltQuat.GetZ()).toBe(0.0); - expect(joltQuat.GetW()).toBe(1.0); - }); - - test('THREE.Matrix4 [Identity] -> Jolt.Mat44', () => { - const threeMat = new THREE.Matrix4( - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ); - - const jMat = ThreeMatrix4_JoltMat44(threeMat); - - compareMat(threeMat, jMat); - }); - - test('THREE.Matrix4 [+X Axis Rotation] -> Jolt.Mat44', () => { - const threeMat = new THREE.Matrix4( - 1, 0, 0, 0, - 0, 0, 1, 0, - 0,-1, 0, 0, - 0, 0, 0, 1 - ); - - const jMat = ThreeMatrix4_JoltMat44(threeMat); - - compareMat(threeMat, jMat); - }); - - test('THREE.Matrix4 [-X Axis Rotation] -> Jolt.Mat44', () => { - const threeMat = new THREE.Matrix4( - 1, 0, 0, 0, - 0, 0,-1, 0, - 0, 1, 0, 0, - 0, 0, 0, 1 - ); - - const jMat = ThreeMatrix4_JoltMat44(threeMat); - - compareMat(threeMat, jMat); - }); - - test('THREE.Matrix4 [XY Translation] -> Jolt.Mat44', () => { - const threeMat = new THREE.Matrix4( - 1, 0, 0, 3, - 0, 1, 0, 5, - 0, 0, 1, 0, - 0, 0, 0, 1 - ); - - const jMat = ThreeMatrix4_JoltMat44(threeMat); - - compareMat(threeMat, jMat); - }); - -}); + test("THREE.Vector3 -> Jolt.Vec3", () => { + const a = new THREE.Vector3(2, 4, 1) + const joltVec = ThreeVector3_JoltVec3(a) + + expect(joltVec.GetX()).toBe(a.x) + expect(joltVec.GetY()).toBe(a.y) + expect(joltVec.GetZ()).toBe(a.z) + expect(joltVec.Length() - a.length()).toBeLessThan(0.0001) + }) + + test("THREE.Euler -> Jolt.Quat", () => { + const a = new THREE.Euler(30, 60, 15) + const joltQuat = ThreeEuler_JoltQuat(a) + const threeQuat = new THREE.Quaternion() + threeQuat.setFromEuler(a) + + expect(joltQuat.GetX() - threeQuat.x).toBeLessThan(0.0001) + expect(joltQuat.GetY() - threeQuat.y).toBeLessThan(0.0001) + expect(joltQuat.GetZ() - threeQuat.z).toBeLessThan(0.0001) + expect(joltQuat.GetW() - threeQuat.w).toBeLessThan(0.0001) + }) + + test("THREE.Quaternion -> Jolt.Quat", () => { + const a = new THREE.Quaternion(0.285, 0.45, 0.237, 0.812) + a.normalize() + const joltQuat = ThreeQuaternion_JoltQuat(a) + + expect(joltQuat.GetX() - a.x).toBeLessThan(0.0001) + expect(joltQuat.GetY() - a.y).toBeLessThan(0.0001) + expect(joltQuat.GetZ() - a.z).toBeLessThan(0.0001) + expect(joltQuat.GetW() - a.w).toBeLessThan(0.0001) + }) + + test("THREE.Quaterion -> Jolt.Quat (General Func)", () => { + const a = new THREE.Quaternion(0.285, 0.45, 0.237, 0.812) + a.normalize() + const joltQuat = _JoltQuat(a) + + expect(joltQuat.GetX() - a.x).toBeLessThan(0.0001) + expect(joltQuat.GetY() - a.y).toBeLessThan(0.0001) + expect(joltQuat.GetZ() - a.z).toBeLessThan(0.0001) + expect(joltQuat.GetW() - a.w).toBeLessThan(0.0001) + }) + + test("THREE.Euler -> Jolt.Quat (General Func)", () => { + const a = new THREE.Euler(30, 60, 15) + const joltQuat = _JoltQuat(a) + const threeQuat = new THREE.Quaternion() + threeQuat.setFromEuler(a) + + expect(joltQuat.GetX() - threeQuat.x).toBeLessThan(0.0001) + expect(joltQuat.GetY() - threeQuat.y).toBeLessThan(0.0001) + expect(joltQuat.GetZ() - threeQuat.z).toBeLessThan(0.0001) + expect(joltQuat.GetW() - threeQuat.w).toBeLessThan(0.0001) + }) + + test("undefined -> Jolt.Quat (General Func)", () => { + const joltQuat = _JoltQuat(undefined) + + expect(joltQuat.GetX()).toBe(0.0) + expect(joltQuat.GetY()).toBe(0.0) + expect(joltQuat.GetZ()).toBe(0.0) + expect(joltQuat.GetW()).toBe(1.0) + }) + + test("THREE.Matrix4 [Identity] -> Jolt.Mat44", () => { + const threeMat = new THREE.Matrix4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) + + const jMat = ThreeMatrix4_JoltMat44(threeMat) + + compareMat(threeMat, jMat) + }) + + test("THREE.Matrix4 [+X Axis Rotation] -> Jolt.Mat44", () => { + const threeMat = new THREE.Matrix4(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1) + + const jMat = ThreeMatrix4_JoltMat44(threeMat) + + compareMat(threeMat, jMat) + }) + + test("THREE.Matrix4 [-X Axis Rotation] -> Jolt.Mat44", () => { + const threeMat = new THREE.Matrix4(1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1) + + const jMat = ThreeMatrix4_JoltMat44(threeMat) + + compareMat(threeMat, jMat) + }) + + test("THREE.Matrix4 [XY Translation] -> Jolt.Mat44", () => { + const threeMat = new THREE.Matrix4(1, 0, 0, 3, 0, 1, 0, 5, 0, 0, 1, 0, 0, 0, 0, 1) + + const jMat = ThreeMatrix4_JoltMat44(threeMat) + + compareMat(threeMat, jMat) + }) +}) // function matToString(mat: THREE.Matrix4) { // const arr = mat.toArray(); @@ -177,184 +163,168 @@ describe('Three to Jolt Conversions', async () => { // + `${arr[12].toFixed(4)}, ${arr[13].toFixed(4)}, ${arr[14].toFixed(4)}, ${arr[15].toFixed(4)},\n]` // } -describe('Mirabuf to Three Conversions', () => { - test('Mirabuf.Transform [Identity] -> THREE.Matrix4', () => { - const miraMat = new mirabuf.Transform(); - miraMat.spatialMatrix = [ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]; +describe("Mirabuf to Three Conversions", () => { + test("Mirabuf.Transform [Identity] -> THREE.Matrix4", () => { + const miraMat = new mirabuf.Transform() + miraMat.spatialMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] // console.debug(`Mira: ${miraMatToString(miraMat)}`); - const threeMat = MirabufTransform_ThreeMatrix4(miraMat); + const threeMat = MirabufTransform_ThreeMatrix4(miraMat) // console.debug(`Three: ${matToString(threeMat)}`); - const miraArr = miraMat.spatialMatrix; - const threeArr = threeMat.transpose().toArray(); // To Array gives column major for some reason. See docs + const miraArr = miraMat.spatialMatrix + const threeArr = threeMat.transpose().toArray() // To Array gives column major for some reason. See docs for (let i = 0; i < 16; i++) { - expect(threeArr[i]).toBe(miraArr[i]); + expect(threeArr[i]).toBe(miraArr[i]) } - }); + }) - test('Mirabuf.Transform [+X Axis Rotation] -> THREE.Matrix4', () => { - const miraMat = new mirabuf.Transform(); - miraMat.spatialMatrix = [ - 1, 0, 0, 0, - 0, 0, 1, 0, - 0,-1, 0, 0, - 0, 0, 0, 1 - ]; + test("Mirabuf.Transform [+X Axis Rotation] -> THREE.Matrix4", () => { + const miraMat = new mirabuf.Transform() + miraMat.spatialMatrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1] // console.debug(`Mira: ${miraMatToString(miraMat)}`); - const threeMat = MirabufTransform_ThreeMatrix4(miraMat); + const threeMat = MirabufTransform_ThreeMatrix4(miraMat) // console.debug(`Three: ${matToString(threeMat)}`); - const miraArr = miraMat.spatialMatrix; - const threeArr = threeMat.transpose().toArray(); // To Array gives column major for some reason. See docs + const miraArr = miraMat.spatialMatrix + const threeArr = threeMat.transpose().toArray() // To Array gives column major for some reason. See docs for (let i = 0; i < 16; i++) { - expect(threeArr[i]).toBeCloseTo(miraArr[i]); + expect(threeArr[i]).toBeCloseTo(miraArr[i]) } - }); + }) - test('Mirabuf.Transform [-X Axis Rotation] -> THREE.Matrix4', () => { - const miraMat = new mirabuf.Transform(); - miraMat.spatialMatrix = [ - 1, 0, 0, 0, - 0, 0,-1, 0, - 0, 1, 0, 0, - 0, 0, 0, 1 - ]; + test("Mirabuf.Transform [-X Axis Rotation] -> THREE.Matrix4", () => { + const miraMat = new mirabuf.Transform() + miraMat.spatialMatrix = [1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1] // console.debug(`Mira: ${miraMatToString(miraMat)}`); - const threeMat = MirabufTransform_ThreeMatrix4(miraMat); + const threeMat = MirabufTransform_ThreeMatrix4(miraMat) // console.debug(`Three: ${matToString(threeMat)}`); - const miraArr = miraMat.spatialMatrix; - const threeArr = threeMat.transpose().toArray(); // To Array gives column major for some reason. See docs + const miraArr = miraMat.spatialMatrix + const threeArr = threeMat.transpose().toArray() // To Array gives column major for some reason. See docs for (let i = 0; i < 16; i++) { - expect(threeArr[i]).toBeCloseTo(miraArr[i]); + expect(threeArr[i]).toBeCloseTo(miraArr[i]) } - }); -}); - -describe('Jolt to Three Conversions', () => { + }) +}) +describe("Jolt to Three Conversions", () => { function compareMat(jM: Jolt.Mat44, tM: THREE.Matrix4) { - const threeArr = tM.toArray(); + const threeArr = tM.toArray() for (let c = 0; c < 4; c++) { - const column = jM.GetColumn4(c); + const column = jM.GetColumn4(c) for (let r = 0; r < 4; r++) { - expect(threeArr[c * 4 + r]).toBeCloseTo(column.GetComponent(r), 4); + expect(threeArr[c * 4 + r]).toBeCloseTo(column.GetComponent(r), 4) } - JOLT.destroy(column); + JOLT.destroy(column) } - const threeTranslation = new THREE.Vector3(); - const threeRotation = new THREE.Quaternion(); - const threeScale = new THREE.Vector3(); - tM.decompose(threeTranslation, threeRotation, threeScale); + const threeTranslation = new THREE.Vector3() + const threeRotation = new THREE.Quaternion() + const threeScale = new THREE.Vector3() + tM.decompose(threeTranslation, threeRotation, threeScale) - const joltTranslation = jM.GetTranslation(); - const joltRotation = jM.GetQuaternion(); - const joltScale = new JOLT.Vec3(1, 1, 1); + const joltTranslation = jM.GetTranslation() + const joltRotation = jM.GetQuaternion() + const joltScale = new JOLT.Vec3(1, 1, 1) - expect(threeTranslation.x).toBeCloseTo(joltTranslation.GetX(), 4); - expect(threeTranslation.y).toBeCloseTo(joltTranslation.GetY(), 4); - expect(threeTranslation.z).toBeCloseTo(joltTranslation.GetZ(), 4); + expect(threeTranslation.x).toBeCloseTo(joltTranslation.GetX(), 4) + expect(threeTranslation.y).toBeCloseTo(joltTranslation.GetY(), 4) + expect(threeTranslation.z).toBeCloseTo(joltTranslation.GetZ(), 4) // JOLT.destroy(joltTranslation); // Causes error for some reason? - expect(threeRotation.x).toBeCloseTo(joltRotation.GetX(), 4); - expect(threeRotation.y).toBeCloseTo(joltRotation.GetY(), 4); - expect(threeRotation.z).toBeCloseTo(joltRotation.GetZ(), 4); - expect(threeRotation.w).toBeCloseTo(joltRotation.GetW(), 4); - JOLT.destroy(joltRotation); - expect(threeScale.x).toBeCloseTo(joltScale.GetX(), 4); - expect(threeScale.y).toBeCloseTo(joltScale.GetY(), 4); - expect(threeScale.z).toBeCloseTo(joltScale.GetZ(), 4); - JOLT.destroy(joltScale); + expect(threeRotation.x).toBeCloseTo(joltRotation.GetX(), 4) + expect(threeRotation.y).toBeCloseTo(joltRotation.GetY(), 4) + expect(threeRotation.z).toBeCloseTo(joltRotation.GetZ(), 4) + expect(threeRotation.w).toBeCloseTo(joltRotation.GetW(), 4) + JOLT.destroy(joltRotation) + expect(threeScale.x).toBeCloseTo(joltScale.GetX(), 4) + expect(threeScale.y).toBeCloseTo(joltScale.GetY(), 4) + expect(threeScale.z).toBeCloseTo(joltScale.GetZ(), 4) + JOLT.destroy(joltScale) } - test('Jolt.Mat44 [Identity] -> THREE.Matrix4', () => { - const tmp = new JOLT.Mat44(); - const joltMat = tmp.sIdentity(); - const threeMat = JoltMat44_ThreeMatrix4(joltMat); - - compareMat(joltMat, threeMat); - - JOLT.destroy(joltMat); - }); - - test('Jolt.Mat44 [+X Axis Rotation] -> THREE.Matrix4', () => { - const joltMat = new JOLT.Mat44(); - const c0 = new JOLT.Vec4(1, 0, 0, 0); - const c1 = new JOLT.Vec4(0, 0,-1, 0); - const c2 = new JOLT.Vec4(0, 1, 0, 0); - const c3 = new JOLT.Vec4(0, 0, 0, 1); - joltMat.SetColumn4(0, c0); - joltMat.SetColumn4(1, c1); - joltMat.SetColumn4(2, c2); - joltMat.SetColumn4(3, c3); - JOLT.destroy(c0); - JOLT.destroy(c1); - JOLT.destroy(c2); - JOLT.destroy(c3); - - const threeMat = JoltMat44_ThreeMatrix4(joltMat); - - compareMat(joltMat, threeMat); - - JOLT.destroy(joltMat); - }); - - test('Jolt.Mat44 [-X Axis Rotation] -> THREE.Matrix4', () => { - const joltMat = new JOLT.Mat44(); - const c0 = new JOLT.Vec4(1, 0, 0, 0); - const c1 = new JOLT.Vec4(0, 0, 1, 0); - const c2 = new JOLT.Vec4(0,-1, 0, 0); - const c3 = new JOLT.Vec4(0, 0, 0, 1); - joltMat.SetColumn4(0, c0); - joltMat.SetColumn4(1, c1); - joltMat.SetColumn4(2, c2); - joltMat.SetColumn4(3, c3); - JOLT.destroy(c0); - JOLT.destroy(c1); - JOLT.destroy(c2); - JOLT.destroy(c3); - - const threeMat = JoltMat44_ThreeMatrix4(joltMat); - - compareMat(joltMat, threeMat); - - JOLT.destroy(joltMat); - }); - - test('Jolt.Mat44 [X,Y Translation] -> THREE.Matrix4', () => { - const joltMat = new JOLT.Mat44(); - const c0 = new JOLT.Vec4(1, 0, 0, 0); - const c1 = new JOLT.Vec4(0, 1, 0, 0); - const c2 = new JOLT.Vec4(0, 0, 1, 0); - const c3 = new JOLT.Vec4(5, 3, 0, 1); - joltMat.SetColumn4(0, c0); - joltMat.SetColumn4(1, c1); - joltMat.SetColumn4(2, c2); - joltMat.SetColumn4(3, c3); - JOLT.destroy(c0); - JOLT.destroy(c1); - JOLT.destroy(c2); - JOLT.destroy(c3); - - const threeMat = JoltMat44_ThreeMatrix4(joltMat); - - compareMat(joltMat, threeMat); - - JOLT.destroy(joltMat); - }); -}); \ No newline at end of file + test("Jolt.Mat44 [Identity] -> THREE.Matrix4", () => { + const tmp = new JOLT.Mat44() + const joltMat = tmp.sIdentity() + const threeMat = JoltMat44_ThreeMatrix4(joltMat) + + compareMat(joltMat, threeMat) + + JOLT.destroy(joltMat) + }) + + test("Jolt.Mat44 [+X Axis Rotation] -> THREE.Matrix4", () => { + const joltMat = new JOLT.Mat44() + const c0 = new JOLT.Vec4(1, 0, 0, 0) + const c1 = new JOLT.Vec4(0, 0, -1, 0) + const c2 = new JOLT.Vec4(0, 1, 0, 0) + const c3 = new JOLT.Vec4(0, 0, 0, 1) + joltMat.SetColumn4(0, c0) + joltMat.SetColumn4(1, c1) + joltMat.SetColumn4(2, c2) + joltMat.SetColumn4(3, c3) + JOLT.destroy(c0) + JOLT.destroy(c1) + JOLT.destroy(c2) + JOLT.destroy(c3) + + const threeMat = JoltMat44_ThreeMatrix4(joltMat) + + compareMat(joltMat, threeMat) + + JOLT.destroy(joltMat) + }) + + test("Jolt.Mat44 [-X Axis Rotation] -> THREE.Matrix4", () => { + const joltMat = new JOLT.Mat44() + const c0 = new JOLT.Vec4(1, 0, 0, 0) + const c1 = new JOLT.Vec4(0, 0, 1, 0) + const c2 = new JOLT.Vec4(0, -1, 0, 0) + const c3 = new JOLT.Vec4(0, 0, 0, 1) + joltMat.SetColumn4(0, c0) + joltMat.SetColumn4(1, c1) + joltMat.SetColumn4(2, c2) + joltMat.SetColumn4(3, c3) + JOLT.destroy(c0) + JOLT.destroy(c1) + JOLT.destroy(c2) + JOLT.destroy(c3) + + const threeMat = JoltMat44_ThreeMatrix4(joltMat) + + compareMat(joltMat, threeMat) + + JOLT.destroy(joltMat) + }) + + test("Jolt.Mat44 [X,Y Translation] -> THREE.Matrix4", () => { + const joltMat = new JOLT.Mat44() + const c0 = new JOLT.Vec4(1, 0, 0, 0) + const c1 = new JOLT.Vec4(0, 1, 0, 0) + const c2 = new JOLT.Vec4(0, 0, 1, 0) + const c3 = new JOLT.Vec4(5, 3, 0, 1) + joltMat.SetColumn4(0, c0) + joltMat.SetColumn4(1, c1) + joltMat.SetColumn4(2, c2) + joltMat.SetColumn4(3, c3) + JOLT.destroy(c0) + JOLT.destroy(c1) + JOLT.destroy(c2) + JOLT.destroy(c3) + + const threeMat = JoltMat44_ThreeMatrix4(joltMat) + + compareMat(joltMat, threeMat) + + JOLT.destroy(joltMat) + }) +}) diff --git a/fission/src/ui/ModalContext.tsx b/fission/src/ui/ModalContext.tsx index 2b0db95579..d0fe266274 100644 --- a/fission/src/ui/ModalContext.tsx +++ b/fission/src/ui/ModalContext.tsx @@ -1,19 +1,7 @@ -import React, { - createContext, - useState, - useEffect, - useCallback, - useContext, - ReactNode, - ReactElement, -} from "react" +import React, { createContext, useState, useEffect, useCallback, useContext, ReactNode, ReactElement } from "react" type ModalControlContextType = { - openModal: ( - modalId: string, - onOpen?: () => void, - onClose?: () => void - ) => void + openModal: (modalId: string, onOpen?: () => void, onClose?: () => void) => void closeModal: () => void children?: ReactNode } @@ -22,22 +10,12 @@ const ModalControlContext = createContext(null) export const useModalControlContext = () => { const context = useContext(ModalControlContext) - if (!context) - throw new Error( - "useModalControlContext must be used within a ModalControlProvider" - ) + if (!context) throw new Error("useModalControlContext must be used within a ModalControlProvider") return context } -export const ModalControlProvider: React.FC = ({ - children, - ...methods -}) => { - return ( - - {children} - - ) +export const ModalControlProvider: React.FC = ({ children, ...methods }) => { + return {children} } type ModalInstance = { diff --git a/fission/src/ui/PanelContext.tsx b/fission/src/ui/PanelContext.tsx index 9e3a40eaad..63aae1b058 100644 --- a/fission/src/ui/PanelContext.tsx +++ b/fission/src/ui/PanelContext.tsx @@ -1,12 +1,4 @@ -import React, { - createContext, - useState, - useEffect, - useCallback, - useContext, - ReactNode, - ReactElement, -} from "react" +import React, { createContext, useState, useEffect, useCallback, useContext, ReactNode, ReactElement } from "react" type PanelControlContextType = { openPanel: (panelId: string) => void @@ -18,22 +10,12 @@ const PanelControlContext = createContext(null) export const usePanelControlContext = () => { const context = useContext(PanelControlContext) - if (!context) - throw new Error( - "usePanelControlContext must be used within a PanelControlProvider" - ) + if (!context) throw new Error("usePanelControlContext must be used within a PanelControlProvider") return context } -export const PanelControlProvider: React.FC = ({ - children, - ...methods -}) => { - return ( - - {children} - - ) +export const PanelControlProvider: React.FC = ({ children, ...methods }) => { + return {children} } type PanelInstance = { diff --git a/fission/src/ui/ThemeContext.tsx b/fission/src/ui/ThemeContext.tsx index 901b76ce19..ef33d33fac 100644 --- a/fission/src/ui/ThemeContext.tsx +++ b/fission/src/ui/ThemeContext.tsx @@ -34,11 +34,13 @@ export type ColorName = | "ToastError" export const colorNameToTailwind = (colorName: ColorName) => { - return "bg" + + return ( + "bg" + colorName .replace(/([A-Z]+)/g, "-$1") .replace(/(?<=[A-Z])([A-Z])(?![A-Z]|$)/g, "-$1") .toLowerCase() + ) } export const colorNameToProp = (colorName: ColorName) => { return ( @@ -49,7 +51,9 @@ export const colorNameToProp = (colorName: ColorName) => { .toLowerCase() ) } -export type Theme = { [name in ColorName]: { color: RgbaColor, above: (ColorName | string)[] } } +export type Theme = { + [name in ColorName]: { color: RgbaColor; above: (ColorName | string)[] } +} export type Themes = { [name: string]: Theme } type ThemeContextType = { @@ -58,11 +62,7 @@ type ThemeContextType = { defaultTheme: Theme currentTheme: string setTheme: (themeName: string) => void - updateColor: ( - themeName: string, - colorName: ColorName, - rgbaColor: RgbaColor - ) => void + updateColor: (themeName: string, colorName: ColorName, rgbaColor: RgbaColor) => void createTheme: (themeName: string) => void deleteTheme: (themeName: string) => void deleteAllThemes: () => void @@ -78,62 +78,53 @@ type ThemeProviderProps = { const ThemeContext = createContext(undefined) -export const ThemeProvider: React.FC = ({ - initialThemeName, - themes, - defaultTheme, - children, -}) => { - const [currentTheme, setCurrentTheme] = useState(initialThemeName); +export const ThemeProvider: React.FC = ({ initialThemeName, themes, defaultTheme, children }) => { + const [currentTheme, setCurrentTheme] = useState(initialThemeName) - addGlobalFunc('getTheme', () => themes[currentTheme]) + addGlobalFunc("getTheme", () => themes[currentTheme]) // potentially dumb algorithm const findUnusedColor = () => { - if (process.env.NODE_ENV !== "production") return; - const MAX_VALUE = 255; - const sortFunc = (a: number, b: number) => a - b; - const themeValue: RgbaColor[] = Object.values(themes[currentTheme]).map(v => v.color); - const reds = themeValue.map((c) => c.r).sort(sortFunc); - const greens = themeValue.map((c) => c.g).sort(sortFunc); - const blues = themeValue.map((c) => c.b).sort(sortFunc); + if (process.env.NODE_ENV !== "production") return + const MAX_VALUE = 255 + const sortFunc = (a: number, b: number) => a - b + const themeValue: RgbaColor[] = Object.values(themes[currentTheme]).map(v => v.color) + const reds = themeValue.map(c => c.r).sort(sortFunc) + const greens = themeValue.map(c => c.g).sort(sortFunc) + const blues = themeValue.map(c => c.b).sort(sortFunc) - const values = []; + const values = [] for (const colorArr of [reds, greens, blues]) { - const color = Array.from(new Set(colorArr)); - let lower = -1; - let largestGap = -1; + const color = Array.from(new Set(colorArr)) + let lower = -1 + let largestGap = -1 for (let i = 0; i < color.length - 1; i++) { - const col1 = color[i]; - const col2 = color[i + 1]; + const col1 = color[i] + const col2 = color[i + 1] if (col2 - col1 > largestGap) { - largestGap = col2 - col1; - lower = col1; + largestGap = col2 - col1 + lower = col1 } } - const col1 = color[color.length - 1]; - const col2 = color[0] + MAX_VALUE; + const col1 = color[color.length - 1] + const col2 = color[0] + MAX_VALUE if (col1 - col2 > largestGap) { - largestGap = col2 - col1; - lower = col1; + largestGap = col2 - col1 + lower = col1 } - values.push((lower + largestGap / 2) % MAX_VALUE); + values.push((lower + largestGap / 2) % MAX_VALUE) } - document.body.style.background = `rgba(${values[0]}, ${values[1]}, ${values[2]}, ${MAX_VALUE})`; + document.body.style.background = `rgba(${values[0]}, ${values[1]}, ${values[2]}, ${MAX_VALUE})` } - const updateColor = ( - themeName: string, - colorName: ColorName, - rgbaColor: RgbaColor - ) => { + const updateColor = (themeName: string, colorName: ColorName, rgbaColor: RgbaColor) => { if (themes[themeName]) { themes[themeName][colorName].color = rgbaColor } @@ -166,12 +157,9 @@ export const ThemeProvider: React.FC = ({ const root = document.documentElement Object.entries(themeObject).map(([n, c]) => { const propName = colorNameToProp(n as ColorName) - root.style.setProperty( - propName, - `rgba(${c.color.r}, ${c.color.g}, ${c.color.b}, ${c.color.a})` - ) + root.style.setProperty(propName, `rgba(${c.color.r}, ${c.color.g}, ${c.color.b}, ${c.color.a})`) }) - findUnusedColor(); + findUnusedColor() } return ( diff --git a/fission/src/ui/ToastContext.tsx b/fission/src/ui/ToastContext.tsx index 39af7a9069..2730f7001f 100644 --- a/fission/src/ui/ToastContext.tsx +++ b/fission/src/ui/ToastContext.tsx @@ -27,43 +27,33 @@ const ToastContext = createContext(null) export const useToastContext = () => { const context = useContext(ToastContext) - if (!context) - throw new Error("useToastContext must be used within a ToastProvider") + if (!context) throw new Error("useToastContext must be used within a ToastProvider") return context } -export const ToastProvider: React.FC<{ children: ReactNode }> = ({ - children, -}) => { +export const ToastProvider: React.FC<{ children: ReactNode }> = ({ children }) => { const [toasts, setToasts] = useState([]) - const addToast = useCallback( - (type: ToastType, title: string, description: string) => { - // divide by 10 so that it's harder to have duplicates? could make smaller or remove - const id = "toast-" + Math.floor(Date.now() / 10).toString() - const newToast: ToastData = { - id, - type, - title, - description, - } - setToasts(prevToasts => { - if (prevToasts.some(t => t.id == id)) return prevToasts - return [...prevToasts, newToast] - }) - }, - [] - ) + const addToast = useCallback((type: ToastType, title: string, description: string) => { + // divide by 10 so that it's harder to have duplicates? could make smaller or remove + const id = "toast-" + Math.floor(Date.now() / 10).toString() + const newToast: ToastData = { + id, + type, + title, + description, + } + setToasts(prevToasts => { + if (prevToasts.some(t => t.id == id)) return prevToasts + return [...prevToasts, newToast] + }) + }, []) const removeToast = useCallback((toastId: string) => { setToasts(prevToasts => prevToasts.filter(t => t.id !== toastId)) }, []) - return ( - - {children} - - ) + return {children} } export const ToastContainer: React.FC = () => { @@ -96,12 +86,7 @@ export const ToastContainer: React.FC = () => { key={t.id} className="w-fit" > - + ))}
diff --git a/fission/src/ui/TooltipContext.tsx b/fission/src/ui/TooltipContext.tsx index a3a78cebb0..24c859c580 100644 --- a/fission/src/ui/TooltipContext.tsx +++ b/fission/src/ui/TooltipContext.tsx @@ -1,12 +1,6 @@ import Tooltip from "@/components/Tooltip" import { AnimatePresence, motion } from "framer-motion" -import React, { - ReactNode, - createContext, - useCallback, - useContext, - useState, -} from "react" +import React, { ReactNode, createContext, useCallback, useContext, useState } from "react" export type TooltipControl = { control: string; description: string } export type TooltipType = "controls" @@ -14,33 +8,21 @@ export type TooltipType = "controls" export const TOOLTIP_DURATION: number = 7_000 type TooltipControlContextType = { - showTooltip: ( - type: TooltipType, - controls?: TooltipControl[], - duration?: number - ) => void + showTooltip: (type: TooltipType, controls?: TooltipControl[], duration?: number) => void children?: ReactNode } -const TooltipControlContext = createContext( - null -) +const TooltipControlContext = createContext(null) export const useTooltipControlContext = () => { const context = useContext(TooltipControlContext) - if (!context) - throw new Error( - "useTooltipControlContext must be used within a TooltipControlProvider" - ) + if (!context) throw new Error("useTooltipControlContext must be used within a TooltipControlProvider") return context } let tooltip: ReactNode -export const TooltipControlProvider: React.FC = ({ - children, - ...methods -}) => { +export const TooltipControlProvider: React.FC = ({ children, ...methods }) => { return ( @@ -84,11 +66,7 @@ export const useTooltipManager = () => { const [timeout, setTimeoutState] = useState(null) const showTooltip = useCallback( - ( - type: TooltipType, - controls?: TooltipControl[], - duration: number = TOOLTIP_DURATION - ) => { + (type: TooltipType, controls?: TooltipControl[], duration: number = TOOLTIP_DURATION) => { tooltip = setDuration(duration) diff --git a/fission/src/ui/components/Button.tsx b/fission/src/ui/components/Button.tsx index 5e3e16971b..3d18c026ad 100644 --- a/fission/src/ui/components/Button.tsx +++ b/fission/src/ui/components/Button.tsx @@ -1,4 +1,5 @@ import React from "react" +import { Button as BaseButton } from "@mui/base/Button" export enum ButtonSize { Small, @@ -9,19 +10,13 @@ export enum ButtonSize { type ButtonProps = { value: string - colorClass?: string + colorOverrideClass?: string size?: ButtonSize onClick?: () => void className?: string } -const Button: React.FC = ({ - value, - colorClass, - size, - onClick, - className, -}) => { +const Button: React.FC = ({ value, colorOverrideClass, size, onClick, className }) => { let sizeClassNames if (!size) size = ButtonSize.Medium as ButtonSize @@ -42,18 +37,18 @@ const Button: React.FC = ({ } return ( - + > + {value} + ) } diff --git a/fission/src/ui/components/Checkbox.tsx b/fission/src/ui/components/Checkbox.tsx index 1d6ad3c6c4..59acc610a4 100644 --- a/fission/src/ui/components/Checkbox.tsx +++ b/fission/src/ui/components/Checkbox.tsx @@ -1,6 +1,7 @@ -import React, { useState } from "react" +import React from "react" import Stack, { StackDirection } from "./Stack" import Label, { LabelSize } from "./Label" +import { Switch } from "@mui/base/Switch" type CheckboxProps = { label: string @@ -10,35 +11,44 @@ type CheckboxProps = { onClick?: (checked: boolean) => void } -const Checkbox: React.FC = ({ - label, - className, - defaultState, - stateOverride, - onClick, -}) => { - const [state, setState] = useState(defaultState) +const Checkbox: React.FC = ({ label, className, onClick }) => { return ( - ) } +// { +// const checked = (e.target as HTMLInputElement).checked +// setState(checked) +// if (onClick) onClick(checked) +// }} +// className="bg-interactive-background translate-y-1/4 duration-200 cursor-pointer appearance-none w-5 h-5 rounded-full checked:bg-gradient-to-br checked:from-interactive-element-left checked:to-interactive-element-right" +// checked={stateOverride != null ? stateOverride : undefined} +// /> export default Checkbox diff --git a/fission/src/ui/components/Dropdown.tsx b/fission/src/ui/components/Dropdown.tsx index 23d8cebcfc..ab26a92236 100644 --- a/fission/src/ui/components/Dropdown.tsx +++ b/fission/src/ui/components/Dropdown.tsx @@ -1,6 +1,26 @@ import React, { ReactNode, useState } from "react" -import { FaChevronDown, FaChevronUp } from "react-icons/fa" import Label, { LabelSize } from "./Label" +import { Select as BaseSelect, SelectProps, SelectRootSlotProps } from "@mui/base/Select" +import { Option as BaseOption } from "@mui/base/Option" +import { styled } from "@mui/system" +import { Button } from "@mui/base/Button" +import UnfoldMoreRoundedIcon from "@mui/icons-material/UnfoldMoreRounded" + +const Select = React.forwardRef(function Select, Multiple extends boolean>( + props: SelectProps, + ref: React.ForwardedRef +) { + const slots: SelectProps["slots"] = { + root: CustomButton, + listbox: Listbox, + popup: Popup, + ...props.slots, + } + + return +}) as , Multiple extends boolean>( + props: SelectProps & React.RefAttributes +) => JSX.Element type DropdownProps = { children?: ReactNode @@ -10,64 +30,114 @@ type DropdownProps = { onSelect: (opt: string) => void } -const Dropdown: React.FC = ({ - label, - className, - options, - onSelect, -}) => { - const [expanded, setExpanded] = useState(false) - const [optionList, setOptionList] = useState(options) - - type DropdownOptionProps = { - value: string - children?: ReactNode - className?: string - } - - const DropdownOption: React.FC = ({ - children, - value, - className, - }) => ( - { - const newOptions = options.filter(item => item !== value) - newOptions.unshift(value) - setOptionList(newOptions) - if (onSelect) onSelect(value) - }} - className={`block relative duration-100 hover:backdrop-brightness-90 w-full h-full px-2 py-2 ${className}`} - > - {children} - - ) +const Dropdown: React.FC = ({ label, options, onSelect }) => { + const [optionList, _setOptionList] = useState(options) return ( <> {label && } -
setExpanded(!expanded)} - className={`relative flex flex-col gap-2 select-none cursor-pointer bg-gradient-to-r from-interactive-element-left to-interactive-element-right w-full rounded-md ${className}`} - > - - {optionList[0]} - {optionList.length > 1 && ( -
- - -
- )} -
- {expanded && - optionList.slice(1).map(o => ( - - {o} - +
+
) } +const CustomButton = React.forwardRef(function CustomButton, Multiple extends boolean>( + props: SelectRootSlotProps, + ref: React.ForwardedRef +) { + return ( + + {props.children} + + + ) +}) + +const StyledButton = styled(Button)` + position: relative; + text-align: left; + width: 100%; + background-image: linear-gradient(to right, var(--interactive-element-left), var(--interactive-element-right)); + border-radius: 0.375rem; + border: none; + outline: none; + padding-left: calc(0.8em + 8px); + + &:hover, + &:focus { + outline: none; + } + + & > svg { + font-size: 1rem; + position: absolute; + height: 100%; + top: 0; + right: 10px; + } +` + +const Listbox = styled("ul")` + box-sizing: border-box; + width: 100%; + background-image: linear-gradient(to right, var(--interactive-element-right), var(--interactive-element-left)); + border-radius: 1rem; + padding: 8px; +` + +const Option = styled(BaseOption)` + list-style: none; + cursor: default; + padding: 0.6em 0.8em; + border-radius: 1rem; + cursor: pointer; + &:hover { + backdrop-filter: brightness(90%); + } + &:hover, + &:focus { + outline: none; + } +` + +const Popup = styled("div")` + position: relative; + z-index: 1; + width: 100%; +` + +//
setExpanded(!expanded)} +// className={`relative flex flex-col gap-2 select-none cursor-pointer bg-gradient-to-r from-interactive-element-left to-interactive-element-right w-full rounded-md ${className}`} +// > +// +// {optionList[0]} +// {optionList.length > 1 && ( +//
+// +// +//
+// )} +//
+// {expanded && +// optionList.slice(1).map(o => ( +// +// {o} +// +// ))} +//
+ export default Dropdown diff --git a/fission/src/ui/components/Input.tsx b/fission/src/ui/components/Input.tsx index 5bc7978345..03e35e5f14 100644 --- a/fission/src/ui/components/Input.tsx +++ b/fission/src/ui/components/Input.tsx @@ -1,54 +1,53 @@ import React from "react" import Label, { LabelSize } from "./Label" +import { Input as BaseInput } from "@mui/base/Input" type InputProps = { placeholder: string - value?: string defaultValue?: string - numeric?: boolean - validate?: (s: string) => boolean label?: string onInput?: (value: string) => void className?: string } -const Input: React.FC = ({ - placeholder, - value, - defaultValue, - numeric, - validate, - label, - onInput, - className, -}) => { +const Input: React.FC = ({ placeholder, defaultValue, label, onInput, className }) => { return ( <> {label && } - { - if ( - e.key != null && - numeric && - !"1234567890,.".includes(e.key) - ) { - e.preventDefault() - } - - if (validate && !validate(e.key)) e.preventDefault() - }} - onChange={e => { - if (onInput) onInput(e.target.value) + placeholder={placeholder} + onChange={(e: React.ChangeEvent) => onInput && onInput(e.target.value)} + className={className} + slotProps={{ + input: { + className: `w-full text-sm font-normal font-sans leading-5 px-3 py-2 rounded-lg shadow-md text-main-text bg-background-secondary focus-visible:outline-0 border border-solid border-interactive-element-right dark:border-interactive-element-right hover:border-interactive-element-solid dark:hover:border-interactive-element-solid focus:border-interactive-solid dark:focus:border-interactive-element-solid`, + }, }} - className={`bg-interactive-background px-2 py-1 bg-[length:200%_100%] w-min rounded-md font-semibold cursor-pointer placeholder:italic ${ - className || "" - }`} /> ) } +// { +// if ( +// e.key != null && +// numeric && +// !"1234567890,.".includes(e.key) +// ) { +// e.preventDefault() +// } + +// if (validate && !validate(e.key)) e.preventDefault() +// }} +// onChange={e => { +// if (onInput) onInput(e.target.value) +// }} +// className={`bg-interactive-background px-2 py-1 bg-[length:200%_100%] w-min rounded-md font-semibold cursor-pointer placeholder:italic ${className || "" +// }`} +// /> export default Input diff --git a/fission/src/ui/components/Label.tsx b/fission/src/ui/components/Label.tsx index e8269a98f9..1aa786aacd 100644 --- a/fission/src/ui/components/Label.tsx +++ b/fission/src/ui/components/Label.tsx @@ -29,13 +29,7 @@ type LabelProps = { } const Label: React.FC = ({ children, size, className }) => ( - - {children} - + {children} ) export default Label diff --git a/fission/src/ui/components/LabeledButton.tsx b/fission/src/ui/components/LabeledButton.tsx index 3840309dc8..d9fac91f70 100644 --- a/fission/src/ui/components/LabeledButton.tsx +++ b/fission/src/ui/components/LabeledButton.tsx @@ -29,36 +29,19 @@ const LabeledButton: React.FC = ({ labelClassName, buttonClassName, }) => { - const buttonComponent = ( - ) } -export let MainHUD_AddToast: (type: ToastType, title: string, description: string) => void = (a, b, c) => { } +export let MainHUD_AddToast: (type: ToastType, title: string, description: string) => void = (_a, _b, _c) => {} const variants = { open: { opacity: 1, y: "-50%", x: 0 }, @@ -63,7 +49,6 @@ const variants = { } const MainHUD: React.FC = () => { - // console.debug('Creating MainHUD'); const { openModal } = useModalControlContext() @@ -73,12 +58,12 @@ const MainHUD: React.FC = () => { MainHUD_AddToast = addToast - const [userInfo, setUserInfo] = useState(APS.userInfo); + const [userInfo, setUserInfo] = useState(APS.userInfo) useEffect(() => { document.addEventListener(APS_USER_INFO_UPDATE_EVENT, () => { setUserInfo(APS.userInfo) - }); + }) }, []) return ( @@ -86,12 +71,9 @@ const MainHUD: React.FC = () => { {!isOpen && ( )} { >
- +
{ icon={} onClick={() => openModal("manage-assembles")} /> - } - onClick={() => openModal("settings")} - /> - } - onClick={() => openModal("view")} - /> + } onClick={() => openModal("settings")} /> + } onClick={() => openModal("view")} /> } onClick={() => openModal("change-inputs")} /> - } - onClick={() => openPanel("multibot")} - /> + } onClick={() => openPanel("multibot")} /> } @@ -154,54 +123,37 @@ const MainHUD: React.FC = () => { icon={} onClick={() => openModal("download-assets")} /> - } - onClick={() => openModal("roborio")} - /> + } onClick={() => openModal("roborio")} /> } onClick={() => openPanel("driver-station")} /> - } - onClick={() => openModal("drivetrain")} - /> + } onClick={() => openModal("drivetrain")} /> } onClick={() => { - const type: ToastType = [ - "info", - "warning", - "error", - ][Math.floor(Random() * 3)] as ToastType - addToast( - type, - type, - "This is a test toast to test the toast system" - ) + const type: ToastType = ["info", "warning", "error"][Math.floor(Random() * 3)] as ToastType + addToast(type, type, "This is a test toast to test the toast system") }} />
- {userInfo - ? - } - larger={true} - onClick={() => APS.logout()} - /> - : - } - larger={true} - onClick={() => APS.requestAuthCode()} - /> - } + {userInfo ? ( + } + larger={true} + onClick={() => APS.logout()} + /> + ) : ( + } + larger={true} + onClick={() => APS.requestAuthCode()} + /> + )} ) diff --git a/fission/src/ui/components/Modal.tsx b/fission/src/ui/components/Modal.tsx index 72a76a46ce..eb43879fc2 100644 --- a/fission/src/ui/components/Modal.tsx +++ b/fission/src/ui/components/Modal.tsx @@ -1,4 +1,5 @@ import React, { ReactNode } from "react" +import { ClickAwayListener } from "@mui/base/ClickAwayListener" import { useModalControlContext } from "@/ui/ModalContext" export type ModalPropsImpl = { @@ -47,82 +48,72 @@ const Modal: React.FC = ({ }) => { const { closeModal } = useModalControlContext() - const iconEl: ReactNode = - typeof icon === "string" ? ( - Icon - ) : ( - icon - ) + const iconEl: ReactNode = typeof icon === "string" ? Icon : icon return ( -
- {name && ( - - )} -
- {children} -
+ closeModal()}> -
+ ) } diff --git a/fission/src/ui/components/NumberInput.tsx b/fission/src/ui/components/NumberInput.tsx new file mode 100644 index 0000000000..e98bed2991 --- /dev/null +++ b/fission/src/ui/components/NumberInput.tsx @@ -0,0 +1,68 @@ +import React from "react" +import Label, { LabelSize } from "./Label" +import { Unstable_NumberInput as BaseNumberInput, } from "@mui/base/Unstable_NumberInput" + +type InputProps = { + placeholder: string + defaultValue?: number + label?: string + onInput?: (value: number | null) => void + className?: string +} + +const NumberInput: React.FC = ({ placeholder, defaultValue, label, onInput }) => { + return ( + <> + {label && } + onInput && onInput(val)} + slotProps={{ + root: ownerState => { + return { + className: `grid grid-cols-[1fr_8px] grid-rows-2 overflow-hidden rounded-lg text-main-text dark:text-main-text bg-background-secondary border border-solid hover:border-interactive-element-solid dark:hover:border-interactive-element-solid focus-visible:outline-0 p-1 ${ownerState.focused ? "border-interactive-element-solid dark:border-interactive-element-solid" : "border-interactive-element-right dark:border-interactive-element-right"}`, + } + }, + input: { + className: + "col-start-1 col-end-2 row-start-1 row-end-3 text-sm font-sans leading-normal text-main-text dark:text-main-text bg-inherit border-0 rounded-[inherit] px-3 py-2 outline-0 focus-visible:outline-0 focus-visible:outline-none", + }, + incrementButton: { + children: "â–´", + className: + "font-[system-ui] flex flex-row flex-nowrap justify-center items-center p-0 w-[19px] h-[19px] col-start-3 col-end-3 row-start-1 row-end-2 border border-solid outline-none text-sm box-border leading-[1.2] rounded-t-md rounded-b-none bg-interactive-secondary border-interactive-element-right dark:border-interactive-element-right bg-background-secondary text-main-text transition-all duration-[120ms] hover:cursor-pointer hover:border-interactive-element-right hover:bg-interactive-hover", + }, + decrementButton: { + children: "â–¾", + className: + "font-[system-ui] flex flex-row flex-nowrap justify-center items-center p-0 w-[19px] h-[19px] col-start-3 col-end-3 row-start-2 row-end-3 border border-solid outline-none text-sm box-border leading-[1.2] rounded-b-md rounded-t-none border-t-0 border-interactive-element-right dark:border-interactive-element-right bg-background-secondary text-main-text transition-all duration-[120ms] hover:cursor-pointer hover:border-interactive-element-right hover:bg-interactive-hover", + }, + }} + /> + + ) +} + +// { +// if ( +// e.key != null && +// numeric && +// !"1234567890,.".includes(e.key) +// ) { +// e.preventDefault() +// } + +// if (validate && !validate(e.key)) e.preventDefault() +// }} +// onChange={e => { +// if (onInput) onInput(e.target.value) +// }} +// className={`bg-interactive-background px-2 py-1 bg-[length:200%_100%] w-min rounded-md font-semibold cursor-pointer placeholder:italic ${className || "" +// }`} +// /> +export default NumberInput diff --git a/fission/src/ui/components/Panel.tsx b/fission/src/ui/components/Panel.tsx index 6438bb8129..bf0703ffce 100644 --- a/fission/src/ui/components/Panel.tsx +++ b/fission/src/ui/components/Panel.tsx @@ -1,12 +1,81 @@ import React, { ReactNode } from "react" import { usePanelControlContext } from "@/ui/PanelContext" +export type OpenLocation = + | "top-left" + | "top" + | "top-right" + | "left" + | "center" + | "right" + | "bottom-left" + | "bottom" + | "bottom-right" + +type LocationOptions = { className: string; styles: { [key: string]: string } } + +const getLocationClasses = (openLocation: OpenLocation, sidePadding: number): LocationOptions => { + // Can't use tailwind left-[custom] because it won't generate the classes since we're using them dynamically with string templating + const paddingStyle = `${sidePadding}px` + switch (openLocation) { + case "top-left": + return { + className: ``, + styles: { left: paddingStyle, top: paddingStyle }, + } + case "top": + return { + className: `left-1/2 -translate-x-1/2`, + styles: { top: paddingStyle }, + } + case "top-right": + return { + className: ``, + styles: { right: paddingStyle, top: paddingStyle }, + } + case "left": + return { + className: `top-1/2 -translate-y-1/2`, + styles: { left: paddingStyle }, + } + case "center": + return { + className: `left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`, + styles: {}, + } + case "right": + return { + className: `top-1/2 -translate-y-1/2`, + styles: { right: paddingStyle }, + } + case "bottom-left": + return { + className: ``, + styles: { left: paddingStyle, bottom: paddingStyle }, + } + case "bottom": + return { + className: `left-1/2 -translate-x-1/2`, + styles: { bottom: paddingStyle }, + } + case "bottom-right": + return { + className: ``, + styles: { right: paddingStyle, bottom: paddingStyle }, + } + } +} + export type PanelPropsImpl = { panelId: string + openLocation?: OpenLocation + sidePadding?: number } type PanelProps = { panelId: string + openLocation?: OpenLocation + sidePadding?: number name?: string icon?: ReactNode | string onCancel?: () => void @@ -31,6 +100,8 @@ const Panel: React.FC = ({ name, icon, panelId, + openLocation, + sidePadding, onCancel, onMiddle, onAccept, @@ -47,88 +118,81 @@ const Panel: React.FC = ({ contentClassName, }) => { const { closePanel } = usePanelControlContext() - const iconEl: ReactNode = - typeof icon === "string" ? ( - Icon - ) : ( - icon - ) + const iconEl: ReactNode = typeof icon === "string" ? Icon : icon + openLocation ||= "center" + sidePadding ||= 16 + const locationClasses = getLocationClasses(openLocation, sidePadding) return ( -
- {name && ( - - )} +
- {children} -
- {(cancelEnabled || middleEnabled || acceptEnabled) && ( + {name && ( + + )} - )} + {(cancelEnabled || middleEnabled || acceptEnabled) && ( + + )} +
) } +//
+//
export default Panel diff --git a/fission/src/ui/components/Radio.tsx b/fission/src/ui/components/Radio.tsx index fd23c43c24..da5a6d368c 100644 --- a/fission/src/ui/components/Radio.tsx +++ b/fission/src/ui/components/Radio.tsx @@ -9,19 +9,11 @@ type RadioProps = { onClick?: () => void } -const Radio: React.FC = ({ - label, - className, - defaultState, - onClick, -}) => { +const Radio: React.FC = ({ label, className, defaultState, onClick }) => { const [, setState] = useState(defaultState) return ( - - diff --git a/fission/src/ui/components/UserIcon.tsx b/fission/src/ui/components/UserIcon.tsx index 4fce62d302..3d8f359abb 100644 --- a/fission/src/ui/components/UserIcon.tsx +++ b/fission/src/ui/components/UserIcon.tsx @@ -1,13 +1,12 @@ -import APS, { APS_USER_INFO_UPDATE_EVENT } from "@/aps/APS"; -import { useEffect, useState } from "react"; -import { FaQuestion } from "react-icons/fa"; +import APS, { APS_USER_INFO_UPDATE_EVENT } from "@/aps/APS" +import { useEffect, useState } from "react" +import { FaQuestion } from "react-icons/fa" interface UserIconProps { - className: string; + className: string } export function UserIcon({ className }: UserIconProps) { - const [userInfo, setUserInfo] = useState(APS.userInfo) useEffect(() => { @@ -15,8 +14,8 @@ export function UserIcon({ className }: UserIconProps) { }, []) if (!userInfo) { - return () + return } else { - return () + return } -} \ No newline at end of file +} diff --git a/fission/src/ui/modals/DownloadAssetsModal.tsx b/fission/src/ui/modals/DownloadAssetsModal.tsx index b37f5bfc89..875857c5ef 100644 --- a/fission/src/ui/modals/DownloadAssetsModal.tsx +++ b/fission/src/ui/modals/DownloadAssetsModal.tsx @@ -10,49 +10,17 @@ const DownloadAssetsModal: React.FC = ({ modalId }) => ( - - - - + + + + - - - - + + + + diff --git a/fission/src/ui/modals/ExitSynthesisModal.tsx b/fission/src/ui/modals/ExitSynthesisModal.tsx index 90803210c8..1014e7a442 100644 --- a/fission/src/ui/modals/ExitSynthesisModal.tsx +++ b/fission/src/ui/modals/ExitSynthesisModal.tsx @@ -6,16 +6,9 @@ import Label from "@/components/Label" const ExitSynthesisModal: React.FC = ({ modalId }) => { const isOnMainMenu = false return ( - } - modalId={modalId} - acceptName="Exit" - > + } modalId={modalId} acceptName="Exit"> ) diff --git a/fission/src/ui/modals/UpdateAvailableModal.tsx b/fission/src/ui/modals/UpdateAvailableModal.tsx index 5d6dda5cad..6cbeb3cd27 100644 --- a/fission/src/ui/modals/UpdateAvailableModal.tsx +++ b/fission/src/ui/modals/UpdateAvailableModal.tsx @@ -5,12 +5,7 @@ import Label from "@/components/Label" const UpdateAvailableModal: React.FC = ({ modalId }) => { return ( - } - modalId={modalId} - acceptName="Update" - > + } modalId={modalId} acceptName="Update"> diff --git a/fission/src/ui/modals/aether/ConnectToMultiplayerModal.tsx b/fission/src/ui/modals/aether/ConnectToMultiplayerModal.tsx index 73b9558ca0..51f037ac93 100644 --- a/fission/src/ui/modals/aether/ConnectToMultiplayerModal.tsx +++ b/fission/src/ui/modals/aether/ConnectToMultiplayerModal.tsx @@ -21,10 +21,7 @@ const ConnectToMultiplayerModal: React.FC = ({ modalId }) => ( - {}} - /> + {}} />