FrustumCulling::FrustumCulling( const Eigen::Vector3d& position, const Eigen::Quaterniond& orientation, double horizontalFOV, double verticalFOV, double nearPlaneDist, double farPlaneDist ) : position_( position ), orientation_( orientation ) { ComputeFrustum( horizontalFOV, verticalFOV, nearPlaneDist, farPlaneDist ); }
void MeshRenderer::DoSceneObjectFrustumTest(SceneObject *obj, const Camera &camera, bool ignoreNearZ) { Frustum frustum; ComputeFrustum(camera.ViewProjectionMatrix().ToSIMD(), frustum); uint32 test = TestFrustumSphere(frustum, *obj->bound->bsphere, ignoreNearZ); obj->bound->frustumTest = test > 0; // early out - do not transform if the scene obj bounding box is not in view if (test) { DoSceneObjectModelPartsFrustumTests(frustum, camera, ignoreNearZ, *obj->bound->modelPartsBound); } }