104 for (
const auto& plane :
pl) {
105 if (plane.distance(p) < 0) {
116 for (
const auto& plane :
pl) {
117 float distance = plane.distance(c);
121 else if (distance < r)
131 for (
const auto& plane :
pl) {
132 if (plane.distance(box.
getVertexP(plane.normal)) < 0)
134 else if (plane.distance(box.
getVertexN(plane.normal)) < 0)
144 for (
const auto& plane :
pl) {
145 if (plane.distance(cube.
getVertexP(plane.normal)) < 0)
147 else if (plane.distance(cube.
getVertexN(plane.normal)) < 0)
164 template <
typename T>
166 const T* m = MP.
data();
Vector3Tpl< float > CCVector3f
Float 3D Vector.
CCVector3f getVertexP(const CCVector3f &normal) const
CCVector3f getVertexN(const CCVector3f &normal) const
AABox(const CCVector3f &A, const CCVector3f &B)
CCVector3f getVertexP(const CCVector3f &normal) const
virtual ~AACube()=default
CCVector3f getVertexN(const CCVector3f &normal) const
AACube(const CCVector3f &origin, float size)
void initfromMPMatrix(const ccGLMatrixTpl< T > &MP)
Frustum(const ccGLMatrixd &modelViewMat, const ccGLMatrixd &projMat)
Intersection boxInFrustum(const AABox &box) const
virtual ~Frustum()=default
Intersection boxInFrustum(const AACube &cube) const
Intersection pointInFrustum(const CCVector3f &p) const
Intersection sphereInFrustum(const CCVector3f &c, float r) const
float distance(const CCVector3f &p) const
void setCoefficients(float a, float b, float c, float d)
Type dot(const Vector3Tpl &v) const
Dot product.
Type norm() const
Returns vector norm.
A 4x4 'transformation' matrix (column major order)
T * data()
Returns a pointer to internal data.
Double version of ccGLMatrixTpl.
Simple axis aligned box structure.
Vector3Tpl< float > corners[2]