Browse Source

修正 GStore + 压力测试

master
修宁 6 months ago
parent
commit
bc129d50fd
  1. 2
      src/core/Constract.ts
  2. 2
      src/example/example1.js
  3. 5
      src/modules/gstore/GstoreRenderer.ts
  4. 2
      src/types/ModelTypes.ts

2
src/core/Constract.ts

@ -34,7 +34,7 @@ const Constract = Object.freeze({
HEIGHT_WAY_LINE: 0.02, HEIGHT_WAY_LINE: 0.02,
MAX_MEASURE_INSTANCES: 1000, MAX_MEASURE_INSTANCES: 1000,
MAX_GSTORE_INSTANCES: 500, MAX_GSTORE_INSTANCES: 10000,
MAX_PALLET_INSTANCES: 10000, MAX_PALLET_INSTANCES: 10000,
}) })
export default Constract export default Constract

2
src/example/example1.js

@ -340,7 +340,7 @@ export default {
}, },
{ {
catalogCode: '__f2', t: 'floor', catalogCode: '__f2', t: 'floor',
items: buildPointPerformanceData('pallet', 10, 10) items: buildPointPerformanceData('gstore', 100, 100)
} }
], ],
elevator: [], // 电梯 elevator: [], // 电梯

5
src/modules/gstore/GstoreRenderer.ts

@ -55,7 +55,7 @@ export default class GstoreRenderer extends BaseRenderer {
this.tempViewport, this.tempViewport,
this.pointGeometry, this.pointGeometry,
this.pointMaterial, this.pointMaterial,
Constract.MAX_MEASURE_INSTANCES) Constract.MAX_GSTORE_INSTANCES)
) )
} }
@ -78,8 +78,9 @@ export default class GstoreRenderer extends BaseRenderer {
afterCreateOrUpdatePoint(item: ItemJson, option: RendererCudOption, object: Object3DLike) { afterCreateOrUpdatePoint(item: ItemJson, option: RendererCudOption, object: Object3DLike) {
super.afterCreateOrUpdatePoint(item, option, object) super.afterCreateOrUpdatePoint(item, option, object)
// 画边线
const center = [item.tf[0][0], item.tf[0][2]] const center = [item.tf[0][0], item.tf[0][2]]
const h = item.tf[0][1] || this.defulePositionY const h = (item.tf[0][1] || this.defulePositionY) + 0.01
const widthHalf = item.tf[2][0] / 2 const widthHalf = item.tf[2][0] / 2
const depthHalf = item.tf[2][2] / 2 const depthHalf = item.tf[2][2] / 2
const lwHalf = (item.dt.strokeWidth || this.defaultPointOption.strokeWidth) / 2 const lwHalf = (item.dt.strokeWidth || this.defaultPointOption.strokeWidth) / 2

2
src/types/ModelTypes.ts

@ -71,4 +71,4 @@ export type Object3DLike = Object3D | LineManageWrap | PointManageWrap
/** /**
* , THREE.Vector3 * , THREE.Vector3
*/ */
export type Vector3Like = THREE.Vector3 | [number, number, number] export type Vector3Like = THREE.Vector3 | number[]

Loading…
Cancel
Save