+inline void aabb_planes_oriented(const AABB& aabb, const Matrix4& rotation, Plane3 planes[6])
+{
+ double x = vector3_dot(Vector3(rotation.x()), aabb.origin);
+ double y = vector3_dot(Vector3(rotation.y()), aabb.origin);
+ double z = vector3_dot(Vector3(rotation.z()), aabb.origin);
+
+ planes[0] = Plane3(Vector3(rotation.x()), x + aabb.extents[0]);
+ planes[1] = Plane3(-Vector3(rotation.x()), -(x - aabb.extents[0]));
+ planes[2] = Plane3(Vector3(rotation.y()), y + aabb.extents[1]);
+ planes[3] = Plane3(-Vector3(rotation.y()), -(y - aabb.extents[1]));
+ planes[4] = Plane3(Vector3(rotation.z()), z + aabb.extents[2]);
+ planes[5] = Plane3(-Vector3(rotation.z()), -(z - aabb.extents[2]));
+}
+