Guest User

Collide Code

a guest
Feb 18th, 2016
82
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CollisionComponent::CollisionComponent(luabridge::LuaRef& componentTable)
  2. {
  3.     if (componentTable["boundingBox"].isTable())
  4.     {
  5.         luabridge::LuaRef boundingBoxTable = componentTable["boundingBox"];
  6.         boundingBox = sf::FloatRect(boundingBoxTable[1], boundingBoxTable[2], boundingBoxTable[3], boundingBoxTable[4]);
  7.     }
  8.  
  9.     if (componentTable["collide"].isFunction())
  10.         didCollide = std::make_shared<luabridge::LuaRef>(componentTable["collide"]);
  11.     else
  12.         didCollide.reset();
  13. }
RAW Paste Data