void selectSpheres(SPHERES &spheres, GRID &grid) { int counter = 0; for (int i = 0; i < spheres.NSpheres; i++) { if (isSphereInside(spheres, i, grid)) { swapSpheres(spheres, i, counter); counter++; } } spheres.NSpheres = counter; spheres.coords = (float*)realloc(spheres.coords, counter * 4 * sizeof(float)); }
xdl::xdl_bool Frustum::isSphereInside(const tmath::vec3& point, xdl::xdl_float radius) { return isSphereInside(point.x, point.y, point.z, radius); }