xtorcga
Version:
Xtor Compute Geometry Algorithm Libary 计算几何算法库
25 lines (21 loc) • 594 B
text/typescript
import { Mat4 } from '../../math/Mat4';
import { v3, Vec3 } from '../../math/Vec3';
export class Sphere {
applyMat4(mat: Mat4) {
throw new Error('Method not implemented.');
}
center: Vec3;
radius: number;
constructor(center: Vec3 = v3(), radius: number = 0) {
this.center = center;
this.radius = radius;
}
copy(sphere: Sphere) {
this.center.copy(sphere.center)
this.radius = sphere.radius;
return this;
}
clone(): Sphere | undefined {
return new Sphere().copy(this);
}
}