@anov/3d-ability 0.0.25 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/common/IconStyle.d.ts +17 -0
  2. package/dist/common/IconStyle.js +41 -0
  3. package/dist/common/IconStyle.js.map +1 -0
  4. package/dist/common/ImageStyle.d.ts +15 -0
  5. package/dist/common/ImageStyle.js +37 -0
  6. package/dist/common/ImageStyle.js.map +1 -0
  7. package/dist/common/LabelStyle.d.ts +24 -0
  8. package/dist/common/LabelStyle.js +71 -0
  9. package/dist/common/LabelStyle.js.map +1 -0
  10. package/dist/common/component.d.ts +15 -0
  11. package/dist/common/component.js +70 -0
  12. package/dist/common/component.js.map +1 -0
  13. package/dist/common/constant.d.ts +5 -0
  14. package/dist/common/constant.js +7 -0
  15. package/dist/common/constant.js.map +1 -0
  16. package/dist/controls/base.d.ts +6 -3
  17. package/dist/controls/base.js +21 -3
  18. package/dist/controls/base.js.map +1 -1
  19. package/dist/controls/index.d.ts +2 -1
  20. package/dist/controls/index.js +2 -1
  21. package/dist/controls/index.js.map +1 -1
  22. package/dist/controls/src/ThirdViewControl/action/input.d.ts +9 -0
  23. package/dist/controls/src/ThirdViewControl/action/input.js +116 -0
  24. package/dist/controls/src/ThirdViewControl/action/input.js.map +1 -0
  25. package/dist/controls/src/ThirdViewControl/config/constants.d.ts +1 -0
  26. package/dist/controls/src/ThirdViewControl/config/constants.js +3 -0
  27. package/dist/controls/src/ThirdViewControl/config/constants.js.map +1 -0
  28. package/dist/controls/src/ThirdViewControl/index.d.ts +16 -0
  29. package/dist/controls/src/ThirdViewControl/index.js +48 -0
  30. package/dist/controls/src/ThirdViewControl/index.js.map +1 -0
  31. package/dist/controls/src/ThirdViewControl/player/animation.d.ts +28 -0
  32. package/dist/controls/src/ThirdViewControl/player/animation.js +207 -0
  33. package/dist/controls/src/ThirdViewControl/player/animation.js.map +1 -0
  34. package/dist/controls/src/ThirdViewControl/player/camera.d.ts +26 -0
  35. package/dist/controls/src/ThirdViewControl/player/camera.js +86 -0
  36. package/dist/controls/src/ThirdViewControl/player/camera.js.map +1 -0
  37. package/dist/controls/src/ThirdViewControl/player/control.d.ts +33 -0
  38. package/dist/controls/src/ThirdViewControl/player/control.js +85 -0
  39. package/dist/controls/src/ThirdViewControl/player/control.js.map +1 -0
  40. package/dist/controls/src/ThirdViewControl/player.d.ts +23 -0
  41. package/dist/controls/src/ThirdViewControl/player.js +115 -0
  42. package/dist/controls/src/ThirdViewControl/player.js.map +1 -0
  43. package/dist/controls/src/ThirdViewControl/type.d.ts +41 -0
  44. package/dist/controls/src/ThirdViewControl/type.js +2 -0
  45. package/dist/controls/src/ThirdViewControl/type.js.map +1 -0
  46. package/dist/index.d.ts +7 -4
  47. package/dist/index.js +7 -4
  48. package/dist/index.js.map +1 -1
  49. package/dist/poi/2D/index.d.ts +1 -1
  50. package/dist/poi/2D/index.js +1 -1
  51. package/dist/poi/2D/index.js.map +1 -1
  52. package/dist/poi/3D/index.d.ts +1 -1
  53. package/dist/poi/3D/index.js +1 -1
  54. package/dist/poi/3D/index.js.map +1 -1
  55. package/dist/poi/Base.d.ts +12 -0
  56. package/dist/poi/Base.js +55 -0
  57. package/dist/poi/Base.js.map +1 -0
  58. package/dist/poi/Poi.d.ts +11 -10
  59. package/dist/poi/Poi.js +88 -26
  60. package/dist/poi/Poi.js.map +1 -1
  61. package/dist/poi/Sprite/index.d.ts +1 -1
  62. package/dist/poi/Sprite/index.js +1 -1
  63. package/dist/poi/Sprite/index.js.map +1 -1
  64. package/dist/poi/Sprite/index2.js.map +1 -1
  65. package/dist/poi/index.d.ts +2 -1
  66. package/dist/poi/index.js +2 -1
  67. package/dist/poi/index.js.map +1 -1
  68. package/dist/postEffects/bloomSelect.d.ts +9 -0
  69. package/dist/postEffects/bloomSelect.js +14 -6
  70. package/dist/postEffects/bloomSelect.js.map +1 -1
  71. package/dist/postEffects/colorifyPass.js +1 -1
  72. package/dist/postEffects/colorifyPass.js.map +1 -1
  73. package/dist/postEffects/index.js +3 -2
  74. package/dist/postEffects/index.js.map +1 -1
  75. package/dist/postEffects/postprocessing.d.ts +2 -0
  76. package/dist/postEffects/postprocessing.js +55 -0
  77. package/dist/postEffects/postprocessing.js.map +1 -0
  78. package/dist/postEffects/saoPass.d.ts +6 -0
  79. package/dist/postEffects/saoPass.js +26 -0
  80. package/dist/postEffects/saoPass.js.map +1 -0
  81. package/dist/widget/icon.d.ts +14 -0
  82. package/dist/widget/icon.js +64 -0
  83. package/dist/widget/icon.js.map +1 -0
  84. package/dist/widget/image.d.ts +14 -0
  85. package/dist/widget/image.js +65 -0
  86. package/dist/widget/image.js.map +1 -0
  87. package/dist/widget/label.d.ts +14 -0
  88. package/dist/widget/label.js +70 -0
  89. package/dist/widget/label.js.map +1 -0
  90. package/dist/widget/poi.d.ts +0 -0
  91. package/dist/widget/poi.js +2 -0
  92. package/dist/widget/poi.js.map +1 -0
  93. package/package.json +7 -4
@@ -0,0 +1,17 @@
1
+ /**
2
+ * ICON样式基础类
3
+ */
4
+ declare class IconStyle {
5
+ source: string;
6
+ color: string;
7
+ width: number;
8
+ height: number;
9
+ constructor({ source, color, width, height }?: {
10
+ source?: string | undefined;
11
+ color?: string | undefined;
12
+ width?: number | undefined;
13
+ height?: number | undefined;
14
+ });
15
+ set(key: keyof this, value: any): void;
16
+ }
17
+ export default IconStyle;
@@ -0,0 +1,41 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ /**
9
+ * ICON样式基础类
10
+ */
11
+ var IconStyle = /*#__PURE__*/function () {
12
+ function IconStyle() {
13
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
14
+ _ref$source = _ref.source,
15
+ source = _ref$source === void 0 ? '' : _ref$source,
16
+ _ref$color = _ref.color,
17
+ color = _ref$color === void 0 ? '#ffffff' : _ref$color,
18
+ _ref$width = _ref.width,
19
+ width = _ref$width === void 0 ? 200 : _ref$width,
20
+ _ref$height = _ref.height,
21
+ height = _ref$height === void 0 ? 100 : _ref$height;
22
+ _classCallCheck(this, IconStyle);
23
+ _defineProperty(this, "source", void 0);
24
+ _defineProperty(this, "color", void 0);
25
+ _defineProperty(this, "width", void 0);
26
+ _defineProperty(this, "height", void 0);
27
+ this.source = source;
28
+ this.color = color;
29
+ this.width = width;
30
+ this.height = height;
31
+ }
32
+ _createClass(IconStyle, [{
33
+ key: "set",
34
+ value: function set(key, value) {
35
+ if (key in this) this[key] = value;else console.warn("Property ".concat(String(key), " does not exist on ImageProperty"));
36
+ }
37
+ }]);
38
+ return IconStyle;
39
+ }();
40
+ export default IconStyle;
41
+ //# sourceMappingURL=IconStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["IconStyle","source","color","width","height","key","value","console","warn","String"],"sources":["../../src/common/IconStyle.ts"],"sourcesContent":["/**\n * ICON样式基础类\n */\n\nclass IconStyle {\n source: string\n color: string\n width: number\n height: number\n\n constructor({ source = '', color = '#ffffff', width = 200, height = 100 } = {}) {\n this.source = source\n this.color = color\n this.width = width\n this.height = height\n }\n\n set(key: keyof this, value: any) {\n if (key in this)\n this[key] = value\n else\n console.warn(`Property ${String(key)} does not exist on ImageProperty`)\n }\n}\n\nexport default IconStyle\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAIMA,SAAS;EAMb,qBAAgF;IAAA,+EAAJ,CAAC,CAAC;MAAA,mBAAhEC,MAAM;MAANA,MAAM,4BAAG,EAAE;MAAA,kBAAEC,KAAK;MAALA,KAAK,2BAAG,SAAS;MAAA,kBAAEC,KAAK;MAALA,KAAK,2BAAG,GAAG;MAAA,mBAAEC,MAAM;MAANA,MAAM,4BAAG,GAAG;IAAA;IAAA;IAAA;IAAA;IAAA;IACrE,IAAI,CAACH,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,MAAM,GAAGA,MAAM;EACtB;EAAC;IAAA;IAAA,OAED,aAAIC,GAAe,EAAEC,KAAU,EAAE;MAC/B,IAAID,GAAG,IAAI,IAAI,EACb,IAAI,CAACA,GAAG,CAAC,GAAGC,KAAK,MAEjBC,OAAO,CAACC,IAAI,oBAAaC,MAAM,CAACJ,GAAG,CAAC,sCAAmC;IAC3E;EAAC;EAAA;AAAA;AAGH,eAAeL,SAAS"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 图片样式基础类
3
+ */
4
+ declare class ImageStyle {
5
+ source: string;
6
+ width: number;
7
+ height: number;
8
+ constructor({ source, width, height }?: {
9
+ source?: string | undefined;
10
+ width?: number | undefined;
11
+ height?: number | undefined;
12
+ });
13
+ set(key: keyof this, value: any): void;
14
+ }
15
+ export default ImageStyle;
@@ -0,0 +1,37 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ /**
9
+ * 图片样式基础类
10
+ */
11
+ var ImageStyle = /*#__PURE__*/function () {
12
+ function ImageStyle() {
13
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
14
+ _ref$source = _ref.source,
15
+ source = _ref$source === void 0 ? '' : _ref$source,
16
+ _ref$width = _ref.width,
17
+ width = _ref$width === void 0 ? 200 : _ref$width,
18
+ _ref$height = _ref.height,
19
+ height = _ref$height === void 0 ? 100 : _ref$height;
20
+ _classCallCheck(this, ImageStyle);
21
+ _defineProperty(this, "source", void 0);
22
+ _defineProperty(this, "width", void 0);
23
+ _defineProperty(this, "height", void 0);
24
+ this.source = source;
25
+ this.width = width;
26
+ this.height = height;
27
+ }
28
+ _createClass(ImageStyle, [{
29
+ key: "set",
30
+ value: function set(key, value) {
31
+ if (key in this) this[key] = value;else console.warn("Property ".concat(String(key), " does not exist on ImageProperty"));
32
+ }
33
+ }]);
34
+ return ImageStyle;
35
+ }();
36
+ export default ImageStyle;
37
+ //# sourceMappingURL=ImageStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ImageStyle","source","width","height","key","value","console","warn","String"],"sources":["../../src/common/ImageStyle.ts"],"sourcesContent":["/**\n * 图片样式基础类\n */\n\nclass ImageStyle {\n source: string\n width: number\n height: number\n\n constructor({ source = '', width = 200, height = 100 } = {}) {\n this.source = source\n this.width = width\n this.height = height\n }\n\n set(key: keyof this, value: any) {\n if (key in this)\n this[key] = value\n else\n console.warn(`Property ${String(key)} does not exist on ImageProperty`)\n }\n}\n\nexport default ImageStyle\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAIMA,UAAU;EAKd,sBAA6D;IAAA,+EAAJ,CAAC,CAAC;MAAA,mBAA7CC,MAAM;MAANA,MAAM,4BAAG,EAAE;MAAA,kBAAEC,KAAK;MAALA,KAAK,2BAAG,GAAG;MAAA,mBAAEC,MAAM;MAANA,MAAM,4BAAG,GAAG;IAAA;IAAA;IAAA;IAAA;IAClD,IAAI,CAACF,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,MAAM,GAAGA,MAAM;EACtB;EAAC;IAAA;IAAA,OAED,aAAIC,GAAe,EAAEC,KAAU,EAAE;MAC/B,IAAID,GAAG,IAAI,IAAI,EACb,IAAI,CAACA,GAAG,CAAC,GAAGC,KAAK,MAEjBC,OAAO,CAACC,IAAI,oBAAaC,MAAM,CAACJ,GAAG,CAAC,sCAAmC;IAC3E;EAAC;EAAA;AAAA;AAGH,eAAeJ,UAAU"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 文字样式基础类
3
+ */
4
+ declare class LabelStyle {
5
+ text: string;
6
+ fontSize: number;
7
+ fontColor: string;
8
+ fontWeight: string | number;
9
+ fontFamily: string;
10
+ constructor({ text, fontSize, fontColor, fontWeight, fontFamily }?: {
11
+ text?: string | undefined;
12
+ fontSize?: number | undefined;
13
+ fontColor?: string | undefined;
14
+ fontWeight?: string | undefined;
15
+ fontFamily?: string | undefined;
16
+ });
17
+ setText(text: string): void;
18
+ setFontSize(size: number): void;
19
+ setFontColor(color: string): void;
20
+ setFontWeight(weight: string | number): void;
21
+ setFontFamily(family: string): void;
22
+ set(key: keyof this, value: any): void;
23
+ }
24
+ export default LabelStyle;
@@ -0,0 +1,71 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ /**
9
+ * 文字样式基础类
10
+ */
11
+ var LabelStyle = /*#__PURE__*/function () {
12
+ function LabelStyle() {
13
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
14
+ _ref$text = _ref.text,
15
+ text = _ref$text === void 0 ? '' : _ref$text,
16
+ _ref$fontSize = _ref.fontSize,
17
+ fontSize = _ref$fontSize === void 0 ? 16 : _ref$fontSize,
18
+ _ref$fontColor = _ref.fontColor,
19
+ fontColor = _ref$fontColor === void 0 ? '#ffffff' : _ref$fontColor,
20
+ _ref$fontWeight = _ref.fontWeight,
21
+ fontWeight = _ref$fontWeight === void 0 ? 'normal' : _ref$fontWeight,
22
+ _ref$fontFamily = _ref.fontFamily,
23
+ fontFamily = _ref$fontFamily === void 0 ? '' : _ref$fontFamily;
24
+ _classCallCheck(this, LabelStyle);
25
+ _defineProperty(this, "text", void 0);
26
+ _defineProperty(this, "fontSize", void 0);
27
+ _defineProperty(this, "fontColor", void 0);
28
+ _defineProperty(this, "fontWeight", void 0);
29
+ _defineProperty(this, "fontFamily", void 0);
30
+ this.text = text;
31
+ this.fontSize = fontSize;
32
+ this.fontColor = fontColor;
33
+ this.fontWeight = fontWeight;
34
+ this.fontFamily = fontFamily;
35
+ }
36
+ _createClass(LabelStyle, [{
37
+ key: "setText",
38
+ value: function setText(text) {
39
+ this.text = text;
40
+ }
41
+ }, {
42
+ key: "setFontSize",
43
+ value: function setFontSize(size) {
44
+ this.fontSize = size;
45
+ }
46
+ }, {
47
+ key: "setFontColor",
48
+ value: function setFontColor(color) {
49
+ this.fontColor = color;
50
+ }
51
+ }, {
52
+ key: "setFontWeight",
53
+ value: function setFontWeight(weight) {
54
+ this.fontWeight = weight;
55
+ }
56
+ }, {
57
+ key: "setFontFamily",
58
+ value: function setFontFamily(family) {
59
+ this.fontFamily = family;
60
+ }
61
+ }, {
62
+ key: "set",
63
+ value: function set(key, value) {
64
+ // eslint-disable-next-line no-prototype-builtins
65
+ if (this.hasOwnProperty(key)) this[key] = value;else console.warn("Property ".concat(String(key), " does not exist on Text"));
66
+ }
67
+ }]);
68
+ return LabelStyle;
69
+ }();
70
+ export default LabelStyle;
71
+ //# sourceMappingURL=LabelStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LabelStyle","text","fontSize","fontColor","fontWeight","fontFamily","size","color","weight","family","key","value","hasOwnProperty","console","warn","String"],"sources":["../../src/common/LabelStyle.ts"],"sourcesContent":["/**\n * 文字样式基础类\n */\n\nclass LabelStyle {\n text: string\n fontSize: number\n fontColor: string\n fontWeight: string | number\n fontFamily: string\n\n constructor({ text = '', fontSize = 16, fontColor = '#ffffff', fontWeight = 'normal', fontFamily = '' } = {}) {\n this.text = text\n this.fontSize = fontSize\n this.fontColor = fontColor\n this.fontWeight = fontWeight\n this.fontFamily = fontFamily\n }\n\n setText(text: string) {\n this.text = text\n }\n\n setFontSize(size: number) {\n this.fontSize = size\n }\n\n setFontColor(color: string) {\n this.fontColor = color\n }\n\n setFontWeight(weight: string | number) {\n this.fontWeight = weight\n }\n\n setFontFamily(family: string) {\n this.fontFamily = family\n }\n\n set(key: keyof this, value: any) {\n // eslint-disable-next-line no-prototype-builtins\n if (this.hasOwnProperty(key))\n this[key] = value\n else\n console.warn(`Property ${String(key)} does not exist on Text`)\n }\n}\n\nexport default LabelStyle\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAIMA,UAAU;EAOd,sBAA8G;IAAA,+EAAJ,CAAC,CAAC;MAAA,iBAA9FC,IAAI;MAAJA,IAAI,0BAAG,EAAE;MAAA,qBAAEC,QAAQ;MAARA,QAAQ,8BAAG,EAAE;MAAA,sBAAEC,SAAS;MAATA,SAAS,+BAAG,SAAS;MAAA,uBAAEC,UAAU;MAAVA,UAAU,gCAAG,QAAQ;MAAA,uBAAEC,UAAU;MAAVA,UAAU,gCAAG,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IACnG,IAAI,CAACJ,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACC,UAAU,GAAGA,UAAU;EAC9B;EAAC;IAAA;IAAA,OAED,iBAAQJ,IAAY,EAAE;MACpB,IAAI,CAACA,IAAI,GAAGA,IAAI;IAClB;EAAC;IAAA;IAAA,OAED,qBAAYK,IAAY,EAAE;MACxB,IAAI,CAACJ,QAAQ,GAAGI,IAAI;IACtB;EAAC;IAAA;IAAA,OAED,sBAAaC,KAAa,EAAE;MAC1B,IAAI,CAACJ,SAAS,GAAGI,KAAK;IACxB;EAAC;IAAA;IAAA,OAED,uBAAcC,MAAuB,EAAE;MACrC,IAAI,CAACJ,UAAU,GAAGI,MAAM;IAC1B;EAAC;IAAA;IAAA,OAED,uBAAcC,MAAc,EAAE;MAC5B,IAAI,CAACJ,UAAU,GAAGI,MAAM;IAC1B;EAAC;IAAA;IAAA,OAED,aAAIC,GAAe,EAAEC,KAAU,EAAE;MAC/B;MACA,IAAI,IAAI,CAACC,cAAc,CAACF,GAAG,CAAC,EAC1B,IAAI,CAACA,GAAG,CAAC,GAAGC,KAAK,MAEjBE,OAAO,CAACC,IAAI,oBAAaC,MAAM,CAACL,GAAG,CAAC,6BAA0B;IAClE;EAAC;EAAA;AAAA;AAGH,eAAeV,UAAU"}
@@ -0,0 +1,15 @@
1
+ import { Object3D } from '@anov/3d-core';
2
+ declare class Component extends Object3D {
3
+ id: number;
4
+ name: string;
5
+ children: [];
6
+ isComponent: boolean;
7
+ constructor();
8
+ onUpdate(): void;
9
+ onDestroy(): void;
10
+ create(): void;
11
+ delete(): void;
12
+ update(): void;
13
+ get(): void;
14
+ }
15
+ export default Component;
@@ -0,0 +1,70 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
6
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
7
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
9
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
10
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
+ import { Object3D } from '@anov/3d-core';
16
+ var Component = /*#__PURE__*/function (_Object3D) {
17
+ _inherits(Component, _Object3D);
18
+ var _super = _createSuper(Component);
19
+ function Component() {
20
+ var _this;
21
+ _classCallCheck(this, Component);
22
+ _this = _super.call(this);
23
+ _defineProperty(_assertThisInitialized(_this), "id", void 0);
24
+ _defineProperty(_assertThisInitialized(_this), "name", void 0);
25
+ _defineProperty(_assertThisInitialized(_this), "children", void 0);
26
+ _defineProperty(_assertThisInitialized(_this), "isComponent", void 0);
27
+ _this.isComponent = true;
28
+ return _this;
29
+ }
30
+
31
+ // 生命周期
32
+ // // 在对象渲染之前直接执行
33
+ // onBeforeRender() {}
34
+ // // 在对象渲染之后直接执行
35
+ // onAfterRender() {}
36
+ // 每帧调用进入
37
+ _createClass(Component, [{
38
+ key: "onUpdate",
39
+ value: function onUpdate() {}
40
+ // 销毁
41
+ }, {
42
+ key: "onDestroy",
43
+ value: function onDestroy() {}
44
+
45
+ // 新增
46
+ }, {
47
+ key: "create",
48
+ value: function create() {}
49
+ // 删除
50
+ }, {
51
+ key: "delete",
52
+ value: function _delete() {
53
+ var _this$parent;
54
+ this.onDestroy();
55
+ (_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.remove(this);
56
+ }
57
+
58
+ // 修改
59
+ }, {
60
+ key: "update",
61
+ value: function update() {}
62
+ // 获取
63
+ }, {
64
+ key: "get",
65
+ value: function get() {}
66
+ }]);
67
+ return Component;
68
+ }(Object3D);
69
+ export default Component;
70
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Object3D","Component","isComponent","onDestroy","parent","remove"],"sources":["../../src/common/component.ts"],"sourcesContent":["import { Object3D } from '@anov/3d-core'\n\nclass Component extends Object3D {\n id!: number\n name!: string\n children!: []\n isComponent: boolean\n\n constructor() {\n super()\n this.isComponent = true\n }\n\n // 生命周期\n // // 在对象渲染之前直接执行\n // onBeforeRender() {}\n // // 在对象渲染之后直接执行\n // onAfterRender() {}\n // 每帧调用进入\n onUpdate() {}\n // 销毁\n onDestroy() {}\n\n // 新增\n create() { }\n // 删除\n delete() {\n this.onDestroy()\n this.parent?.remove(this)\n }\n\n // 修改\n update() { }\n // 获取\n get() { }\n}\n\nexport default Component"],"mappings":";;;;;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,eAAe;AAAA,IAElCC,SAAS;EAAA;EAAA;EAMb,qBAAc;IAAA;IAAA;IACZ;IAAO;IAAA;IAAA;IAAA;IACP,MAAKC,WAAW,GAAG,IAAI;IAAA;EACzB;;EAEA;EACA;EACA;EACA;EACA;EACA;EAAA;IAAA;IAAA,OACA,oBAAW,CAAC;IACZ;EAAA;IAAA;IAAA,OACA,qBAAY,CAAC;;IAEb;EAAA;IAAA;IAAA,OACA,kBAAS,CAAE;IACX;EAAA;IAAA;IAAA,OACA,mBAAS;MAAA;MACP,IAAI,CAACC,SAAS,EAAE;MAChB,oBAAI,CAACC,MAAM,iDAAX,aAAaC,MAAM,CAAC,IAAI,CAAC;IAC3B;;IAEA;EAAA;IAAA;IAAA,OACA,kBAAS,CAAE;IACX;EAAA;IAAA;IAAA,OACA,eAAM,CAAE;EAAC;EAAA;AAAA,EAhCaL,QAAQ;AAmChC,eAAeC,SAAS"}
@@ -0,0 +1,5 @@
1
+ export declare enum RenderType {
2
+ Sprite = "Sprite",
3
+ Plane = "Plane",
4
+ Fixed = "Fixed"
5
+ }
@@ -0,0 +1,7 @@
1
+ export var RenderType; // 2D绘制,不支持缩放,始终面向镜头
2
+ (function (RenderType) {
3
+ RenderType["Sprite"] = "Sprite";
4
+ RenderType["Plane"] = "Plane";
5
+ RenderType["Fixed"] = "Fixed";
6
+ })(RenderType || (RenderType = {}));
7
+ //# sourceMappingURL=constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["RenderType"],"sources":["../../src/common/constant.ts"],"sourcesContent":["export enum RenderType {\n Sprite = 'Sprite', // 2D精灵图,始终面向镜头,跟随场景缩放\n Plane = 'Plane', // 3D绘制,跟随场景旋转、缩放\n Fixed = 'Fixed', // 2D绘制,不支持缩放,始终面向镜头\n}\n"],"mappings":"AAAA,WAAYA,UAAU,EAGH;AAClB,WAJWA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,KAAVA,UAAU"}
@@ -1,7 +1,10 @@
1
- import type { Camera } from '@anov/3d-core';
1
+ import type { Camera, Scene } from '@anov/3d-core';
2
2
  declare class ControlBaseModule {
3
3
  camera: Camera;
4
- dom: HTMLElement;
5
- constructor(camera: Camera, dom: HTMLElement);
4
+ constructor(camera: Camera);
5
+ }
6
+ export declare class ControlThirdModule extends ControlBaseModule {
7
+ scene: Scene;
8
+ constructor(camera: Camera, scene: Scene);
6
9
  }
7
10
  export default ControlBaseModule;
@@ -1,16 +1,34 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
3
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
4
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
5
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
6
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
7
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2
9
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
10
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
11
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
12
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
13
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
14
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
- var ControlBaseModule = /*#__PURE__*/_createClass(function ControlBaseModule(camera, dom) {
15
+ var ControlBaseModule = /*#__PURE__*/_createClass(function ControlBaseModule(camera) {
9
16
  _classCallCheck(this, ControlBaseModule);
10
17
  _defineProperty(this, "camera", void 0);
11
- _defineProperty(this, "dom", void 0);
12
18
  this.camera = camera;
13
- this.dom = dom;
14
19
  });
20
+ export var ControlThirdModule = /*#__PURE__*/function (_ControlBaseModule) {
21
+ _inherits(ControlThirdModule, _ControlBaseModule);
22
+ var _super = _createSuper(ControlThirdModule);
23
+ function ControlThirdModule(camera, scene) {
24
+ var _this;
25
+ _classCallCheck(this, ControlThirdModule);
26
+ _this = _super.call(this, camera);
27
+ _defineProperty(_assertThisInitialized(_this), "scene", void 0);
28
+ _this.scene = scene;
29
+ return _this;
30
+ }
31
+ return _createClass(ControlThirdModule);
32
+ }(ControlBaseModule);
15
33
  export default ControlBaseModule;
16
34
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ControlBaseModule","camera","dom"],"sources":["../../src/controls/base.ts"],"sourcesContent":["import type { Camera } from '@anov/3d-core'\n\nclass ControlBaseModule {\n camera: Camera\n dom: HTMLElement\n\n constructor(camera: Camera, dom: HTMLElement) {\n this.camera = camera\n this.dom = dom\n }\n}\n\nexport default ControlBaseModule"],"mappings":";;;;;;;IAEMA,iBAAiB,6BAIrB,2BAAYC,MAAc,EAAEC,GAAgB,EAAE;EAAA;EAAA;EAAA;EAC5C,IAAI,CAACD,MAAM,GAAGA,MAAM;EACpB,IAAI,CAACC,GAAG,GAAGA,GAAG;AAChB,CAAC;AAGH,eAAeF,iBAAiB"}
1
+ {"version":3,"names":["ControlBaseModule","camera","ControlThirdModule","scene"],"sources":["../../src/controls/base.ts"],"sourcesContent":["import type { Camera, Scene } from '@anov/3d-core'\n\nclass ControlBaseModule {\n camera: Camera\n\n constructor(camera: Camera) {\n this.camera = camera\n }\n}\n\nexport class ControlThirdModule extends ControlBaseModule {\n scene: Scene\n constructor(camera: Camera, scene: Scene) {\n super(camera)\n this.scene = scene\n }\n}\n\nexport default ControlBaseModule\n"],"mappings":";;;;;;;;;;;;;;IAEMA,iBAAiB,6BAGrB,2BAAYC,MAAc,EAAE;EAAA;EAAA;EAC1B,IAAI,CAACA,MAAM,GAAGA,MAAM;AACtB,CAAC;AAGH,WAAaC,kBAAkB;EAAA;EAAA;EAE7B,4BAAYD,MAAc,EAAEE,KAAY,EAAE;IAAA;IAAA;IACxC,0BAAMF,MAAM;IAAC;IACb,MAAKE,KAAK,GAAGA,KAAK;IAAA;EACpB;EAAC;AAAA,EALqCH,iBAAiB;AAQzD,eAAeA,iBAAiB"}
@@ -1,2 +1,3 @@
1
1
  import FirstViewControl from './src/FirstViewControl';
2
- export { FirstViewControl, };
2
+ import ThirdViewControl from './src/ThirdViewControl';
3
+ export { FirstViewControl, ThirdViewControl, };
@@ -1,3 +1,4 @@
1
1
  import FirstViewControl from "./src/FirstViewControl";
2
- export { FirstViewControl };
2
+ import ThirdViewControl from "./src/ThirdViewControl";
3
+ export { FirstViewControl, ThirdViewControl };
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FirstViewControl"],"sources":["../../src/controls/index.ts"],"sourcesContent":["import FirstViewControl from './src/FirstViewControl'\n\nexport {\n FirstViewControl,\n}"],"mappings":"AAAA,OAAOA,gBAAgB;AAEvB,SACEA,gBAAgB"}
1
+ {"version":3,"names":["FirstViewControl","ThirdViewControl"],"sources":["../../src/controls/index.ts"],"sourcesContent":["import FirstViewControl from './src/FirstViewControl'\nimport ThirdViewControl from './src/ThirdViewControl'\n\nexport {\n FirstViewControl,\n ThirdViewControl,\n}"],"mappings":"AAAA,OAAOA,gBAAgB;AACvB,OAAOC,gBAAgB;AAEvB,SACED,gBAAgB,EAChBC,gBAAgB"}
@@ -0,0 +1,9 @@
1
+ import type { PlayerInput } from '../type';
2
+ export default class BasicCharacterControllerInput {
3
+ keys: PlayerInput | any;
4
+ constructor();
5
+ initialize(): void;
6
+ handleLockChange(): void;
7
+ onKeydown(e: KeyboardEvent): void;
8
+ onKeyup(e: KeyboardEvent): void;
9
+ }
@@ -0,0 +1,116 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ var BasicCharacterControllerInput = /*#__PURE__*/function () {
9
+ function BasicCharacterControllerInput() {
10
+ _classCallCheck(this, BasicCharacterControllerInput);
11
+ _defineProperty(this, "keys", void 0);
12
+ this.initialize();
13
+ }
14
+ _createClass(BasicCharacterControllerInput, [{
15
+ key: "initialize",
16
+ value: function initialize() {
17
+ var _this = this;
18
+ this.keys = {
19
+ forward: false,
20
+ backward: false,
21
+ left: false,
22
+ right: false,
23
+ space: false,
24
+ shift: false,
25
+ leftClick: false,
26
+ rightClick: false
27
+ };
28
+ document.addEventListener('keydown', function (e) {
29
+ return _this.onKeydown(e);
30
+ }, false);
31
+ document.addEventListener('keyup', function (e) {
32
+ return _this.onKeyup(e);
33
+ }, false);
34
+ }
35
+ }, {
36
+ key: "handleLockChange",
37
+ value: function handleLockChange() {
38
+ var canvas = document.querySelector('canvas');
39
+ if (document.pointerLockElement !== canvas) {
40
+ this.keys = {
41
+ forward: false,
42
+ backward: false,
43
+ left: false,
44
+ right: false,
45
+ space: false,
46
+ shift: false,
47
+ leftClick: false,
48
+ rightClick: false
49
+ };
50
+ }
51
+ }
52
+ }, {
53
+ key: "onKeydown",
54
+ value: function onKeydown(e) {
55
+ switch (e.keyCode) {
56
+ case 87:
57
+ // w
58
+ this.keys.forward = true;
59
+ break;
60
+ case 65:
61
+ // a
62
+ this.keys.left = true;
63
+ break;
64
+ case 83:
65
+ // s
66
+ this.keys.backward = true;
67
+ break;
68
+ case 68:
69
+ // d
70
+ this.keys.right = true;
71
+ break;
72
+ case 32:
73
+ // space
74
+ this.keys.space = true;
75
+ break;
76
+ case 16:
77
+ // shift
78
+ this.keys.shift = true;
79
+ break;
80
+ }
81
+ }
82
+ }, {
83
+ key: "onKeyup",
84
+ value: function onKeyup(e) {
85
+ switch (e.keyCode) {
86
+ case 87:
87
+ // w
88
+ this.keys.forward = false;
89
+ break;
90
+ case 65:
91
+ // a
92
+ this.keys.left = false;
93
+ break;
94
+ case 83:
95
+ // s
96
+ this.keys.backward = false;
97
+ break;
98
+ case 68:
99
+ // d
100
+ this.keys.right = false;
101
+ break;
102
+ case 32:
103
+ // space
104
+ this.keys.space = false;
105
+ break;
106
+ case 16:
107
+ // shift
108
+ this.keys.shift = false;
109
+ break;
110
+ }
111
+ }
112
+ }]);
113
+ return BasicCharacterControllerInput;
114
+ }();
115
+ export { BasicCharacterControllerInput as default };
116
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BasicCharacterControllerInput","initialize","keys","forward","backward","left","right","space","shift","leftClick","rightClick","document","addEventListener","e","onKeydown","onKeyup","canvas","querySelector","pointerLockElement","keyCode"],"sources":["../../../../../src/controls/src/ThirdViewControl/action/input.ts"],"sourcesContent":["import type { PlayerInput } from '../type'\n\nexport default class BasicCharacterControllerInput {\n keys: PlayerInput | any\n constructor() {\n this.initialize()\n }\n\n initialize() {\n this.keys = {\n forward: false,\n backward: false,\n left: false,\n right: false,\n space: false,\n shift: false,\n leftClick: false,\n rightClick: false,\n }\n\n document.addEventListener('keydown', e => this.onKeydown(e), false)\n document.addEventListener('keyup', e => this.onKeyup(e), false)\n }\n\n handleLockChange() {\n const canvas = document.querySelector('canvas')\n if (document.pointerLockElement !== canvas) {\n this.keys = {\n forward: false,\n backward: false,\n left: false,\n right: false,\n space: false,\n shift: false,\n leftClick: false,\n rightClick: false,\n }\n }\n }\n\n onKeydown(e: KeyboardEvent) {\n switch (e.keyCode) {\n case 87: // w\n this.keys.forward = true\n break\n case 65: // a\n this.keys.left = true\n break\n case 83: // s\n this.keys.backward = true\n break\n case 68: // d\n this.keys.right = true\n break\n case 32: // space\n this.keys.space = true\n break\n case 16: // shift\n this.keys.shift = true\n break\n }\n }\n\n onKeyup(e: KeyboardEvent) {\n switch (e.keyCode) {\n case 87: // w\n this.keys.forward = false\n break\n case 65: // a\n this.keys.left = false\n break\n case 83: // s\n this.keys.backward = false\n break\n case 68: // d\n this.keys.right = false\n break\n case 32: // space\n this.keys.space = false\n break\n case 16: // shift\n this.keys.shift = false\n break\n }\n }\n}\n"],"mappings":";;;;;;;IAEqBA,6BAA6B;EAEhD,yCAAc;IAAA;IAAA;IACZ,IAAI,CAACC,UAAU,EAAE;EACnB;EAAC;IAAA;IAAA,OAED,sBAAa;MAAA;MACX,IAAI,CAACC,IAAI,GAAG;QACVC,OAAO,EAAE,KAAK;QACdC,QAAQ,EAAE,KAAK;QACfC,IAAI,EAAE,KAAK;QACXC,KAAK,EAAE,KAAK;QACZC,KAAK,EAAE,KAAK;QACZC,KAAK,EAAE,KAAK;QACZC,SAAS,EAAE,KAAK;QAChBC,UAAU,EAAE;MACd,CAAC;MAEDC,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAE,UAAAC,CAAC;QAAA,OAAI,KAAI,CAACC,SAAS,CAACD,CAAC,CAAC;MAAA,GAAE,KAAK,CAAC;MACnEF,QAAQ,CAACC,gBAAgB,CAAC,OAAO,EAAE,UAAAC,CAAC;QAAA,OAAI,KAAI,CAACE,OAAO,CAACF,CAAC,CAAC;MAAA,GAAE,KAAK,CAAC;IACjE;EAAC;IAAA;IAAA,OAED,4BAAmB;MACjB,IAAMG,MAAM,GAAGL,QAAQ,CAACM,aAAa,CAAC,QAAQ,CAAC;MAC/C,IAAIN,QAAQ,CAACO,kBAAkB,KAAKF,MAAM,EAAE;QAC1C,IAAI,CAACd,IAAI,GAAG;UACVC,OAAO,EAAE,KAAK;UACdC,QAAQ,EAAE,KAAK;UACfC,IAAI,EAAE,KAAK;UACXC,KAAK,EAAE,KAAK;UACZC,KAAK,EAAE,KAAK;UACZC,KAAK,EAAE,KAAK;UACZC,SAAS,EAAE,KAAK;UAChBC,UAAU,EAAE;QACd,CAAC;MACH;IACF;EAAC;IAAA;IAAA,OAED,mBAAUG,CAAgB,EAAE;MAC1B,QAAQA,CAAC,CAACM,OAAO;QACf,KAAK,EAAE;UAAE;UACP,IAAI,CAACjB,IAAI,CAACC,OAAO,GAAG,IAAI;UACxB;QACF,KAAK,EAAE;UAAE;UACP,IAAI,CAACD,IAAI,CAACG,IAAI,GAAG,IAAI;UACrB;QACF,KAAK,EAAE;UAAE;UACP,IAAI,CAACH,IAAI,CAACE,QAAQ,GAAG,IAAI;UACzB;QACF,KAAK,EAAE;UAAE;UACP,IAAI,CAACF,IAAI,CAACI,KAAK,GAAG,IAAI;UACtB;QACF,KAAK,EAAE;UAAE;UACP,IAAI,CAACJ,IAAI,CAACK,KAAK,GAAG,IAAI;UACtB;QACF,KAAK,EAAE;UAAE;UACP,IAAI,CAACL,IAAI,CAACM,KAAK,GAAG,IAAI;UACtB;MAAK;IAEX;EAAC;IAAA;IAAA,OAED,iBAAQK,CAAgB,EAAE;MACxB,QAAQA,CAAC,CAACM,OAAO;QACf,KAAK,EAAE;UAAE;UACP,IAAI,CAACjB,IAAI,CAACC,OAAO,GAAG,KAAK;UACzB;QACF,KAAK,EAAE;UAAE;UACP,IAAI,CAACD,IAAI,CAACG,IAAI,GAAG,KAAK;UACtB;QACF,KAAK,EAAE;UAAE;UACP,IAAI,CAACH,IAAI,CAACE,QAAQ,GAAG,KAAK;UAC1B;QACF,KAAK,EAAE;UAAE;UACP,IAAI,CAACF,IAAI,CAACI,KAAK,GAAG,KAAK;UACvB;QACF,KAAK,EAAE;UAAE;UACP,IAAI,CAACJ,IAAI,CAACK,KAAK,GAAG,KAAK;UACvB;QACF,KAAK,EAAE;UAAE;UACP,IAAI,CAACL,IAAI,CAACM,KAAK,GAAG,KAAK;UACvB;MAAK;IAEX;EAAC;EAAA;AAAA;AAAA,SAlFkBR,6BAA6B"}
@@ -0,0 +1 @@
1
+ export declare const SPEED = 16;
@@ -0,0 +1,3 @@
1
+ // character
2
+ export var SPEED = 16;
3
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SPEED"],"sources":["../../../../../src/controls/src/ThirdViewControl/config/constants.ts"],"sourcesContent":["// character\nexport const SPEED = 16\n"],"mappings":"AAAA;AACA,OAAO,IAAMA,KAAK,GAAG,EAAE"}
@@ -0,0 +1,16 @@
1
+ import type { PerspectiveCamera, Scene } from '@anov/3d-core';
2
+ import type { ControlThirdModule } from '../../base';
3
+ import Player from './player';
4
+ /**
5
+ * @class ThirdViewControl.ts - third view control module
6
+ *
7
+ * 贴地 (Third View) 控制模块
8
+ */
9
+ declare class ThirdViewControl implements ControlThirdModule {
10
+ scene: Scene;
11
+ camera: PerspectiveCamera;
12
+ entitiesCharacter: Player[];
13
+ constructor(camera: PerspectiveCamera, scene: Scene);
14
+ initialize(): void;
15
+ }
16
+ export default ThirdViewControl;