@anov/3d 0.0.4-alpha16 → 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
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,
|
|
@@ -96,8 +96,14 @@ var Camera = /*#__PURE__*/function () {
|
|
|
96
96
|
});
|
|
97
97
|
},
|
|
98
98
|
onComplate: function onComplate() {
|
|
99
|
+
var _params$duration;
|
|
99
100
|
res({
|
|
100
|
-
|
|
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
|
|
101
107
|
});
|
|
102
108
|
}
|
|
103
109
|
};
|
|
@@ -120,8 +126,8 @@ var Camera = /*#__PURE__*/function () {
|
|
|
120
126
|
* @param params
|
|
121
127
|
*/
|
|
122
128
|
}, {
|
|
123
|
-
key: "
|
|
124
|
-
value: function
|
|
129
|
+
key: "set",
|
|
130
|
+
value: function set(params) {
|
|
125
131
|
var _this3 = this;
|
|
126
132
|
// eslint-disable-next-line promise/param-names
|
|
127
133
|
return new Promise(function (res, _) {
|
|
@@ -137,8 +143,13 @@ var Camera = /*#__PURE__*/function () {
|
|
|
137
143
|
});
|
|
138
144
|
},
|
|
139
145
|
onComplate: function onComplate() {
|
|
146
|
+
var _params$duration2;
|
|
140
147
|
res({
|
|
141
|
-
|
|
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
|
|
142
153
|
});
|
|
143
154
|
}
|
|
144
155
|
});
|
|
@@ -150,8 +161,8 @@ var Camera = /*#__PURE__*/function () {
|
|
|
150
161
|
* @returns
|
|
151
162
|
*/
|
|
152
163
|
}, {
|
|
153
|
-
key: "
|
|
154
|
-
value: function
|
|
164
|
+
key: "get",
|
|
165
|
+
value: function get() {
|
|
155
166
|
return {
|
|
156
167
|
position: [this.camera.position.x, this.camera.position.y, this.camera.position.z],
|
|
157
168
|
target: [this.controls.target.x, this.controls.target.y, this.controls.target.z]
|
package/dist/sdkEntry.js
CHANGED
|
@@ -15,7 +15,7 @@ import { EWeatherType } from "./module/environment/weather/type";
|
|
|
15
15
|
import { object2Vector3 } from "./utils/index";
|
|
16
16
|
import { defaultCameraParams } from "./index";
|
|
17
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$
|
|
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
19
|
_classCallCheck(this, Anov3D);
|
|
20
20
|
_defineProperty(this, "opts", void 0);
|
|
21
21
|
_defineProperty(this, "sceneControl", void 0);
|
|
@@ -49,7 +49,7 @@ var Anov3D = /*#__PURE__*/_createClass(function Anov3D(opts) {
|
|
|
49
49
|
ambientLight: true
|
|
50
50
|
});
|
|
51
51
|
scene.render(opts.container);
|
|
52
|
-
(_scene$controls = scene.controls) === null || _scene$controls === void 0 ? void 0 : _scene$controls.target.copy(object2Vector3((_camera$
|
|
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
53
|
utils.emitter.emit('scene-completed', scene);
|
|
54
54
|
this.sceneControl = scene;
|
|
55
55
|
this.environment = new Environment();
|
package/dist/utils/messageFn.js
CHANGED
|
@@ -33,11 +33,7 @@ export var sendToMessage = function sendToMessage(messageType, messageName, stat
|
|
|
33
33
|
name: messageName,
|
|
34
34
|
code: status,
|
|
35
35
|
msg: responseMsg,
|
|
36
|
-
result: _objectSpread(
|
|
37
|
-
version: '0.0.4',
|
|
38
|
-
engineType: 'WEBGL',
|
|
39
|
-
engineVersion: '0.0.4'
|
|
40
|
-
})
|
|
36
|
+
result: _objectSpread({}, (_ref = res) !== null && _ref !== void 0 ? _ref : {})
|
|
41
37
|
};
|
|
42
38
|
if (messageType === MessageType.Api) utils.emitter.emit('message', response);else if (messageType === MessageType.Event) utils.emitter.emit('event', _objectSpread(_objectSpread({}, response), {}, {
|
|
43
39
|
name: "eventBus.".concat(response.name)
|
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-
|
|
22
|
-
"@anov/3d-
|
|
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"
|