dEngine
Simple 2D C++ game engine
Private Member Functions | Private Attributes | List of all members
dengine::Collider Class Reference

Colliders are used to determine collisions between objects in the world's space. More...

#include <Collider.h>

Inheritance diagram for dengine::Collider:
dengine::Component

Private Member Functions

 Collider (GameObject &associated, Vec2 scale={1, 1}, Vec2 offset={0, 0})
 
void Update () override
 

Private Attributes

SDL_Rect box
 A rect denoting the collider's position in space. More...
 
Vec2 scale
 The scale of the collider. More...
 
Vec2 offset
 The collider's offset from it's parent object. More...
 

Additional Inherited Members

- Public Member Functions inherited from dengine::Component
 Component (GameObject &parent)
 Create a new component for a gameobject. More...
 
virtual void NotifyCollision (GameObject &other)
 
std::string GetName ()
 Returns the component's name. More...
 
virtual void Start ()
 Start the object To be called by the GameObject's Start method. This should be called at the beginning of instantiation. More...
 
virtual void Render ()
 
- Protected Attributes inherited from dengine::Component
GameObjectparent
 
std::string name
 

Detailed Description

Colliders are used to determine collisions between objects in the world's space.

Constructor & Destructor Documentation

◆ Collider()

Collider::Collider ( GameObject associated,
Vec2  scale = {1, 1},
Vec2  offset = {0, 0} 
)
private

Member Function Documentation

◆ Update()

void Collider::Update ( )
overrideprivatevirtual

Runs every frame performing any required logic

See also
components

Reimplemented from dengine::Component.

Member Data Documentation

◆ box

SDL_Rect dengine::Collider::box
private

A rect denoting the collider's position in space.

Referenced by Update().

◆ offset

Vec2 dengine::Collider::offset
private

The collider's offset from it's parent object.

◆ scale

Vec2 dengine::Collider::scale
private

The scale of the collider.

Referenced by Update().