static bool isInRadius(vector<Point3i> & patterns, Point2i point) { for (int i=0;i<patterns.size();i++) { Point2i patternPoint = Point2i(patterns[i].x,patterns[i].y); int distanceSquared = GetSquaredDistance(patternPoint,point); if (distanceSquared < patterns[i].z) return true; } return false; }
bool csMeshWrapper::UseImposter (iRenderView *rview) { if (!factory) return false; csMeshFactoryWrapper* factwrap = static_cast<csMeshFactoryWrapper*> (factory); if(!factwrap->GetMinDistance()) return false; float wor_sq_dist = GetSquaredDistance (rview); float dist = factwrap->GetMinDistance(); return (wor_sq_dist > dist*dist); }
float csMeshWrapper::GetSquaredDistance (iRenderView *rview) { csVector3 cam_origin = rview->GetCamera ()->GetTransform ().GetOrigin (); return GetSquaredDistance (cam_origin); }
/** * @brief * * @param x * @param y * * @return */ bool IsInsideCircle(uint64_t squared_radius, int32_t x, int32_t y) { return (GetSquaredDistance(x, y) < squared_radius); }