Jagguar Game Engine

Loading...
Searching...
No Matches
IPhysicsComponent.hpp
1#ifndef PHYSICSCOMPONENT_HPP
2#define PHYSICSCOMPONENT_HPP
3
4#include "Component.hpp"
5#include "TransformComponent.hpp"
6#include "TinyMath.hpp"
7
11 class IPhysicsComponent : public Component {
12 public:
19 IPhysicsComponent(TransformComponent* pos, Vec2D dim);
20
24 ~IPhysicsComponent();
25
32 bool IsColliding(IPhysicsComponent* other);
33
43 virtual void ApplyForce(Vec2D force);
44
49 virtual void ApplyAcceleration(Vec2D acceleration);
50
59 virtual void ApplyVelocity();
60
61 // SETTERS
62
68 virtual void SetVelocity(Vec2D vel);
69
70 // GETTERS
71
79 virtual bool IsKinematic();
80
87 virtual bool IsElastic();
88
94 virtual bool UsesGravity();
95
102 Vec2D GetPosition();
103
109 Vec2D GetDimensions();
110
116 virtual Vec2D GetVelocity();
117
123 virtual float GetMass();
124
125 protected:
126 TransformComponent* m_position;
127 Vec2D dimensions;
128 std::vector<ComponentTag> tags = {ComponentTag::Physics};
129};
130
131#endif
Component
Definition: Component.hpp:38
IPhysicsComponent
Definition: IPhysicsComponent.hpp:11
IPhysicsComponent::ApplyAcceleration
virtual void ApplyAcceleration(Vec2D acceleration)
Definition: IPhysicsComponent.cpp:30
IPhysicsComponent::ApplyForce
virtual void ApplyForce(Vec2D force)
Definition: IPhysicsComponent.cpp:29
IPhysicsComponent::IsElastic
virtual bool IsElastic()
Definition: IPhysicsComponent.cpp:34
IPhysicsComponent::UsesGravity
virtual bool UsesGravity()
Definition: IPhysicsComponent.cpp:35
IPhysicsComponent::GetVelocity
virtual Vec2D GetVelocity()
Definition: IPhysicsComponent.cpp:36
IPhysicsComponent::GetMass
virtual float GetMass()
Definition: IPhysicsComponent.cpp:37
IPhysicsComponent::IsColliding
bool IsColliding(IPhysicsComponent *other)
Definition: IPhysicsComponent.cpp:9
IPhysicsComponent::IsKinematic
virtual bool IsKinematic()
Definition: IPhysicsComponent.cpp:33
IPhysicsComponent::GetDimensions
Vec2D GetDimensions()
Definition: IPhysicsComponent.cpp:24
IPhysicsComponent::GetPosition
Vec2D GetPosition()
Definition: IPhysicsComponent.cpp:20
IPhysicsComponent::ApplyVelocity
virtual void ApplyVelocity()
Definition: IPhysicsComponent.cpp:31
IPhysicsComponent::dimensions
Vec2D dimensions
Definition: IPhysicsComponent.hpp:127
IPhysicsComponent::~IPhysicsComponent
~IPhysicsComponent()
Definition: IPhysicsComponent.cpp:7
IPhysicsComponent::SetVelocity
virtual void SetVelocity(Vec2D vel)
Definition: IPhysicsComponent.cpp:32
TransformComponent
Definition: TransformComponent.hpp:12
Vec2D
Definition: TinyMath.hpp:14