@aibee/crc-bmap 0.0.131 → 0.0.132
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/lib/bmap.cjs.min.js +7 -7
- package/lib/bmap.cjs.min.js.map +3 -3
- package/lib/bmap.esm.js +41 -22
- package/lib/bmap.esm.js.map +2 -2
- package/lib/bmap.esm.min.js +6 -6
- package/lib/bmap.esm.min.js.map +3 -3
- package/lib/bmap.min.js +7 -7
- package/lib/bmap.min.js.map +3 -3
- package/package.json +1 -1
package/lib/bmap.esm.js
CHANGED
|
@@ -2078,7 +2078,7 @@ import {
|
|
|
2078
2078
|
Box2 as Box23,
|
|
2079
2079
|
Vector3 as Vector319,
|
|
2080
2080
|
Vector2 as Vector29,
|
|
2081
|
-
Raycaster as
|
|
2081
|
+
Raycaster as Raycaster4,
|
|
2082
2082
|
Box3 as Box39,
|
|
2083
2083
|
Color as Color6,
|
|
2084
2084
|
AmbientLight as AmbientLight2
|
|
@@ -4285,7 +4285,7 @@ var GroundTexture = class extends Object3D10 {
|
|
|
4285
4285
|
for (let i = 0; i < position.count; i++) {
|
|
4286
4286
|
position.setZ(i, z);
|
|
4287
4287
|
}
|
|
4288
|
-
const uvs = [1, 1,
|
|
4288
|
+
const uvs = [0, 1, 1, 1, 1, 0, 0, 0];
|
|
4289
4289
|
shapeGeometry.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
|
|
4290
4290
|
return shapeGeometry;
|
|
4291
4291
|
});
|
|
@@ -4384,6 +4384,10 @@ var Lane = class extends Object3D12 {
|
|
|
4384
4384
|
option.geometry.coords.slice(1)
|
|
4385
4385
|
);
|
|
4386
4386
|
const geometry = new ShapeGeometry2(shape, 4);
|
|
4387
|
+
const pos = geometry.getAttribute("position");
|
|
4388
|
+
for (let i = 0; i < pos.count; i++) {
|
|
4389
|
+
pos.setZ(i, option.airHeight + (option.deltaHeight || 0));
|
|
4390
|
+
}
|
|
4387
4391
|
return geometry;
|
|
4388
4392
|
});
|
|
4389
4393
|
this.geometry = mergeGeometries3(geometries);
|
|
@@ -4446,7 +4450,7 @@ var Lane = class extends Object3D12 {
|
|
|
4446
4450
|
});
|
|
4447
4451
|
return options2.map((option) => {
|
|
4448
4452
|
const geometry = new LineGeometry();
|
|
4449
|
-
const vec = option.geometry.otherCoords[1].map((item) => [...item, 0]).flat(2);
|
|
4453
|
+
const vec = option.geometry.otherCoords[1].map((item) => [...item, option.airHeight + (option.deltaHeight || 0)]).flat(2);
|
|
4450
4454
|
geometry.setPositions(vec);
|
|
4451
4455
|
const line = new Line2(geometry, material);
|
|
4452
4456
|
line.computeLineDistances();
|
|
@@ -4750,9 +4754,11 @@ var Poi2 = class extends Object3D14 {
|
|
|
4750
4754
|
new SpriteMaterial({
|
|
4751
4755
|
map: texture,
|
|
4752
4756
|
transparent: true,
|
|
4753
|
-
alphaTest: 0.2
|
|
4757
|
+
alphaTest: 0.2,
|
|
4758
|
+
depthTest: false
|
|
4754
4759
|
})
|
|
4755
4760
|
);
|
|
4761
|
+
spriteIcon.visible = false;
|
|
4756
4762
|
spriteIcon.renderOrder = 1e5;
|
|
4757
4763
|
texture.needsUpdate = true;
|
|
4758
4764
|
this.add(spriteIcon);
|
|
@@ -4767,9 +4773,11 @@ var Poi2 = class extends Object3D14 {
|
|
|
4767
4773
|
new SpriteMaterial({
|
|
4768
4774
|
map: texture,
|
|
4769
4775
|
transparent: true,
|
|
4770
|
-
alphaTest: 0.2
|
|
4776
|
+
alphaTest: 0.2,
|
|
4777
|
+
depthTest: false
|
|
4771
4778
|
})
|
|
4772
4779
|
);
|
|
4780
|
+
spriteText.visible = false;
|
|
4773
4781
|
spriteText.renderOrder = 100001;
|
|
4774
4782
|
texture.needsUpdate = true;
|
|
4775
4783
|
this.spriteText = spriteText;
|
|
@@ -5737,7 +5745,7 @@ var Context = class extends EventDispatcher6 {
|
|
|
5737
5745
|
const point3 = new Vector29();
|
|
5738
5746
|
point3.x = x / this.clientSize.width * 2 - 1;
|
|
5739
5747
|
point3.y = y / this.clientSize.height * -2 + 1;
|
|
5740
|
-
const raycaster = new
|
|
5748
|
+
const raycaster = new Raycaster4();
|
|
5741
5749
|
raycaster.setFromCamera(point3, this.camera);
|
|
5742
5750
|
raycaster.ray.origin.sub(raycaster.ray.direction.clone().multiplyScalar(100));
|
|
5743
5751
|
const res = this.currentFloor?.graphicLayer.getGraphicByRaycaster(raycaster);
|
|
@@ -5979,7 +5987,7 @@ var Context = class extends EventDispatcher6 {
|
|
|
5979
5987
|
* @param position 修改后的相机的位置
|
|
5980
5988
|
* @param duration 动画持续时间
|
|
5981
5989
|
*/
|
|
5982
|
-
setCameraPosition(position, duration) {
|
|
5990
|
+
async setCameraPosition(position, duration) {
|
|
5983
5991
|
const start = this.camera.position.clone();
|
|
5984
5992
|
const lookAtVector = this.getCameraLookAt();
|
|
5985
5993
|
if (!duration) {
|
|
@@ -5988,6 +5996,7 @@ var Context = class extends EventDispatcher6 {
|
|
|
5988
5996
|
this.control.target.copy(position.clone());
|
|
5989
5997
|
this.control.update();
|
|
5990
5998
|
this.control.enabled = true;
|
|
5999
|
+
return;
|
|
5991
6000
|
}
|
|
5992
6001
|
return timeoutPromise(
|
|
5993
6002
|
new Promise((resolve) => {
|
|
@@ -6010,12 +6019,12 @@ var Context = class extends EventDispatcher6 {
|
|
|
6010
6019
|
);
|
|
6011
6020
|
}
|
|
6012
6021
|
render() {
|
|
6013
|
-
this.renderer.render(this.scene, this.camera);
|
|
6014
6022
|
this.dispatchEvent({ type: "update" });
|
|
6015
|
-
this.renderRf = this.timer.requestAnimationFrame(() => {
|
|
6016
|
-
this.render();
|
|
6017
|
-
});
|
|
6018
6023
|
this.tweenGroup.update();
|
|
6024
|
+
this.renderer.render(this.scene, this.camera);
|
|
6025
|
+
this.renderRf = this.timer.setTimeout(() => {
|
|
6026
|
+
this.render();
|
|
6027
|
+
}, 100);
|
|
6019
6028
|
}
|
|
6020
6029
|
pauseRender() {
|
|
6021
6030
|
this.timer.cancelAnimationFrame(this.renderRf);
|
|
@@ -8024,24 +8033,30 @@ var Navigation = class extends Plugin {
|
|
|
8024
8033
|
return;
|
|
8025
8034
|
}
|
|
8026
8035
|
const { control } = this.bmap.context;
|
|
8036
|
+
const time = duration / Math.PI * 4 * diffAngle * 10;
|
|
8037
|
+
const offsetDistance = 150 / this.bmap.context.camera.zoom;
|
|
8038
|
+
const polar = this.bmap.context.control.getPolarAngle();
|
|
8039
|
+
const maxPolarAngle = this.bmap.context.control.maxPolarAngle;
|
|
8040
|
+
const minPolarAngle = this.bmap.context.control.minPolarAngle;
|
|
8041
|
+
this.bmap.context.control.minPolarAngle = this.bmap.context.control.maxPolarAngle = polar;
|
|
8027
8042
|
return new Promise((resolve) => {
|
|
8028
8043
|
const start = { azimuthal: control.getAzimuthalAngle() };
|
|
8029
8044
|
const end = { azimuthal: angle };
|
|
8030
|
-
const tween = new Tween2(start, this.pathTween).to(end,
|
|
8031
|
-
control.target.copy(this.startPoi.position);
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
control.update();
|
|
8035
|
-
const target = this.startPoi.position.clone();
|
|
8045
|
+
const tween = new Tween2(start, this.pathTween).to(end, time).onUpdate(async () => {
|
|
8046
|
+
this.bmap.context.control.target.copy(this.startPoi.position);
|
|
8047
|
+
this.bmap.context.setAzimuthalAngle(start.azimuthal, 0);
|
|
8048
|
+
const target = control.target.clone();
|
|
8036
8049
|
const offset = new Vector323();
|
|
8037
8050
|
offset.setFromMatrixColumn(this.bmap.context.camera.matrix, 1);
|
|
8038
8051
|
offset.normalize();
|
|
8039
|
-
offset.multiplyScalar(
|
|
8052
|
+
offset.multiplyScalar(offsetDistance);
|
|
8040
8053
|
target.add(offset);
|
|
8041
8054
|
this.bmap.context.setCameraPosition(target, 0);
|
|
8042
8055
|
}).onComplete(() => {
|
|
8043
8056
|
control.enabled = true;
|
|
8044
8057
|
this.pathTween.remove(tween);
|
|
8058
|
+
this.bmap.context.control.minPolarAngle = minPolarAngle;
|
|
8059
|
+
this.bmap.context.control.maxPolarAngle = maxPolarAngle;
|
|
8045
8060
|
resolve(true);
|
|
8046
8061
|
}).onStart(() => {
|
|
8047
8062
|
control.enabled = false;
|
|
@@ -8626,8 +8641,10 @@ var AibeeLoader = class {
|
|
|
8626
8641
|
case "texture2d":
|
|
8627
8642
|
case "texture3d":
|
|
8628
8643
|
transformGraphicData(layer.elements, center2);
|
|
8629
|
-
|
|
8630
|
-
|
|
8644
|
+
if (layer.elements.length) {
|
|
8645
|
+
const texture = new GroundTexture(this.bmap.context, layer.elements);
|
|
8646
|
+
floor.textureLayer.add(texture);
|
|
8647
|
+
}
|
|
8631
8648
|
break;
|
|
8632
8649
|
case "glb":
|
|
8633
8650
|
transformGraphicData(layer.elements, center2);
|
|
@@ -8744,8 +8761,10 @@ var AibeeLoader = class {
|
|
|
8744
8761
|
visible: true
|
|
8745
8762
|
};
|
|
8746
8763
|
});
|
|
8747
|
-
|
|
8748
|
-
|
|
8764
|
+
if (textures.length) {
|
|
8765
|
+
const parkingTexture = new GroundTexture(this.bmap.context, textures);
|
|
8766
|
+
floor.textureLayer.add(parkingTexture);
|
|
8767
|
+
}
|
|
8749
8768
|
floor.userData.parkingSpaces = parkingSpacesGraphics;
|
|
8750
8769
|
floor.userData.parkingSpacesGraphicMap = parkingSpacesGraphicMap;
|
|
8751
8770
|
break;
|