// David Eberly, Geometric Tools, Redmond WA 98052 // Copyright (c) 1998-2020 // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt // https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt // Version: 4.0.2019.08.13 #pragma once #include #include #include #include namespace WwiseGTE { template class TIQuery, Ellipsoid3> { public: struct Result { bool intersect; }; Result operator()(Plane3 const& plane, Ellipsoid3 const& ellipsoid) { Result result; Matrix3x3 MInverse; ellipsoid.GetMInverse(MInverse); Real discr = Dot(plane.normal, MInverse * plane.normal); Real root = std::sqrt(std::max(discr, (Real)0)); DCPQuery, Plane3> vpQuery; Real distance = vpQuery(ellipsoid.center, plane).distance; result.intersect = (distance <= root); return result; } }; }