Exemplo n.º 1
0
  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;
  }
Exemplo n.º 2
0
 public double distanceToPoint(Vector3 point) {
   Vector3 clampedPoint = _v1.copy(point).clamp(this.min, this.max);
   return clampedPoint.sub(point).length();
 }
Exemplo n.º 3
0
 public Vector3 clampPoint(Vector3 point, Vector3 optionalTarget) {
   return optionalTarget.copy(point).clamp(this.min, this.max);
 }