public Box3 setFromCenterAndSize(Vector3 center, Vector3 size) { Vector3 halfSize = _v1.copy(size).multiply(0.5); this.min.copy(center).sub(halfSize); this.max.copy(center).add(halfSize); return this; }
public double distanceToPoint(Vector3 point) { Vector3 clampedPoint = _v1.copy(point).clamp(this.min, this.max); return clampedPoint.sub(point).length(); }
public Vector3 clampPoint(Vector3 point, Vector3 optionalTarget) { return optionalTarget.copy(point).clamp(this.min, this.max); }