-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dcb597
commit 7746c67
Showing
5 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Ensure this file is only included once | ||
#pragma once | ||
|
||
// Local headers | ||
#include "game_objects/registry.hpp" | ||
|
||
// ----- COMPONENTS ------------------------------ | ||
/// Allows a game object to interact with the physics system. | ||
struct KinematicComponent final : ComponentBase { | ||
/// The position of the game object. | ||
Vec2d position{0, 0}; | ||
|
||
/// The velocity of the game object. | ||
Vec2d velocity{0, 0}; | ||
|
||
/// The rotation of the game object. | ||
double rotation{0}; | ||
|
||
/// The Chipmunk2D body of the game object. | ||
ChipmunkHandle<cpBody, cpBodyNew, cpBodyFree> body{cpBodyNew(1, 1)}; | ||
}; | ||
|
||
// ----- SYSTEMS ------------------------------ | ||
/// Provides facilities to manipulate | ||
struct PhysicsSystem final : SystemBase { | ||
/// Initialise the object. | ||
/// | ||
/// @param registry - The registry that manages the game objects, components, and systems. | ||
explicit PhysicsSystem(const Registry *registry) : SystemBase(registry) {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Related header | ||
#include "game_objects/systems/physics.hpp" | ||
|
||
// ----- FUNCTIONS ------------------------------ |
2 changes: 1 addition & 1 deletion
2
src/hades_extensions/tests/game_objects/systems/test_armour_regen.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// External includes | ||
// External headers | ||
#include <gtest/gtest.h> | ||
|
||
// Local headers | ||
|