diff --git a/viewer/packages/pointclouds/src/styling/shapes/Box.ts b/viewer/packages/pointclouds/src/styling/shapes/Box.ts index 86cad807dd8..1e75d3bfd18 100644 --- a/viewer/packages/pointclouds/src/styling/shapes/Box.ts +++ b/viewer/packages/pointclouds/src/styling/shapes/Box.ts @@ -4,7 +4,7 @@ import { ShapeType } from './IRawShape'; import { IShape } from './IShape'; -import { AABB, m4MultiplyV3WithTranslation, Mat4, Vec3 } from './linalg'; +import { m4MultiplyV3WithTranslation, Mat4, Vec3 } from './linalg'; export type RawBox = { type: ShapeType.Box; @@ -18,10 +18,6 @@ export class Box implements IShape { this.invMatrix = invertedInstanceMatrix; } - computeBoundingBox(): AABB { - throw Error('Bounding box not implemented for box primitive'); - } - containsPoint(point: Vec3): boolean { const transformedPoint = m4MultiplyV3WithTranslation(this.invMatrix, point); diff --git a/viewer/packages/pointclouds/src/styling/shapes/CompositeShape.ts b/viewer/packages/pointclouds/src/styling/shapes/CompositeShape.ts index c0a235cc05e..3766ea844c7 100644 --- a/viewer/packages/pointclouds/src/styling/shapes/CompositeShape.ts +++ b/viewer/packages/pointclouds/src/styling/shapes/CompositeShape.ts @@ -5,7 +5,7 @@ import { IShape } from './IShape'; import { IRawShape, ShapeType } from './IRawShape'; -import { Vec3, AABB, b3Union, emptyBox3 } from './linalg'; +import { Vec3 } from './linalg'; export type RawCompositeShape = { type: ShapeType.Composite; @@ -19,14 +19,6 @@ export class CompositeShape implements IShape { this._innerShapes = shapes.slice(); } - computeBoundingBox(): AABB { - const totalBoundingBox = this._innerShapes.reduce( - (newBox, shape) => b3Union(newBox, shape.computeBoundingBox()), - emptyBox3() - ); - return totalBoundingBox; - } - containsPoint(point: Vec3): boolean { for (const shape of this._innerShapes) { if (shape.containsPoint(point)) { diff --git a/viewer/packages/pointclouds/src/styling/shapes/Cylinder.ts b/viewer/packages/pointclouds/src/styling/shapes/Cylinder.ts index 43d345d56bd..18d569a6fff 100644 --- a/viewer/packages/pointclouds/src/styling/shapes/Cylinder.ts +++ b/viewer/packages/pointclouds/src/styling/shapes/Cylinder.ts @@ -5,7 +5,7 @@ import { ShapeType } from './IRawShape'; import { IShape } from './IShape'; -import { Vec3, v3Scale, v3Middle, v3Length, v3Sub, v3Normalized, v3Dot, AABB } from './linalg'; +import { Vec3, v3Scale, v3Middle, v3Length, v3Sub, v3Normalized, v3Dot } from './linalg'; export type RawCylinder = { type: ShapeType.Cylinder; @@ -49,26 +49,6 @@ export class Cylinder implements IShape { return v3Normalized(v3Sub(this._centerA, this._centerB)); } - computeBoundingBox(): AABB { - /* const halfHeight = this.getHalfHeight(); - const middle = this.getMiddle(); - - out.set( - utilVector.clone().set(-this._radius, -halfHeight, -this._radius), - utilVector.set(this._radius, halfHeight, this._radius) - ); - - const rotation = new THREE.Quaternion().setFromUnitVectors( - new THREE.Vector3(0.0, 1.0, 0.0), - utilVector.copy(this._centerA).sub(this._centerB).normalize() - ); - - out.applyMatrix4(new THREE.Matrix4().makeRotationFromQuaternion(rotation)); - out.translate(middle); - return out; */ - throw Error('[Cylinder] Bounding box not yet implemented'); - } - containsPoint(point: Vec3): boolean { const halfHeight = this.getHalfHeight(); const middle = this.getMiddle(); diff --git a/viewer/packages/pointclouds/src/styling/shapes/IShape.ts b/viewer/packages/pointclouds/src/styling/shapes/IShape.ts index 00349175333..077c706abb9 100644 --- a/viewer/packages/pointclouds/src/styling/shapes/IShape.ts +++ b/viewer/packages/pointclouds/src/styling/shapes/IShape.ts @@ -4,15 +4,9 @@ import { IRawShape } from './IRawShape'; -import { Vec3, AABB } from './linalg'; +import { Vec3 } from './linalg'; export interface IShape { - /** - * Returns a bounding box containing the shape. - * May be just a crude approximation, but is guaranteed to contain the entire shape - */ - computeBoundingBox(): AABB; - containsPoint(point: Vec3): boolean; toRawShape(): IRawShape;