diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/crepe/Collider.h | 2 | ||||
-rw-r--r-- | src/crepe/api/Rigidbody.cpp | 2 | ||||
-rw-r--r-- | src/crepe/api/Rigidbody.h | 14 |
3 files changed, 8 insertions, 10 deletions
diff --git a/src/crepe/Collider.h b/src/crepe/Collider.h index 5b26af5..e1624b4 100644 --- a/src/crepe/Collider.h +++ b/src/crepe/Collider.h @@ -1,7 +1,5 @@ #pragma once -#include "api/Vector2.h" - #include "Component.h" #include "types.h" diff --git a/src/crepe/api/Rigidbody.cpp b/src/crepe/api/Rigidbody.cpp index 576ca45..c4b1d6f 100644 --- a/src/crepe/api/Rigidbody.cpp +++ b/src/crepe/api/Rigidbody.cpp @@ -10,6 +10,6 @@ void crepe::Rigidbody::add_force_linear(const vec2 & force) { this->data.linear_velocity += force; } -void crepe::Rigidbody::add_force_angular(double force) { +void crepe::Rigidbody::add_force_angular(float force) { this->data.angular_velocity += force; } diff --git a/src/crepe/api/Rigidbody.h b/src/crepe/api/Rigidbody.h index 7939563..446c5dd 100644 --- a/src/crepe/api/Rigidbody.h +++ b/src/crepe/api/Rigidbody.h @@ -52,9 +52,9 @@ public: */ struct Data { //! objects mass - double mass = 0.0; + float mass = 0.0; //! gravtiy scale - double gravity_scale = 0.0; + float gravity_scale = 0.0; //! Changes if physics apply BodyType body_type = BodyType::DYNAMIC; //! linear velocity of object @@ -64,11 +64,11 @@ public: //! linear damping of object vec2 linear_damping; //! angular velocity of object - double angular_velocity = 0.0; + float angular_velocity = 0.0; //! max angular velocity of object - double max_angular_velocity = INFINITY; + float max_angular_velocity = INFINITY; //! angular damping of object - double angular_damping = 0.0; + float angular_damping = 0.0; //! movements constraints of object PhysicsConstraints constraints; //! if gravity applies @@ -76,7 +76,7 @@ public: //! if object bounces bool bounce = false; //! bounce factor of material - double elastisity = 0.0; + float elastisity = 0.0; //! offset of all colliders relative to transform position vec2 offset; }; @@ -102,7 +102,7 @@ public: * * \param force Vector2 that is added to the angular force. */ - void add_force_angular(double force); + void add_force_angular(float force); }; } // namespace crepe |