Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(BoundingBox): delete worldMin and worldMax #203

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/core/bound/BoundingBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ export class BoundingBox implements IBound {
* The total size of the box. This is always twice as much as extensions.
*/
public size: Vector3;
public worldMax: Vector3;
public worldMin: Vector3;

/**
*
* Create a new Bounds.
Expand All @@ -50,9 +47,6 @@ export class BoundingBox implements IBound {
this.size = size;
this.max = this.center.add(this.extents);
this.min = this.center.subtract(this.extents);

this.worldMin = new Vector3();
this.worldMax = new Vector3();
}

public setFromMinMax(min: Vector3, max: Vector3) {
Expand Down Expand Up @@ -180,7 +174,5 @@ export class BoundingBox implements IBound {
this.min = null;
this.max = null;
this.size = null;
this.worldMax = null;
this.worldMin = null;
}
}
3 changes: 0 additions & 3 deletions src/core/bound/BoundingSphere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ export class BoundingSphere implements IBound {
public worldCenter: Vector3;
public worldSize: Vector3;

public worldMax: Vector3;
public worldMin: Vector3;

/**
* @internal
*/
Expand Down
3 changes: 0 additions & 3 deletions src/core/bound/IBound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ export interface IBound {
min: Vector3;
size: Vector3;

worldMax: Vector3;
worldMin: Vector3;

calculateTransform(obj: Object3D): void;
clone(): IBound;

Expand Down
4 changes: 2 additions & 2 deletions src/gfx/renderJob/passRenderer/graphic/Graphic3DRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@ export class Graphic3D extends Object3D {
/**
* Draw bounding box
* @param uuid Graphic identification ID
* @param boundingBox Bounding box object
* @param boundingBox Bounding box object, please use world boundingbox
* @param color The color of the bounding box
*/
public drawBoundingBox(uuid: string, boundingBox: BoundingBox, color: Color = Color.COLOR_WHITE) {
this.drawBox(uuid, boundingBox.worldMin, boundingBox.worldMax, color);
this.drawBox(uuid, boundingBox.min, boundingBox.max, color);
}

/**
Expand Down