dEngine
Simple 2D C++ game engine
Collider.h
Go to the documentation of this file.
1 #ifndef DENGINE_COLLIDER_H
2 #define DENGINE_COLLIDER_H
3 
4 
5 #include <SDL_rect.h>
6 #include "../System/Component.h"
7 #include "../Vec2.h"
8 
9 namespace dengine {
13  class Collider : public Component {
14  Collider(GameObject &associated, Vec2 scale = {1, 1}, Vec2 offset = {0, 0});
15 
19  SDL_Rect box;
20 
21  void Update() override;
22 
23  private:
32  };
33 }
34 
35 #endif //DENGINE_COLLIDER_H
Collider(GameObject &associated, Vec2 scale={1, 1}, Vec2 offset={0, 0})
Definition: Collider.cpp:5
SDL_Rect box
A rect denoting the collider&#39;s position in space.
Definition: Collider.h:19
A base object for a game The gameobject can be considered the most basic building block of a game...
Definition: GameObject.h:19
Colliders are used to determine collisions between objects in the world&#39;s space.
Definition: Collider.h:13
A vector composed of two points.
Definition: Vec2.h:11
Vec2 offset
The collider&#39;s offset from it&#39;s parent object.
Definition: Collider.h:31
Vec2 scale
The scale of the collider.
Definition: Collider.h:27
Gameobject component that asssists in adding additional functionality.
Definition: Component.h:14
void Update() override
Definition: Collider.cpp:9
The namespace containing the engine&#39;s code.
Definition: Collider.h:9