12 switch (plane.classifyPoint(point)) {
24 if (lastPlaneCache != -1) {
28 planeToSkip = lastPlaneCache;
34 if (lastPlaneCache == -1) {
36 if (i != planeToSkip) {
54 const F32 distance = plane.signedDistanceToPoint(center);
55 if (distance < -radius) {
59 if (std::abs(distance) < radius) {
69 if (lastPlaneCache != -1) {
73 planeToSkip = lastPlaneCache;
79 if (lastPlaneCache == -1) {
81 if (i != planeToSkip) {
112 for (
U8 i = 0u; i < count; ++i) {
124 for (
U8 i = 0u; i < count; ++i) {
136 for (
U8 i = 0u; i < count; ++i) {
149 for (
U8 i = 0u; i < count; ++i) {
160 if (plane.signedDistanceToPoint(bbox.getPVertex(plane._normal)) < 0) {
163 if (plane.signedDistanceToPoint(bbox.getNVertex(plane._normal)) < 0) {
171 return ContainsSphere(bSphere.getCenter(), bSphere.getRadius(), lastPlaneCache);
177 if (lastPlaneCache != -1) {
181 planeToSkip = lastPlaneCache;
187 if (lastPlaneCache == -1) {
189 if (i != planeToSkip) {
204 _frustumPlanes = other._frustumPlanes;
234 const auto& mat = viewProjMatrix.
m;
236 for (
I8 i = 4; i--; ) { leftPlane[i] = mat[i][3] + mat[i][0]; }
237 for (
I8 i = 4; i--; ) { rightPlane[i] = mat[i][3] - mat[i][0]; }
238 for (
I8 i = 4; i--; ) { bottomPlane[i] = mat[i][3] + mat[i][1]; }
239 for (
I8 i = 4; i--; ) { topPlane[i] = mat[i][3] - mat[i][1]; }
240 for (
I8 i = 4; i--; ) { nearPlane[i] = mat[i][3] + mat[i][2]; }
241 for (
I8 i = 4; i--; ) { farPlane[i] = mat[i][3] - mat[i][2]; }
FrustumCollision PlaneBoundingBoxIntersect(FrustumPlane frustumPlane, const BoundingBox &bbox) const noexcept
FrustumCollision ContainsPoint(const vec3< F32 > &point, I8 &lastPlaneCache) const noexcept
FrustumCollision ContainsSphere(const BoundingSphere &bSphere, I8 &lastPlaneCache) const noexcept
const std::array< Plane< F32 >, to_base(FrustumPlane::COUNT)> & computePlanes(const mat4< F32 > &viewProjMatrix)
FrustumCollision PlanePointIntersect(FrustumPlane frustumPlane, const vec3< F32 > &point) const noexcept
FrustumCollision ContainsBoundingBox(const BoundingBox &bbox, I8 &lastPlaneCache) const noexcept
void set(const Frustum &other) noexcept
FrustumCollision PlaneBoundingSphereIntersect(FrustumPlane frustumPlane, const BoundingSphere &bsphere) const noexcept
void getCornersWorldSpace(std::array< vec3< F32 >, to_base(FrustumPoints::COUNT)> &cornersWS) const noexcept
FrustumCollision PlaneSphereIntersect(FrustumPlane frustumPlane, const vec3< F32 > ¢er, F32 radius) const noexcept
std::array< Plane< F32 >, to_base(FrustumPlane::COUNT)> _frustumPlanes
Handle console commands that start with a forward slash.
FrustumCollision PlaneBoundingSphereIntersect(const Plane< F32 > &plane, const BoundingSphere &bsphere) noexcept
FORCE_INLINE vec3< T > GetIntersection(const Plane< T > &a, const Plane< T > &b, const Plane< T > &c) noexcept
constexpr I8 to_I8(const T value)
FrustumCollision PlaneSphereIntersect(const Plane< F32 > &plane, const vec3< F32 > ¢er, const F32 radius) noexcept
FrustumCollision PlaneBoundingBoxIntersect(const Plane< F32 > &plane, const BoundingBox &bbox) noexcept
FrustumCollision PlanePointIntersect(const Plane< F32 > &plane, const vec3< F32 > &point) noexcept
constexpr auto to_base(const Type value) -> Type