All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CollisionMaterial.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Collision.h"
6 #include "CollisionGroup.h"
7 
8 #include <string>
9 #include <functional>
10 
11 namespace Eegeo
12 {
13  namespace Collision
14  {
16  {
17  CollisionMaterial(CollisionGroup::Type collisionGroup, const std::string& materialId)
18  : m_collisionGroup(collisionGroup)
19  , m_materialId(materialId)
20  {
21 
22  }
23 
24  CollisionGroup::Type CollisionGroup() const { return m_collisionGroup; }
25  std::string MaterialId() const { return m_materialId; }
26  private:
27  CollisionGroup::Type m_collisionGroup;
28  std::string m_materialId;
29  };
30 
31  struct MatchesId : public std::unary_function<const CollisionMaterial&, bool>
32  {
33  MatchesId(const std::string& materialId)
34  : m_materialId(materialId) {}
35 
36  bool operator() (const CollisionMaterial& collisionMaterial) const
37  {
38  return collisionMaterial.MaterialId() == m_materialId;
39  }
40  const std::string m_materialId;
41  };
42  }
43 }