fix(SDK): 修复测量不显示的bug
This commit is contained in:
parent
ebfa52b990
commit
fed4277a7c
@ -39,6 +39,8 @@ class Measure extends THREE.EventDispatcher<MeasureEventMap>{
|
|||||||
depthWrite: false,
|
depthWrite: false,
|
||||||
depthTest: false
|
depthTest: false
|
||||||
});
|
});
|
||||||
|
// 标记点图片
|
||||||
|
static MARKER_TEXTURE = new URL(import.meta.env.BASE_URL + 'static/images/logo.png', import.meta.url).href;
|
||||||
static MAX_DISTANCE = 500; //当相交物体的距离太远时,忽略它
|
static MAX_DISTANCE = 500; //当相交物体的距离太远时,忽略它
|
||||||
static OBJ_NAME = "object_for_measure";
|
static OBJ_NAME = "object_for_measure";
|
||||||
static LABEL_NAME = "label_for_measure";
|
static LABEL_NAME = "label_for_measure";
|
||||||
@ -69,12 +71,13 @@ class Measure extends THREE.EventDispatcher<MeasureEventMap>{
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.scene = viewer.sceneHelpers;
|
this.scene = viewer.scene;
|
||||||
this.viewer = viewer;
|
this.viewer = viewer;
|
||||||
|
|
||||||
// 初始化group
|
// 初始化group
|
||||||
this.measureGroup = new THREE.Group();
|
this.measureGroup = new THREE.Group();
|
||||||
this.measureGroup.name = `measure_group`;
|
this.measureGroup.name = `measure_group`;
|
||||||
|
this.measureGroup.ignore = true;
|
||||||
|
|
||||||
this.group = new THREE.Group();
|
this.group = new THREE.Group();
|
||||||
|
|
||||||
@ -239,7 +242,7 @@ class Measure extends THREE.EventDispatcher<MeasureEventMap>{
|
|||||||
* 初始化点标记材料
|
* 初始化点标记材料
|
||||||
*/
|
*/
|
||||||
initPointMarkerMaterial() {
|
initPointMarkerMaterial() {
|
||||||
const markerTexture = new THREE.TextureLoader().load("/static/images/logo/logo.png");
|
const markerTexture = new THREE.TextureLoader().load(Measure.MARKER_TEXTURE);
|
||||||
this.spriteMaterial = new THREE.SpriteMaterial({
|
this.spriteMaterial = new THREE.SpriteMaterial({
|
||||||
map: markerTexture,
|
map: markerTexture,
|
||||||
depthTest: false, // 深度测试
|
depthTest: false, // 深度测试
|
||||||
|
|||||||
@ -1103,9 +1103,7 @@ export default class Viewer extends THREE.EventDispatcher<ViewerEventMap> {
|
|||||||
if (this.options.edit?.enabled) this.renderer.render(this.sceneHelpers, this.camera);
|
if (this.options.edit?.enabled) this.renderer.render(this.sceneHelpers, this.camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
// css2d 在sceneHelpers内
|
this.css2DRenderer.render(this.scene, App.viewportCamera);
|
||||||
this.css2DRenderer.render(this.sceneHelpers, App.viewportCamera);
|
|
||||||
|
|
||||||
this.css3DRenderer.render(this.scene, App.viewportCamera);
|
this.css3DRenderer.render(this.scene, App.viewportCamera);
|
||||||
|
|
||||||
this.modules.viewHelper.render();
|
this.modules.viewHelper.render();
|
||||||
|
|||||||
BIN
packages/sdk/public/static/images/logo.png
Normal file
BIN
packages/sdk/public/static/images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
Loading…
Reference in New Issue
Block a user