5 #include <ThirdParty/Box2D/Box2D/Box2D.h> 6 #include <ThirdParty/glm/glm/detail/type_vec2.hpp> 7 #include <ThirdParty/EASTL-master/include/EASTL/shared_ptr.h> 11 class TransformComponent;
20 typedef eastl::shared_ptr<CollisionComponent> CollPtr;
27 void InitializeComponent()
override;
31 void OnComponentAdded(eastl::weak_ptr<Component> addedComponent)
override;
32 void OnComponentRemoved(eastl::weak_ptr<Component> removedComponent)
override;
34 eastl::weak_ptr<TransformComponent> GetTransformComponent()
const;
42 void SetBodyType(b2BodyType bodyType);
48 b2BodyType GetBodyType()
const;
55 void SetCircle(
const float radius);
61 float GetCircleRadius()
const;
68 void SetAABB(
const float sizeX,
const float sizeY);
74 void SetAABB(
const glm::vec2& size);
80 glm::vec2 GetAABBSize()
const;
121 void SetIsSensor(
bool isSensor);
127 bool GetIsSensor()
const;
132 template <
typename archive>
133 void SaveComponent(archive ar);
139 template<
typename archive>
140 void LoadComponent(archive ar);
144 b2FixtureDef fixtureDef;
145 b2CircleShape circleShape;
146 b2PolygonShape boxShape;
152 eastl::weak_ptr<TransformComponent> transformComponent;
This is the base class for components. NOTE: only the Entity class is allowed to create this object...
CollisionShapeType
Enum for available collision shapes
The Collision component is an entities link to the Collision System and allows for interaction with t...
The Collision System handles and stores run-time collision data using the Box2D library ...
CollisionLayer
Bitmask Enum that allows for layered collision checking