@anov/3d 0.0.4-alpha15 → 0.0.4-alpha17
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.
- package/dist/applicationApi.js +14 -4
- package/dist/index.js +1 -59
- package/dist/module/camera/index.js +113 -45
- package/dist/module/environment/index.js +3 -0
- package/dist/module/eventBus/index.js +8 -2
- package/dist/sdkEntry.js +60 -0
- package/dist/utils/messageFn.js +7 -7
- package/package.json +3 -3
- package/dist/applicationApi.d.ts +0 -43
- package/dist/hooksManager.d.ts +0 -2
- package/dist/index.d.ts +0 -40
- package/dist/messageStatus.d.ts +0 -52
- package/dist/module/camera/index.d.ts +0 -48
- package/dist/module/environment/index.d.ts +0 -30
- package/dist/module/environment/time/index.d.ts +0 -10
- package/dist/module/environment/weather/type.d.ts +0 -15
- package/dist/module/eventBus/index.d.ts +0 -20
- package/dist/utils/index.d.ts +0 -24
- package/dist/utils/messageFn.d.ts +0 -12
package/dist/applicationApi.js
CHANGED
|
@@ -24,7 +24,7 @@ var Application = /*#__PURE__*/function () {
|
|
|
24
24
|
key: "init",
|
|
25
25
|
value: function init(params, id) {
|
|
26
26
|
try {
|
|
27
|
-
var _camera$fov, _camera$near, _camera$far,
|
|
27
|
+
var _camera$fov, _camera$near, _camera$far, _ref2, _ref3, _params$size$width, _params$size, _params$size$height, _params$size2;
|
|
28
28
|
var _ref = params || {},
|
|
29
29
|
_ref$camera = _ref.camera,
|
|
30
30
|
camera = _ref$camera === void 0 ? {} : _ref$camera;
|
|
@@ -32,8 +32,16 @@ var Application = /*#__PURE__*/function () {
|
|
|
32
32
|
fov: (_camera$fov = camera.fov) !== null && _camera$fov !== void 0 ? _camera$fov : defaultCameraParams.fov,
|
|
33
33
|
near: (_camera$near = camera.near) !== null && _camera$near !== void 0 ? _camera$near : defaultCameraParams.near,
|
|
34
34
|
far: (_camera$far = camera.far) !== null && _camera$far !== void 0 ? _camera$far : defaultCameraParams.far,
|
|
35
|
-
position: object2Vector3((
|
|
36
|
-
|
|
35
|
+
position: object2Vector3((_ref2 = camera.position && {
|
|
36
|
+
x: camera.position[0],
|
|
37
|
+
y: camera.position[1],
|
|
38
|
+
z: camera.position[2]
|
|
39
|
+
}) !== null && _ref2 !== void 0 ? _ref2 : defaultCameraParams.position),
|
|
40
|
+
lookAt: object2Vector3((_ref3 = camera.target && {
|
|
41
|
+
x: camera.target[0],
|
|
42
|
+
y: camera.target[1],
|
|
43
|
+
z: camera.target[2]
|
|
44
|
+
}) !== null && _ref3 !== void 0 ? _ref3 : defaultCameraParams.lookAt)
|
|
37
45
|
};
|
|
38
46
|
var anov3D = new Anov3D({
|
|
39
47
|
container: this.container,
|
|
@@ -60,7 +68,9 @@ var Application = /*#__PURE__*/function () {
|
|
|
60
68
|
var fn = getFnByFnkey(this.iEngine, req.name, req.id);
|
|
61
69
|
try {
|
|
62
70
|
var res = fn(req.params);
|
|
63
|
-
|
|
71
|
+
Promise.resolve(res).then(function (res) {
|
|
72
|
+
sendToMessage(MessageType.Api, req.name, EMessageStatus.Success, req.id, res);
|
|
73
|
+
});
|
|
64
74
|
} catch (error) {
|
|
65
75
|
sendToMessage(MessageType.Api, req.name, EMessageStatus.EventHandleFailed, req.id);
|
|
66
76
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
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); } }
|
|
5
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
-
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; }
|
|
8
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
-
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); }
|
|
10
|
-
import { SceneControl, utils } from '@anov/3d-core';
|
|
11
|
-
import Environment from "./module/environment";
|
|
12
|
-
import EventBus from "./module/eventBus";
|
|
13
|
-
import Camera from "./module/camera";
|
|
14
|
-
import { EWeatherType } from "./module/environment/weather/type";
|
|
15
1
|
import registerHooks from "./hooksManager";
|
|
16
|
-
import
|
|
2
|
+
import Anov3D from "./sdkEntry";
|
|
17
3
|
export var defaultCameraParams = {
|
|
18
4
|
fov: 45,
|
|
19
5
|
near: 0.1,
|
|
@@ -29,50 +15,6 @@ export var defaultCameraParams = {
|
|
|
29
15
|
z: 0
|
|
30
16
|
}
|
|
31
17
|
};
|
|
32
|
-
var Anov3D = /*#__PURE__*/_createClass(function Anov3D(opts) {
|
|
33
|
-
var _camera$fov, _camera$near, _camera$far, _camera$position, _opts$size$width, _opts$size, _opts$size$height, _opts$size2, _opts$size$width2, _opts$size3, _opts$size$height2, _opts$size4, _opts$camera, _scene$controls, _camera$lookAt;
|
|
34
|
-
_classCallCheck(this, Anov3D);
|
|
35
|
-
_defineProperty(this, "opts", void 0);
|
|
36
|
-
_defineProperty(this, "sceneControl", void 0);
|
|
37
|
-
_defineProperty(this, "environment", void 0);
|
|
38
|
-
_defineProperty(this, "eventBus", void 0);
|
|
39
|
-
_defineProperty(this, "EWeatherType", EWeatherType);
|
|
40
|
-
_defineProperty(this, "camera", void 0);
|
|
41
|
-
this.opts = opts;
|
|
42
|
-
var _ref = opts || {},
|
|
43
|
-
_ref$camera = _ref.camera,
|
|
44
|
-
camera = _ref$camera === void 0 ? {} : _ref$camera;
|
|
45
|
-
var cameraParams = {
|
|
46
|
-
fov: (_camera$fov = camera.fov) !== null && _camera$fov !== void 0 ? _camera$fov : defaultCameraParams.fov,
|
|
47
|
-
near: (_camera$near = camera.near) !== null && _camera$near !== void 0 ? _camera$near : defaultCameraParams.near,
|
|
48
|
-
far: (_camera$far = camera.far) !== null && _camera$far !== void 0 ? _camera$far : defaultCameraParams.far,
|
|
49
|
-
position: object2Vector3((_camera$position = camera.position) !== null && _camera$position !== void 0 ? _camera$position : defaultCameraParams.position)
|
|
50
|
-
};
|
|
51
|
-
var scene = new SceneControl({
|
|
52
|
-
orbitControls: true,
|
|
53
|
-
defCameraOps: _objectSpread({
|
|
54
|
-
aspect: ((_opts$size$width = opts === null || opts === void 0 ? void 0 : (_opts$size = opts.size) === null || _opts$size === void 0 ? void 0 : _opts$size.width) !== null && _opts$size$width !== void 0 ? _opts$size$width : opts.container.clientWidth) / ((_opts$size$height = opts === null || opts === void 0 ? void 0 : (_opts$size2 = opts.size) === null || _opts$size2 === void 0 ? void 0 : _opts$size2.height) !== null && _opts$size$height !== void 0 ? _opts$size$height : opts.container.clientHeight)
|
|
55
|
-
}, cameraParams),
|
|
56
|
-
rendererOps: {
|
|
57
|
-
shadowMap: true,
|
|
58
|
-
size: {
|
|
59
|
-
width: (_opts$size$width2 = opts === null || opts === void 0 ? void 0 : (_opts$size3 = opts.size) === null || _opts$size3 === void 0 ? void 0 : _opts$size3.width) !== null && _opts$size$width2 !== void 0 ? _opts$size$width2 : opts.container.clientWidth,
|
|
60
|
-
height: (_opts$size$height2 = opts === null || opts === void 0 ? void 0 : (_opts$size4 = opts.size) === null || _opts$size4 === void 0 ? void 0 : _opts$size4.height) !== null && _opts$size$height2 !== void 0 ? _opts$size$height2 : opts.container.clientHeight
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
reset: true,
|
|
64
|
-
ambientLight: true
|
|
65
|
-
});
|
|
66
|
-
scene.render(opts.container);
|
|
67
|
-
console.log((_opts$camera = opts.camera) === null || _opts$camera === void 0 ? void 0 : _opts$camera.lookAt);
|
|
68
|
-
(_scene$controls = scene.controls) === null || _scene$controls === void 0 ? void 0 : _scene$controls.target.copy(object2Vector3((_camera$lookAt = camera.lookAt) !== null && _camera$lookAt !== void 0 ? _camera$lookAt : defaultCameraParams.lookAt));
|
|
69
|
-
utils.emitter.emit('scene-completed', scene);
|
|
70
|
-
this.sceneControl = scene;
|
|
71
|
-
this.environment = new Environment();
|
|
72
|
-
this.eventBus = new EventBus();
|
|
73
|
-
this.camera = new Camera(scene.camera, scene.controls);
|
|
74
|
-
utils.storeManagement.set('event-bus', this.eventBus);
|
|
75
|
-
});
|
|
76
18
|
registerHooks();
|
|
77
19
|
export { createInstance } from "./applicationApi";
|
|
78
20
|
export default Anov3D;
|
|
@@ -14,8 +14,10 @@ var Camera = /*#__PURE__*/function () {
|
|
|
14
14
|
_classCallCheck(this, Camera);
|
|
15
15
|
_defineProperty(this, "camera", void 0);
|
|
16
16
|
_defineProperty(this, "controls", void 0);
|
|
17
|
+
_defineProperty(this, "isTransitionPeriod", false);
|
|
17
18
|
this.camera = camera;
|
|
18
19
|
this.controls = controls;
|
|
20
|
+
this.handleChanged();
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
/**
|
|
@@ -32,19 +34,42 @@ var Camera = /*#__PURE__*/function () {
|
|
|
32
34
|
}));
|
|
33
35
|
var center = box.getCenter(new Vector3());
|
|
34
36
|
var size = box.getSize(new Vector3());
|
|
35
|
-
var
|
|
36
|
-
var maxDistance =
|
|
37
|
-
var cameraToCenterDistance = maxDistance
|
|
38
|
-
var directionVector = this.camera.position.clone().sub(
|
|
37
|
+
var halfDiagonal = size.length() * 0.5;
|
|
38
|
+
var maxDistance = halfDiagonal / Math.tan(this.camera.fov / 2 * Math.PI / 180);
|
|
39
|
+
var cameraToCenterDistance = maxDistance;
|
|
40
|
+
var directionVector = this.camera.position.clone().sub(this.controls.target).normalize(); // 相机指向物体中心的向量
|
|
39
41
|
|
|
40
42
|
var lastPosition = directionVector.multiplyScalar(cameraToCenterDistance).add(center);
|
|
41
43
|
var lastLookat = center;
|
|
44
|
+
|
|
45
|
+
// const box3helper = new Box3Helper(box, new Color(0xFFFF00))
|
|
46
|
+
// use.useScene().scene!.add(box3helper)
|
|
47
|
+
|
|
42
48
|
return {
|
|
43
49
|
lastPosition: lastPosition,
|
|
44
50
|
lastLookat: lastLookat
|
|
45
51
|
};
|
|
46
52
|
}
|
|
47
53
|
|
|
54
|
+
/**
|
|
55
|
+
* handle camera changed
|
|
56
|
+
*/
|
|
57
|
+
}, {
|
|
58
|
+
key: "handleChanged",
|
|
59
|
+
value: function handleChanged() {
|
|
60
|
+
var _this = this;
|
|
61
|
+
this.controls.addEventListener('change', function () {
|
|
62
|
+
if (!_this.isTransitionPeriod) {
|
|
63
|
+
var lookat = _this.controls.target;
|
|
64
|
+
var position = _this.camera.position;
|
|
65
|
+
sendToMessage(MessageType.Event, 'onCameraChanged', EMessageStatus.Success, undefined, {
|
|
66
|
+
position: [position.x, position.y, position.z],
|
|
67
|
+
target: [lookat.x, lookat.y, lookat.z]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
48
73
|
/**
|
|
49
74
|
* focus On Position
|
|
50
75
|
* @param params
|
|
@@ -52,24 +77,48 @@ var Camera = /*#__PURE__*/function () {
|
|
|
52
77
|
}, {
|
|
53
78
|
key: "focusOnPosition",
|
|
54
79
|
value: function focusOnPosition(params) {
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
var _this2 = this;
|
|
81
|
+
// eslint-disable-next-line promise/param-names
|
|
82
|
+
return new Promise(function (res, _) {
|
|
83
|
+
var position = params.position,
|
|
84
|
+
pitch = params.pitch,
|
|
85
|
+
duration = params.duration;
|
|
86
|
+
var moveOptions = function moveOptions() {
|
|
87
|
+
var _ref;
|
|
88
|
+
return {
|
|
89
|
+
duration: (_ref = duration && duration * 1000) !== null && _ref !== void 0 ? _ref : 1000,
|
|
90
|
+
onUpdate: function onUpdate(_ref2) {
|
|
91
|
+
var position = _ref2.position,
|
|
92
|
+
lookat = _ref2.lookat;
|
|
93
|
+
sendToMessage(MessageType.Event, 'onCameraChanged', EMessageStatus.Success, undefined, {
|
|
94
|
+
position: [position.x, position.y, position.z],
|
|
95
|
+
target: [lookat.x, lookat.y, lookat.z]
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
onComplate: function onComplate() {
|
|
99
|
+
var _params$duration;
|
|
100
|
+
res({
|
|
101
|
+
position: [_this2.camera.position.x, _this2.camera.position.y, _this2.camera.position.z],
|
|
102
|
+
target: [_this2.controls.target.x, _this2.controls.target.y, _this2.controls.target.z],
|
|
103
|
+
isTrigger: true,
|
|
104
|
+
duration: (_params$duration = params.duration) !== null && _params$duration !== void 0 ? _params$duration : 0,
|
|
105
|
+
userInput: true,
|
|
106
|
+
pitch: pitch !== null && pitch !== void 0 ? pitch : 0
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
if (Array.isArray(position[0])) {
|
|
112
|
+
var currentPos = position;
|
|
113
|
+
var _this2$caclCurrentPos = _this2.caclCurrentPos(currentPos),
|
|
114
|
+
lastPosition = _this2$caclCurrentPos.lastPosition,
|
|
115
|
+
lastLookat = _this2$caclCurrentPos.lastLookat;
|
|
116
|
+
_this2.moveCameraTo(lastPosition, lastLookat, moveOptions());
|
|
117
|
+
} else {
|
|
118
|
+
var _currentPos = position;
|
|
119
|
+
_this2.moveCameraTo(_this2.camera.position, new Vector3(_currentPos[0], _currentPos[1], _currentPos[2]), moveOptions());
|
|
120
|
+
}
|
|
121
|
+
});
|
|
73
122
|
}
|
|
74
123
|
|
|
75
124
|
/**
|
|
@@ -77,19 +126,33 @@ var Camera = /*#__PURE__*/function () {
|
|
|
77
126
|
* @param params
|
|
78
127
|
*/
|
|
79
128
|
}, {
|
|
80
|
-
key: "
|
|
81
|
-
value: function
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
129
|
+
key: "set",
|
|
130
|
+
value: function set(params) {
|
|
131
|
+
var _this3 = this;
|
|
132
|
+
// eslint-disable-next-line promise/param-names
|
|
133
|
+
return new Promise(function (res, _) {
|
|
134
|
+
var _ref3;
|
|
135
|
+
_this3.moveCameraTo(new Vector3(params.position[0], params.position[1], params.position[2]), new Vector3(params.target[0], params.target[1], params.target[2]), {
|
|
136
|
+
duration: (_ref3 = params.duration && params.duration * 1000) !== null && _ref3 !== void 0 ? _ref3 : 1000,
|
|
137
|
+
onUpdate: function onUpdate(_ref4) {
|
|
138
|
+
var position = _ref4.position,
|
|
139
|
+
lookat = _ref4.lookat;
|
|
140
|
+
params.isTrigger && sendToMessage(MessageType.Event, 'onCameraChanged', EMessageStatus.Success, undefined, {
|
|
141
|
+
position: [position.x, position.y, position.z],
|
|
142
|
+
target: [lookat.x, lookat.y, lookat.z]
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
onComplate: function onComplate() {
|
|
146
|
+
var _params$duration2;
|
|
147
|
+
res({
|
|
148
|
+
position: [_this3.camera.position.x, _this3.camera.position.y, _this3.camera.position.z],
|
|
149
|
+
target: [_this3.controls.target.x, _this3.controls.target.y, _this3.controls.target.z],
|
|
150
|
+
isTrigger: true,
|
|
151
|
+
duration: (_params$duration2 = params.duration) !== null && _params$duration2 !== void 0 ? _params$duration2 : 0,
|
|
152
|
+
userInput: true
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
});
|
|
93
156
|
});
|
|
94
157
|
}
|
|
95
158
|
|
|
@@ -98,8 +161,8 @@ var Camera = /*#__PURE__*/function () {
|
|
|
98
161
|
* @returns
|
|
99
162
|
*/
|
|
100
163
|
}, {
|
|
101
|
-
key: "
|
|
102
|
-
value: function
|
|
164
|
+
key: "get",
|
|
165
|
+
value: function get() {
|
|
103
166
|
return {
|
|
104
167
|
position: [this.camera.position.x, this.camera.position.y, this.camera.position.z],
|
|
105
168
|
target: [this.controls.target.x, this.controls.target.y, this.controls.target.z]
|
|
@@ -115,12 +178,13 @@ var Camera = /*#__PURE__*/function () {
|
|
|
115
178
|
}, {
|
|
116
179
|
key: "moveCameraTo",
|
|
117
180
|
value: function moveCameraTo(position, target, options) {
|
|
118
|
-
var
|
|
181
|
+
var _this4 = this;
|
|
119
182
|
var currentPoition = this.camera.position.clone();
|
|
120
183
|
var currentPositionInterpolation = new Vector3();
|
|
121
184
|
if ((options === null || options === void 0 ? void 0 : options.duration) === 0) {
|
|
122
185
|
this.camera.position.copy(position);
|
|
123
186
|
this.controls.target.copy(target);
|
|
187
|
+
(options === null || options === void 0 ? void 0 : options.onComplate) && options.onComplate();
|
|
124
188
|
return;
|
|
125
189
|
}
|
|
126
190
|
new TWEEN.Tween({
|
|
@@ -131,20 +195,24 @@ var Camera = /*#__PURE__*/function () {
|
|
|
131
195
|
lookat: target
|
|
132
196
|
}, (options === null || options === void 0 ? void 0 : options.duration) || 1000).onStart(function () {
|
|
133
197
|
(options === null || options === void 0 ? void 0 : options.onStart) && options.onStart();
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
198
|
+
_this4.controls.enabled = false;
|
|
199
|
+
_this4.isTransitionPeriod = true;
|
|
200
|
+
}).easing(TWEEN.Easing.Quadratic.InOut).onUpdate(function (_ref5) {
|
|
201
|
+
var t = _ref5.t,
|
|
202
|
+
lookat = _ref5.lookat;
|
|
203
|
+
_this4.controls.target.copy(lookat);
|
|
139
204
|
var currentPosition = currentPositionInterpolation.lerpVectors(currentPoition, position, t);
|
|
140
|
-
|
|
205
|
+
_this4.camera.position.copy(currentPosition);
|
|
141
206
|
(options === null || options === void 0 ? void 0 : options.onUpdate) && options.onUpdate({
|
|
142
207
|
position: currentPosition,
|
|
143
208
|
lookat: lookat
|
|
144
209
|
});
|
|
145
210
|
}).onComplete(function () {
|
|
146
211
|
(options === null || options === void 0 ? void 0 : options.onComplate) && options.onComplate();
|
|
147
|
-
|
|
212
|
+
_this4.controls.enabled = true;
|
|
213
|
+
setTimeout(function () {
|
|
214
|
+
_this4.isTransitionPeriod = false;
|
|
215
|
+
});
|
|
148
216
|
}).start();
|
|
149
217
|
}
|
|
150
218
|
}]);
|
|
@@ -21,12 +21,18 @@ var EventBus = /*#__PURE__*/function () {
|
|
|
21
21
|
_createClass(EventBus, [{
|
|
22
22
|
key: "on",
|
|
23
23
|
value: function on(params) {
|
|
24
|
-
this.eventMap.set(params.eventName, true);
|
|
24
|
+
this.eventMap.set("eventBus.".concat(params.eventName), true);
|
|
25
|
+
return {
|
|
26
|
+
eventName: params.eventName
|
|
27
|
+
};
|
|
25
28
|
}
|
|
26
29
|
}, {
|
|
27
30
|
key: "off",
|
|
28
31
|
value: function off(params) {
|
|
29
|
-
this.eventMap.set(params.eventName, false);
|
|
32
|
+
this.eventMap.set("eventBus.".concat(params.eventName), false);
|
|
33
|
+
return {
|
|
34
|
+
eventName: params.eventName
|
|
35
|
+
};
|
|
30
36
|
}
|
|
31
37
|
}]);
|
|
32
38
|
return EventBus;
|
package/dist/sdkEntry.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
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); } }
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
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); }
|
|
10
|
+
import { SceneControl, utils } from '@anov/3d-core';
|
|
11
|
+
import Environment from "./module/environment";
|
|
12
|
+
import EventBus from "./module/eventBus";
|
|
13
|
+
import Camera from "./module/camera";
|
|
14
|
+
import { EWeatherType } from "./module/environment/weather/type";
|
|
15
|
+
import { object2Vector3 } from "./utils/index";
|
|
16
|
+
import { defaultCameraParams } from "./index";
|
|
17
|
+
var Anov3D = /*#__PURE__*/_createClass(function Anov3D(opts) {
|
|
18
|
+
var _camera$fov, _camera$near, _camera$far, _camera$position, _opts$size$width, _opts$size, _opts$size$height, _opts$size2, _opts$size$width2, _opts$size3, _opts$size$height2, _opts$size4, _scene$controls, _camera$target;
|
|
19
|
+
_classCallCheck(this, Anov3D);
|
|
20
|
+
_defineProperty(this, "opts", void 0);
|
|
21
|
+
_defineProperty(this, "sceneControl", void 0);
|
|
22
|
+
_defineProperty(this, "environment", void 0);
|
|
23
|
+
_defineProperty(this, "eventBus", void 0);
|
|
24
|
+
_defineProperty(this, "EWeatherType", EWeatherType);
|
|
25
|
+
_defineProperty(this, "camera", void 0);
|
|
26
|
+
this.opts = opts;
|
|
27
|
+
var _ref = opts || {},
|
|
28
|
+
_ref$camera = _ref.camera,
|
|
29
|
+
camera = _ref$camera === void 0 ? {} : _ref$camera;
|
|
30
|
+
var cameraParams = {
|
|
31
|
+
fov: (_camera$fov = camera.fov) !== null && _camera$fov !== void 0 ? _camera$fov : defaultCameraParams.fov,
|
|
32
|
+
near: (_camera$near = camera.near) !== null && _camera$near !== void 0 ? _camera$near : defaultCameraParams.near,
|
|
33
|
+
far: (_camera$far = camera.far) !== null && _camera$far !== void 0 ? _camera$far : defaultCameraParams.far,
|
|
34
|
+
position: object2Vector3((_camera$position = camera.position) !== null && _camera$position !== void 0 ? _camera$position : defaultCameraParams.position)
|
|
35
|
+
};
|
|
36
|
+
var scene = new SceneControl({
|
|
37
|
+
orbitControls: true,
|
|
38
|
+
defCameraOps: _objectSpread({
|
|
39
|
+
aspect: ((_opts$size$width = opts === null || opts === void 0 ? void 0 : (_opts$size = opts.size) === null || _opts$size === void 0 ? void 0 : _opts$size.width) !== null && _opts$size$width !== void 0 ? _opts$size$width : opts.container.clientWidth) / ((_opts$size$height = opts === null || opts === void 0 ? void 0 : (_opts$size2 = opts.size) === null || _opts$size2 === void 0 ? void 0 : _opts$size2.height) !== null && _opts$size$height !== void 0 ? _opts$size$height : opts.container.clientHeight)
|
|
40
|
+
}, cameraParams),
|
|
41
|
+
rendererOps: {
|
|
42
|
+
shadowMap: true,
|
|
43
|
+
size: {
|
|
44
|
+
width: (_opts$size$width2 = opts === null || opts === void 0 ? void 0 : (_opts$size3 = opts.size) === null || _opts$size3 === void 0 ? void 0 : _opts$size3.width) !== null && _opts$size$width2 !== void 0 ? _opts$size$width2 : opts.container.clientWidth,
|
|
45
|
+
height: (_opts$size$height2 = opts === null || opts === void 0 ? void 0 : (_opts$size4 = opts.size) === null || _opts$size4 === void 0 ? void 0 : _opts$size4.height) !== null && _opts$size$height2 !== void 0 ? _opts$size$height2 : opts.container.clientHeight
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
reset: true,
|
|
49
|
+
ambientLight: true
|
|
50
|
+
});
|
|
51
|
+
scene.render(opts.container);
|
|
52
|
+
(_scene$controls = scene.controls) === null || _scene$controls === void 0 ? void 0 : _scene$controls.target.copy(object2Vector3((_camera$target = camera.target) !== null && _camera$target !== void 0 ? _camera$target : defaultCameraParams.lookAt));
|
|
53
|
+
utils.emitter.emit('scene-completed', scene);
|
|
54
|
+
this.sceneControl = scene;
|
|
55
|
+
this.environment = new Environment();
|
|
56
|
+
this.eventBus = new EventBus();
|
|
57
|
+
this.camera = new Camera(scene.camera, scene.controls);
|
|
58
|
+
utils.storeManagement.set('event-bus', this.eventBus);
|
|
59
|
+
});
|
|
60
|
+
export default Anov3D;
|
package/dist/utils/messageFn.js
CHANGED
|
@@ -6,13 +6,15 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
6
6
|
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); }
|
|
7
7
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
8
|
import { utils } from '@anov/3d-core';
|
|
9
|
+
import { codeMessageMap } from "../messageStatus";
|
|
9
10
|
export var MessageType;
|
|
10
11
|
(function (MessageType) {
|
|
11
12
|
MessageType[MessageType["Event"] = 0] = "Event";
|
|
12
13
|
MessageType[MessageType["Api"] = 1] = "Api";
|
|
13
14
|
})(MessageType || (MessageType = {}));
|
|
14
15
|
var getResponseMsg = function getResponseMsg(status) {
|
|
15
|
-
|
|
16
|
+
var _codeMessageMap$statu;
|
|
17
|
+
return (_codeMessageMap$statu = codeMessageMap[status]) !== null && _codeMessageMap$statu !== void 0 ? _codeMessageMap$statu : '未知错误';
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -31,11 +33,9 @@ export var sendToMessage = function sendToMessage(messageType, messageName, stat
|
|
|
31
33
|
name: messageName,
|
|
32
34
|
code: status,
|
|
33
35
|
msg: responseMsg,
|
|
34
|
-
result: _objectSpread(
|
|
35
|
-
version: '0.0.4',
|
|
36
|
-
engineType: 'WEBGL',
|
|
37
|
-
engineVersion: '0.0.4'
|
|
38
|
-
})
|
|
36
|
+
result: _objectSpread({}, (_ref = res) !== null && _ref !== void 0 ? _ref : {})
|
|
39
37
|
};
|
|
40
|
-
if (messageType === MessageType.Api) utils.emitter.emit('message', response);else if (messageType === MessageType.Event) utils.emitter.emit('event', response)
|
|
38
|
+
if (messageType === MessageType.Api) utils.emitter.emit('message', response);else if (messageType === MessageType.Event) utils.emitter.emit('event', _objectSpread(_objectSpread({}, response), {}, {
|
|
39
|
+
name: "eventBus.".concat(response.name)
|
|
40
|
+
}));
|
|
41
41
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anov/3d",
|
|
3
|
-
"version": "0.0.4-
|
|
3
|
+
"version": "0.0.4-alpha17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@tweenjs/tween.js": "^21.0.0",
|
|
20
20
|
"uuid": "^9.0.1",
|
|
21
|
-
"@anov/3d-core": "^0.0.4-
|
|
22
|
-
"@anov/3d-ability": "^0.0.4-
|
|
21
|
+
"@anov/3d-core": "^0.0.4-alpha14",
|
|
22
|
+
"@anov/3d-ability": "^0.0.4-alpha2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/uuid": "^9.0.7"
|
package/dist/applicationApi.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import Anov3D from './index';
|
|
2
|
-
declare type ApplicationOptions = {
|
|
3
|
-
el: HTMLElement;
|
|
4
|
-
};
|
|
5
|
-
export declare type InitOptions = {
|
|
6
|
-
camera?: {
|
|
7
|
-
fov?: number;
|
|
8
|
-
near?: number;
|
|
9
|
-
far?: number;
|
|
10
|
-
position?: {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
z: number;
|
|
14
|
-
};
|
|
15
|
-
lookAt?: {
|
|
16
|
-
x: number;
|
|
17
|
-
y: number;
|
|
18
|
-
z: number;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
size?: {
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
declare class Application {
|
|
27
|
-
private container;
|
|
28
|
-
iEngine: Anov3D | undefined;
|
|
29
|
-
constructor(opts: ApplicationOptions);
|
|
30
|
-
private init;
|
|
31
|
-
sendMessage(req: {
|
|
32
|
-
name: string;
|
|
33
|
-
id: string;
|
|
34
|
-
params: any;
|
|
35
|
-
}): void;
|
|
36
|
-
receiveMessage(eventName: string, cb: (params: any) => void): void;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* createInstance
|
|
40
|
-
* @returns
|
|
41
|
-
*/
|
|
42
|
-
export declare const createInstance: (opts: ApplicationOptions) => Application;
|
|
43
|
-
export {};
|
package/dist/hooksManager.d.ts
DELETED
package/dist/index.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { SceneControl } from '@anov/3d-core';
|
|
2
|
-
import Environment from './module/environment';
|
|
3
|
-
import EventBus from './module/eventBus';
|
|
4
|
-
import Camera from './module/camera';
|
|
5
|
-
import { EWeatherType } from './module/environment/weather/type';
|
|
6
|
-
import type { InitOptions } from './applicationApi';
|
|
7
|
-
declare type Anov3DOptions = {
|
|
8
|
-
container: HTMLElement;
|
|
9
|
-
size?: {
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
};
|
|
13
|
-
camera?: InitOptions['camera'];
|
|
14
|
-
};
|
|
15
|
-
export declare const defaultCameraParams: {
|
|
16
|
-
fov: number;
|
|
17
|
-
near: number;
|
|
18
|
-
far: number;
|
|
19
|
-
position: {
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
z: number;
|
|
23
|
-
};
|
|
24
|
-
lookAt: {
|
|
25
|
-
x: number;
|
|
26
|
-
y: number;
|
|
27
|
-
z: number;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
declare class Anov3D {
|
|
31
|
-
private opts;
|
|
32
|
-
sceneControl: SceneControl;
|
|
33
|
-
environment: Environment;
|
|
34
|
-
eventBus: EventBus;
|
|
35
|
-
EWeatherType: typeof EWeatherType;
|
|
36
|
-
camera: Camera;
|
|
37
|
-
constructor(opts: Anov3DOptions);
|
|
38
|
-
}
|
|
39
|
-
export { createInstance } from './applicationApi';
|
|
40
|
-
export default Anov3D;
|
package/dist/messageStatus.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export declare const messageStatus: {
|
|
2
|
-
Success: {
|
|
3
|
-
code: number;
|
|
4
|
-
msg: string;
|
|
5
|
-
};
|
|
6
|
-
SerializeFailed: {
|
|
7
|
-
code: number;
|
|
8
|
-
msg: string;
|
|
9
|
-
};
|
|
10
|
-
NameNotFound: {
|
|
11
|
-
code: number;
|
|
12
|
-
msg: string;
|
|
13
|
-
};
|
|
14
|
-
IDNotFound: {
|
|
15
|
-
code: number;
|
|
16
|
-
msg: string;
|
|
17
|
-
};
|
|
18
|
-
ParamsNotFound: {
|
|
19
|
-
code: number;
|
|
20
|
-
msg: string;
|
|
21
|
-
};
|
|
22
|
-
MissingKeyField: {
|
|
23
|
-
code: number;
|
|
24
|
-
msg: string;
|
|
25
|
-
};
|
|
26
|
-
EventNotRegister: {
|
|
27
|
-
code: number;
|
|
28
|
-
msg: string;
|
|
29
|
-
};
|
|
30
|
-
ModuleNotRegister: {
|
|
31
|
-
code: number;
|
|
32
|
-
msg: string;
|
|
33
|
-
};
|
|
34
|
-
EventHandleFailed: {
|
|
35
|
-
code: number;
|
|
36
|
-
msg: string;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
export declare enum EMessageStatus {
|
|
40
|
-
Success = 200,
|
|
41
|
-
SerializeFailed = 500,
|
|
42
|
-
NameNotFound = 400,
|
|
43
|
-
IDNotFound = 400,
|
|
44
|
-
ParamsNotFound = 400,
|
|
45
|
-
MissingKeyField = 400,
|
|
46
|
-
EventNotRegister = 400,
|
|
47
|
-
ModuleNotRegister = 404,
|
|
48
|
-
EventHandleFailed = 422
|
|
49
|
-
}
|
|
50
|
-
export declare const codeMessageMap: {
|
|
51
|
-
200: string;
|
|
52
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { OrbitControls, PerspectiveCamera } from '@anov/3d-core';
|
|
2
|
-
declare type vector3Array = [number, number, number];
|
|
3
|
-
declare class Camera {
|
|
4
|
-
private camera;
|
|
5
|
-
private controls;
|
|
6
|
-
constructor(camera: PerspectiveCamera, controls: OrbitControls);
|
|
7
|
-
/**
|
|
8
|
-
* caclCurrentPos
|
|
9
|
-
* @param currentPos
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
private caclCurrentPos;
|
|
13
|
-
/**
|
|
14
|
-
* focus On Position
|
|
15
|
-
* @param params
|
|
16
|
-
*/
|
|
17
|
-
focusOnPosition(params: {
|
|
18
|
-
position: vector3Array | vector3Array[];
|
|
19
|
-
pitch?: number;
|
|
20
|
-
duration?: number;
|
|
21
|
-
}): void;
|
|
22
|
-
/**
|
|
23
|
-
* set camera
|
|
24
|
-
* @param params
|
|
25
|
-
*/
|
|
26
|
-
setCamera(params: {
|
|
27
|
-
position: vector3Array;
|
|
28
|
-
target: vector3Array;
|
|
29
|
-
isTrigger?: boolean;
|
|
30
|
-
duration?: number;
|
|
31
|
-
}): void;
|
|
32
|
-
/**
|
|
33
|
-
* get Camera info
|
|
34
|
-
* @returns
|
|
35
|
-
*/
|
|
36
|
-
getCamera(): {
|
|
37
|
-
position: number[];
|
|
38
|
-
target: number[];
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* interpolation move camera
|
|
42
|
-
* @param position
|
|
43
|
-
* @param target
|
|
44
|
-
* @param options
|
|
45
|
-
*/
|
|
46
|
-
private moveCameraTo;
|
|
47
|
-
}
|
|
48
|
-
export default Camera;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
declare class Environment {
|
|
2
|
-
private setDate;
|
|
3
|
-
private snow;
|
|
4
|
-
private rain;
|
|
5
|
-
private cloudReturn;
|
|
6
|
-
private sky;
|
|
7
|
-
constructor();
|
|
8
|
-
private setWeatherStrategy;
|
|
9
|
-
/**
|
|
10
|
-
* setTime
|
|
11
|
-
* @param newTime
|
|
12
|
-
* @param changeTime
|
|
13
|
-
*/
|
|
14
|
-
setTime(params: {
|
|
15
|
-
newTime: number;
|
|
16
|
-
duration?: number;
|
|
17
|
-
}): {
|
|
18
|
-
newTime: number;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* setWeather
|
|
22
|
-
* @param type
|
|
23
|
-
* @param changeTime
|
|
24
|
-
*/
|
|
25
|
-
setWeather(params: {
|
|
26
|
-
weatherType: string;
|
|
27
|
-
duration?: number;
|
|
28
|
-
}): void;
|
|
29
|
-
}
|
|
30
|
-
export default Environment;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* create time sky system
|
|
3
|
-
* @param date
|
|
4
|
-
* @param latitude
|
|
5
|
-
* @param longitude
|
|
6
|
-
* @param sunRadius
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
declare const createTimeSkySystem: (date: Date, latitude?: number, longitude?: number, sunRadius?: number) => any[];
|
|
10
|
-
export default createTimeSkySystem;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare const EWeatherType: {
|
|
2
|
-
Clear_Skies: string;
|
|
3
|
-
Cloudy: string;
|
|
4
|
-
Foggy: string;
|
|
5
|
-
Overcast: string;
|
|
6
|
-
Partly_Cloudy: string;
|
|
7
|
-
Rain: string;
|
|
8
|
-
Rain_Light: string;
|
|
9
|
-
Rain_Thunderstorm: string;
|
|
10
|
-
Sand_Dust_Calm: string;
|
|
11
|
-
Sand_Dust_Storm: string;
|
|
12
|
-
Snow: string;
|
|
13
|
-
Snow_Blizzard: string;
|
|
14
|
-
Snow_Light: string;
|
|
15
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* notes: 区别于前端概念,3端统一API特定
|
|
3
|
-
*/
|
|
4
|
-
declare class EventBus {
|
|
5
|
-
eventMap: Map<string, boolean>;
|
|
6
|
-
constructor();
|
|
7
|
-
/**
|
|
8
|
-
* open event
|
|
9
|
-
* @param params
|
|
10
|
-
*/
|
|
11
|
-
on(params: {
|
|
12
|
-
eventName: string;
|
|
13
|
-
entityId?: string;
|
|
14
|
-
}): void;
|
|
15
|
-
off(params: {
|
|
16
|
-
eventName: string;
|
|
17
|
-
entityId?: string;
|
|
18
|
-
}): void;
|
|
19
|
-
}
|
|
20
|
-
export default EventBus;
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Vector3 } from '@anov/3d-core';
|
|
2
|
-
import type Anov3D from '..';
|
|
3
|
-
interface ObjectType {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* get value by key
|
|
8
|
-
* notic: to mark proxy, so need take it layer by layer
|
|
9
|
-
* @param obj
|
|
10
|
-
* @param key
|
|
11
|
-
*/
|
|
12
|
-
export declare const getValueByKey: <T extends ObjectType>(obj: T, key: string) => T | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* getFnByFnkey
|
|
15
|
-
* @param iEngine
|
|
16
|
-
* @param fnkey
|
|
17
|
-
*/
|
|
18
|
-
export declare const getFnByFnkey: (iEngine: Anov3D, fnkey: string, id: string) => any;
|
|
19
|
-
export declare const object2Vector3: (obj: {
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
z: number;
|
|
23
|
-
}) => Vector3;
|
|
24
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare enum MessageType {
|
|
2
|
-
Event = 0,
|
|
3
|
-
Api = 1
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* sendToMessage
|
|
7
|
-
* @param messageName
|
|
8
|
-
* @param status
|
|
9
|
-
* @param res
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
export declare const sendToMessage: (messageType: MessageType, messageName: string, status: number, id?: string, res?: unknown) => void;
|