applyMatrix4 method
BoundingBox
applyMatrix4(
- Matrix4 matrix
Implementation
BoundingBox applyMatrix4(Matrix4 matrix) {
// transform of empty box is an empty box.
if (isEmpty()) return this;
// NOTE: I am using a binary pattern to specify all 2^3 combinations below
_points[0].setValues(min.x, min.y, min.z).applyMatrix4(matrix); // 000
_points[1].setValues(min.x, min.y, max.z).applyMatrix4(matrix); // 001
_points[2].setValues(min.x, max.y, min.z).applyMatrix4(matrix); // 010
_points[3].setValues(min.x, max.y, max.z).applyMatrix4(matrix); // 011
_points[4].setValues(max.x, min.y, min.z).applyMatrix4(matrix); // 100
_points[5].setValues(max.x, min.y, max.z).applyMatrix4(matrix); // 101
_points[6].setValues(max.x, max.y, min.z).applyMatrix4(matrix); // 110
_points[7].setValues(max.x, max.y, max.z).applyMatrix4(matrix); // 111
setFromPoints(_points);
return this;
}