updateProxy method

  1. @override
void updateProxy()
override

Update the proxy of the shape.

Implementation

@override
void updateProxy() {
  double p = aabbProx;
  double min = -double.maxFinite;
  double max = double.maxFinite;
  Vector3 n = normal;
  // The plane AABB is infinite, except if the normal is pointing along any axis
  aabb.set(
    n.x == -1 ? position.x - p : min, n.x == 1 ? position.x + p : max,
    n.y == -1 ? position.y - p : min, n.y == 1 ? position.y + p : max,
    n.z == -1 ? position.z - p : min, n.z == 1 ? position.z + p : max
  );
  if(proxy != null) proxy!.update();
}