|
Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
|
The Collision component is an entities link to the Collision System and allows for interaction with the other collision components. IMPORTANT: The Collision Component requires a Transform Component to be attached to the same entitiy. More...
#include <CollisionComponent.hpp>
Public Member Functions | |
| void | SetBodyType (b2BodyType bodyType) |
| Sets the Body Type (Static, Dynamic, Kinematic) for the collision body. More... | |
| b2BodyType | GetBodyType () const |
| Gets the Body Type (Static, Dynamic, Kinematic) of the collision body. More... | |
| void | SetCircle (const float radius) |
| Sets the Shape of the component to Circle More... | |
| float | GetCircleRadius () const |
| Get the Radius of the circle shape (still returns even if it isn't a circle shape) More... | |
| void | SetAABB (const float sizeX, const float sizeY) |
| Sets the Shape of the component to AABB More... | |
| void | SetAABB (const glm::vec2 &size) |
| Sets the Shape of the component to AABB More... | |
| glm::vec2 | GetAABBSize () const |
| Gets the size of AABB. (Still returns the size even if the shape isn't AABB) More... | |
| CollisionShapeType | GetCollisionShapeType () const |
| Gets the collision shape type of the collision component More... | |
| void | SetCollisionLayer (CollisionLayer layer) |
| Sets the collision layer The collision layer is the "type" of the collision body,other collision bodies looking for this "type" will generate a collision response if they are detectable by this collision body More... | |
| CollisionLayer | GetCollisionLayer () const |
| Gets the collision layer More... | |
| void | SetDetectionLayers (CollisionLayer layers) |
| Sets the detection layers The detection layers are what this collision object will be looking for to collide/interact with. More... | |
| CollisionLayer | GetDetectionLayers () const |
| Gets the detection layers More... | |
| void | SetIsSensor (bool isSensor) |
| Sets if the collision object will be a sensor or not. NOTE: A sensor is an object that does do collision callbacks but does not do collision correction/response on world update. NOTE: Use this if you want something to act as a trigger. More... | |
| bool | GetIsSensor () const |
| Returns true if the collision object is a sensor More... | |
| template<typename archive > | |
| void | SaveComponent (archive ar) |
| template<typename archive > | |
| void | LoadComponent (archive ar) |
| loads the data from the archive to this component More... | |
Public Member Functions inherited from Engine::Component | |
| virtual | ~Component ()=default |
| eastl::weak_ptr< Entity > | GetOwner () const |
| This method allows you to get the entity holding this component. More... | |
Friends | |
| class | CollisionSystem |
Additional Inherited Members | |
Public Attributes inherited from Engine::Component | |
| bool | isEnabled |
Protected Member Functions inherited from Engine::Component | |
| Component () | |
| virtual void | Update () |
| The update method of this component. NOTE: This method will not be called in case the entity is disabled. More... | |
| template<typename ComponentType > | |
| eastl::weak_ptr< ComponentType > | GetComponent () |
| This method allows you to get the first component of the given type. More... | |
| template<typename ComponentType > | |
| eastl::vector< eastl::weak_ptr< ComponentType > > | GetComponents () |
| This method allows you to get all of the components of the given type. More... | |
| eastl::vector< eastl::shared_ptr< Component > > | GetAllComponents () const |
| Returns all the components of this entity. More... | |
| template<class ComponentType , class... Args> | |
| eastl::weak_ptr< ComponentType > | AddComponent (Args &&...args) |
| Allows you to create a component of the given type. More... | |
| template<class ComponentType , class... Args> | |
| eastl::vector< eastl::weak_ptr< ComponentType > > | AddComponents (size_t count, Args &&...args) |
| Allows you to create X amount of components of the given type. More... | |
| template<typename ComponentType > | |
| void | RemoveComponent (size_t amountToRemove=1) const |
| Allows X amount of components of the given type. More... | |
| template<typename ComponentType > | |
| void | RemoveAllComponents () const |
| Deletes all the components of the given type. More... | |
| template<typename archive > | |
| void | SaveBaseComponent (archive ar) |
| Saves the data of this component to a archive (all derived classes have their own version, but if needed they can call this one as a failsafe/default version) More... | |
| template<typename archive > | |
| void | LoadBaseComponent (archive ar) |
| loads the data from the archive to this component (all derived classes have their own version, but if needed they can call this one as a failsafe/default version) More... | |
| virtual void | OnBeginContact (eastl::weak_ptr< Entity > entity) |
| virtual void | OnEndContact (eastl::weak_ptr< Entity > entity) |
| eastl::weak_ptr< Component > | GetPointerRefence () const |
| This method allows you to get a direct refence to the weak pointer of this component. More... | |
| template<typename ComponentType > | |
| eastl::weak_ptr< ComponentType > | GetPointerRefence () |
| This method allows you to get a direct refence to the weak pointer of this component. More... | |
The Collision component is an entities link to the Collision System and allows for interaction with the other collision components. IMPORTANT: The Collision Component requires a Transform Component to be attached to the same entitiy.
Definition at line 17 of file CollisionComponent.hpp.
| glm::vec2 Engine::CollisionComponent::GetAABBSize | ( | ) | const |
Gets the size of AABB. (Still returns the size even if the shape isn't AABB)
Definition at line 120 of file CollisionComponent.cpp.
| b2BodyType Engine::CollisionComponent::GetBodyType | ( | ) | const |
Gets the Body Type (Static, Dynamic, Kinematic) of the collision body.
Definition at line 91 of file CollisionComponent.cpp.
| float Engine::CollisionComponent::GetCircleRadius | ( | ) | const |
Get the Radius of the circle shape (still returns even if it isn't a circle shape)
Definition at line 102 of file CollisionComponent.cpp.
| CollisionLayer Engine::CollisionComponent::GetCollisionLayer | ( | ) | const |
Gets the collision layer
Definition at line 135 of file CollisionComponent.cpp.
| CollisionShapeType Engine::CollisionComponent::GetCollisionShapeType | ( | ) | const |
Gets the collision shape type of the collision component
Definition at line 125 of file CollisionComponent.cpp.
| CollisionLayer Engine::CollisionComponent::GetDetectionLayers | ( | ) | const |
Gets the detection layers
Definition at line 145 of file CollisionComponent.cpp.
| bool Engine::CollisionComponent::GetIsSensor | ( | ) | const |
Returns true if the collision object is a sensor
Definition at line 155 of file CollisionComponent.cpp.
| void Engine::CollisionComponent::LoadComponent | ( | archive | ar | ) |
loads the data from the archive to this component
| ar | the archive that you want to load from |
Definition at line 174 of file CollisionComponent.cpp.
| void Engine::CollisionComponent::SaveComponent | ( | archive | ar | ) |
Saves the data of this component to a archive
| ar | the archive that you want to save to |
Definition at line 160 of file CollisionComponent.cpp.
| void Engine::CollisionComponent::SetAABB | ( | const float | sizeX, |
| const float | sizeY | ||
| ) |
Sets the Shape of the component to AABB
| sizeX | The size of the AABB along the x axis |
| sizeY | The size of the AABB along the y axis |
Definition at line 107 of file CollisionComponent.cpp.
| void Engine::CollisionComponent::SetAABB | ( | const glm::vec2 & | size | ) |
Sets the Shape of the component to AABB
| size | The size of the AABB |
Definition at line 115 of file CollisionComponent.cpp.
| void Engine::CollisionComponent::SetBodyType | ( | b2BodyType | bodyType | ) |
Sets the Body Type (Static, Dynamic, Kinematic) for the collision body.
| bodyType | The body type the component will assume |
Definition at line 86 of file CollisionComponent.cpp.
| void Engine::CollisionComponent::SetCircle | ( | const float | radius | ) |
Sets the Shape of the component to Circle
| radius | The Radius for the circle shape |
Definition at line 96 of file CollisionComponent.cpp.
| void Engine::CollisionComponent::SetCollisionLayer | ( | CollisionLayer | layer | ) |
Sets the collision layer The collision layer is the "type" of the collision body,other collision bodies looking for this "type" will generate a collision response if they are detectable by this collision body
| layer | The new layer |
Definition at line 130 of file CollisionComponent.cpp.
| void Engine::CollisionComponent::SetDetectionLayers | ( | CollisionLayer | layers | ) |
Sets the detection layers The detection layers are what this collision object will be looking for to collide/interact with.
| layers | The new detection layers |
Definition at line 140 of file CollisionComponent.cpp.
| void Engine::CollisionComponent::SetIsSensor | ( | bool | isSensor | ) |
Sets if the collision object will be a sensor or not. NOTE: A sensor is an object that does do collision callbacks but does not do collision correction/response on world update. NOTE: Use this if you want something to act as a trigger.
| isSensor | The new value determining if the collision object will be a sensor. |
Definition at line 150 of file CollisionComponent.cpp.
|
friend |
Definition at line 21 of file CollisionComponent.hpp.
1.8.11