diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-11-15 16:10:45 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-11-15 16:10:45 +0100 |
commit | b019b401c3a1de0ffea7e6776242ae73599651ef (patch) | |
tree | 473c90cd71a8ee9943d8d333e11f6d40e68a8287 /src/crepe/api | |
parent | e6bc46a30152a7585dda24fde66622575349d25e (diff) |
collision handeling example
Diffstat (limited to 'src/crepe/api')
-rw-r--r-- | src/crepe/api/Event.h | 1 | ||||
-rw-r--r-- | src/crepe/api/Rigidbody.h | 5 | ||||
-rw-r--r-- | src/crepe/api/Script.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/crepe/api/Event.h b/src/crepe/api/Event.h index 3431f29..bd6a541 100644 --- a/src/crepe/api/Event.h +++ b/src/crepe/api/Event.h @@ -49,7 +49,6 @@ public: crepe::CollisionSystem::CollisionInfo info; CollisionEvent(const crepe::CollisionSystem::CollisionInfo& collisionInfo) : info(collisionInfo) {} - }; class TextSubmitEvent : public Event { public: diff --git a/src/crepe/api/Rigidbody.h b/src/crepe/api/Rigidbody.h index b9edec2..a45623f 100644 --- a/src/crepe/api/Rigidbody.h +++ b/src/crepe/api/Rigidbody.h @@ -1,5 +1,6 @@ #pragma once +#include <cmath> #include <cstdint> #include "../Component.h" @@ -60,13 +61,13 @@ public: //! linear velocity of object Vector2 linear_velocity; //! maximum linear velocity of object - Vector2 max_linear_velocity; + Vector2 max_linear_velocity = {INFINITY ,INFINITY}; //! linear damping of object Vector2 linear_damping; //! angular velocity of object double angular_velocity = 0.0; //! max angular velocity of object - double max_angular_velocity = 0.0; + double max_angular_velocity = INFINITY; //! angular damping of object double angular_damping = 0.0; //! movements constraints of object diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h index 49e625f..0a10848 100644 --- a/src/crepe/api/Script.h +++ b/src/crepe/api/Script.h @@ -28,7 +28,7 @@ protected: template <typename T> std::vector<std::reference_wrapper<T>> get_components(); -private: +public: friend class crepe::BehaviorScript; BehaviorScript * parent = nullptr; }; |