修正排钻Box错误

pull/368/head
ChenX 5 years ago
parent 611f44a088
commit 3d5a19f9f2

@ -1,4 +1,4 @@
import { BufferGeometry, CylinderBufferGeometry, Float32BufferAttribute, Group, LineSegments, Matrix4, Mesh, Object3D, Shape as TShape } from "three"; import { Box3, BufferGeometry, CylinderBufferGeometry, Float32BufferAttribute, LineSegments, Matrix4, Mesh, Object3D, Shape as TShape, Vector3 } from "three";
import { ColorMaterial } from '../../Common/ColorPalette'; import { ColorMaterial } from '../../Common/ColorPalette';
import { DisposeThreeObj } from '../../Common/Dispose'; import { DisposeThreeObj } from '../../Common/Dispose';
import { FixIndex } from "../../Common/Utils"; import { FixIndex } from "../../Common/Utils";
@ -79,12 +79,7 @@ export class GangDrill extends Solid3D
} }
get BoundingBox() get BoundingBox()
{ {
let box = this.MeshGeometry.boundingBox; let box = new Box3(new Vector3(-this._Radius, -this._Radius, 0), new Vector3(this._Radius, this._Radius, this._Height));
if (!box)
{
this.MeshGeometry.computeBoundingBox();
box = this.MeshGeometry.boundingBox;
}
return box.applyMatrix4(this.OCS); return box.applyMatrix4(this.OCS);
} }
Collise(tarDrill: GangDrill): boolean Collise(tarDrill: GangDrill): boolean

Loading…
Cancel
Save