aboutsummaryrefslogtreecommitdiffstats
path: root/include/YAGE/Physics
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-07-23 14:19:28 +0100
committerYann Herklotz <ymherklotz@gmail.com>2017-07-23 14:19:28 +0100
commitdaa9dc84d7fb6e7c8f84b1ee3adfaacaad7de72f (patch)
tree60909899b320f03193896b277006fb01a506629f /include/YAGE/Physics
parent85fe87aa7a52733dc80f61617bf65f22b2d98ccb (diff)
downloadYAGE-daa9dc84d7fb6e7c8f84b1ee3adfaacaad7de72f.tar.gz
YAGE-daa9dc84d7fb6e7c8f84b1ee3adfaacaad7de72f.zip
Fixing gravity
Diffstat (limited to 'include/YAGE/Physics')
-rw-r--r--include/YAGE/Physics/body.hpp12
-rw-r--r--include/YAGE/Physics/particlebody.hpp6
-rw-r--r--include/YAGE/Physics/rigidbody.hpp6
3 files changed, 12 insertions, 12 deletions
diff --git a/include/YAGE/Physics/body.hpp b/include/YAGE/Physics/body.hpp
index f09cd5d5..5a0e879e 100644
--- a/include/YAGE/Physics/body.hpp
+++ b/include/YAGE/Physics/body.hpp
@@ -19,7 +19,7 @@ protected:
double mass_=1;
// current velocity of the object
- Vector2d velocity_=Vector2d(0.f, 0.f);
+ Vector2d velocity_=Vector2d(0, 0);
// boolean that defines if gravity can act on the object
bool gravity_=true;
@@ -37,13 +37,13 @@ public:
virtual void applyForce(const Vector2d &force)=0;
virtual void update()=0;
- float xPosition() const;
- float yPosition() const;
+ double xPosition() const;
+ double yPosition() const;
protected:
// protected constructor to initialize member variables
- Body(const Vector2d &position=Vector2d(0.f, 0.f),
- double mass=1.0,
- const Vector2d &velocity=Vector2d(0.f, 0.f),
+ Body(const Vector2d &position=Vector2d(0, 0),
+ double mass=1,
+ const Vector2d &velocity=Vector2d(0, 0),
bool gravity=false);
};
diff --git a/include/YAGE/Physics/particlebody.hpp b/include/YAGE/Physics/particlebody.hpp
index 09ad8c7b..62e6fc43 100644
--- a/include/YAGE/Physics/particlebody.hpp
+++ b/include/YAGE/Physics/particlebody.hpp
@@ -11,9 +11,9 @@ namespace yage
class ParticleBody : public Body
{
public:
- ParticleBody(const Vector2d &position=Vector2d(0.f, 0.f),
- double mass=1.0,
- const Vector2d &velocity=Vector2d(0.f, 0.f),
+ ParticleBody(const Vector2d &position=Vector2d(0, 0),
+ double mass=1,
+ const Vector2d &velocity=Vector2d(0, 0),
bool gravity=true);
// apply a force to the rigid body
diff --git a/include/YAGE/Physics/rigidbody.hpp b/include/YAGE/Physics/rigidbody.hpp
index 48380dac..05d8d0ad 100644
--- a/include/YAGE/Physics/rigidbody.hpp
+++ b/include/YAGE/Physics/rigidbody.hpp
@@ -11,9 +11,9 @@ namespace yage
class RigidBody : public ParticleBody
{
public:
- RigidBody(const glm::vec2 &position=glm::vec2(0.f, 0.f),
- double mass=1.0,
- const glm::vec2 &velocity=glm::vec2(0.f, 0.f),
+ RigidBody(const Vector2d &position=Vector2d(0, 0),
+ double mass=1,
+ const Vector2d &velocity=Vector2d(0, 0),
bool gravity=true);
};