diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-05-17 10:36:59 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-05-17 10:36:59 +0100 |
commit | 7583ad924479b11bbd45122194b53a7b6c8f7a0e (patch) | |
tree | f454120b7bd2f5cc344eb221f975321842980a13 /test | |
parent | f7fc06b5066018451b6b456be0dbc46bafe2fd88 (diff) | |
download | YAGE-7583ad924479b11bbd45122194b53a7b6c8f7a0e.tar.gz YAGE-7583ad924479b11bbd45122194b53a7b6c8f7a0e.zip |
Adding files
Diffstat (limited to 'test')
-rw-r--r-- | test/rigid_body_test.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/rigid_body_test.cpp b/test/rigid_body_test.cpp index b0b1d1d6..39488599 100644 --- a/test/rigid_body_test.cpp +++ b/test/rigid_body_test.cpp @@ -1,6 +1,19 @@ #include "Physics/rigidbody.hpp" +#include <iostream> + int main(int, char**) { - + yage::RigidBody body(glm::vec2(0.f, 0.f), 1, glm::vec2(0.f, 9.81f)); + for(int i=0; i<60*3; ++i) + { + body.update(); + std::cout<<"position: "<<body.xPosition()<<", "<<body.yPosition()<<"\n"; + } + + double ideal_position=0.5*9.81*3*3; + + if(body.yPosition()>ideal_position*0.95 && body.yPosition()<ideal_position*1.05) + return 0; + return 1; } |