|
|
@ -131,6 +131,14 @@ export default abstract class BaseRenderer { |
|
|
createPoint(item: ItemJson, option?: RendererCudOption): Object3DLike { |
|
|
createPoint(item: ItemJson, option?: RendererCudOption): Object3DLike { |
|
|
// 由基础类创造一个属于自己的点演示
|
|
|
// 由基础类创造一个属于自己的点演示
|
|
|
const point = this.createPointBasic(item, option) |
|
|
const point = this.createPointBasic(item, option) |
|
|
|
|
|
const matrix = this.calcMeshMatrix(item, option) |
|
|
|
|
|
point.setMatrix4(matrix) |
|
|
|
|
|
|
|
|
|
|
|
point.visible = ((typeof item.v !== 'undefined') ? item.v : true) |
|
|
|
|
|
return point |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
calcMeshMatrix(item: ItemJson, option?: RendererCudOption) { |
|
|
let matrix = getMatrixFromTf(item.tf) |
|
|
let matrix = getMatrixFromTf(item.tf) |
|
|
|
|
|
|
|
|
if (item.dt.storeAt?.item) { |
|
|
if (item.dt.storeAt?.item) { |
|
|
@ -169,13 +177,9 @@ export default abstract class BaseRenderer { |
|
|
item.tf[1] = _.cloneDeep(option.rotation) |
|
|
item.tf[1] = _.cloneDeep(option.rotation) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
point.setMatrix4(matrix) |
|
|
return matrix |
|
|
|
|
|
|
|
|
point.visible = ((typeof item.v !== 'undefined') ? item.v : true) |
|
|
|
|
|
return point |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 删除一个点 |
|
|
* 删除一个点 |
|
|
* @param id 点的唯一标识 |
|
|
* @param id 点的唯一标识 |
|
|
@ -237,7 +241,10 @@ export default abstract class BaseRenderer { |
|
|
// if (point instanceof PointManageWrap) {
|
|
|
// if (point instanceof PointManageWrap) {
|
|
|
// point.manager.syncMeshObject3D(point)
|
|
|
// point.manager.syncMeshObject3D(point)
|
|
|
// }
|
|
|
// }
|
|
|
point.setMatrix4(getMatrixFromTf(item.tf)) |
|
|
const matrix = this.calcMeshMatrix(item, option) |
|
|
|
|
|
point.setMatrix4(matrix) |
|
|
|
|
|
|
|
|
|
|
|
point.visible = ((typeof item.v !== 'undefined') ? item.v : true) |
|
|
return point |
|
|
return point |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|