Advertisement
Guest User

Collide Code

a guest
Feb 18th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement