Guest User

Untitled

a guest
Oct 11th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. void CAreaGenerator::PhysicalizeArea()
  2. {
  3.     auto extensionId = gEnv->pGame->GetIGameFramework()->GetIGameObjectSystem()->GetID("AreaGeneratorElement");
  4.     // for each existing element enable phys
  5.     for (int i = 0; i < numElements; i++)
  6.     {
  7.         if (elements[i] != nullptr)
  8.         {
  9.             auto *pGameObject = gEnv->pGame->GetIGameFramework()->GetGameObject(elements[i]->GetId());
  10.            
  11.            
  12.             if (pGameObject != nullptr)
  13.             {
  14.                 auto *pElement = static_cast<CAreaGeneratorElement*>(pGameObject->QueryExtension(extensionId));
  15.  
  16.                 if (pElement != nullptr)
  17.                 {
  18.                     pElement->PhysicalizeElement();
  19.                 }
  20.             }
  21.  
  22.         }
  23.     }
  24.  
  25.     GetEntity()->DetachAll();
  26. }
Add Comment
Please, Sign In to add comment