toLocalFrame method

AABB toLocalFrame(
  1. Transform frame,
  2. AABB target
)

Get the representation of an AABB in another frame. return The "target" AABB object.

Implementation

AABB toLocalFrame(Transform frame, AABB target){
  final corners = _transformIntoFrameCorners;
  final a = corners[0];
  final b = corners[1];
  final c = corners[2];
  final d = corners[3];
  final e = corners[4];
  final f = corners[5];
  final g = corners[6];
  final h = corners[7];

  // Get corners in current frame
  getCorners(a, b, c, d, e, f, g, h);

  // Transform them to local frame
  for (int i = 0; i != 8; i++) {
    final corner = corners[i];
    frame.pointToLocal(corner, corner);
  }

  return target.setFromPoints(corners);
}