Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CAreaGenerator::PhysicalizeArea()
- {
- auto extensionId = gEnv->pGame->GetIGameFramework()->GetIGameObjectSystem()->GetID("AreaGeneratorElement");
- // for each existing element enable phys
- for (int i = 0; i < numElements; i++)
- {
- if (elements[i] != nullptr)
- {
- auto *pGameObject = gEnv->pGame->GetIGameFramework()->GetGameObject(elements[i]->GetId());
- if (pGameObject != nullptr)
- {
- auto *pElement = static_cast<CAreaGeneratorElement*>(pGameObject->QueryExtension(extensionId));
- if (pElement != nullptr)
- {
- pElement->PhysicalizeElement();
- }
- }
- }
- }
- GetEntity()->DetachAll();
- }
Add Comment
Please, Sign In to add comment