void CoreObject2D_Imp::SetCullingUpdate(CoreObject2D_Imp* obj) { #if __CULLING_2D__ for (auto ite = obj->children.begin(); ite != obj->children.end();) { if (!(*ite)->GetIsAlive()) { obj->children.erase(ite++); } else { ite++; } } if (!obj->GetAlreadyCullingUpdated()) { if (obj->GetLayer() != nullptr&&obj->GetIsAlive()) { auto layerImp = (CoreLayer2D_Imp*)obj->GetLayer(); layerImp->AddTransformedObject(obj->GetCullingObject()); } obj->SetAlreadyCullingUpdated(true); } for (auto& cld : obj->children) { auto cld_Imp = CoreObject2DToImp(cld); SetCullingUpdate(cld_Imp); } #endif }
void CoreGeometryObject2D_Imp::SetShape(CoreShape* shape) { SetCullingUpdate(this); if (m_shape != nullptr) { CoreShape2DToImp(m_shape)->SetGeometryObject2D(nullptr); } CoreShape2DToImp(shape)->SetGeometryObject2D(this); SafeSubstitute(m_shape, shape); }
void CoreGeometryObject2D_Imp::SetCenterPosition(Vector2DF position) { SetCullingUpdate(this); centerPosition = centerPosition; }
void CoreGeometryObject2D_Imp::SetIsUpdateBoundingCircle() { SetCullingUpdate(this); }