aboutsummaryrefslogtreecommitdiffstats
path: root/test/rigidbodytest.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-06-22 17:56:01 +0100
committerYann Herklotz <ymherklotz@gmail.com>2017-06-22 17:56:01 +0100
commita4b4047e48e435253efea0c188b808995a477d8c (patch)
tree5cbdf491df512043ecfb3e79e6a67cab49b8eec7 /test/rigidbodytest.cpp
parent7f27d3bf881ca3c257ab346c4ef5b6b0d177cdaa (diff)
downloadYAGE-a4b4047e48e435253efea0c188b808995a477d8c.tar.gz
YAGE-a4b4047e48e435253efea0c188b808995a477d8c.zip
Fixing file names
Diffstat (limited to 'test/rigidbodytest.cpp')
-rw-r--r--test/rigidbodytest.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/rigidbodytest.cpp b/test/rigidbodytest.cpp
new file mode 100644
index 00000000..c5683697
--- /dev/null
+++ b/test/rigidbodytest.cpp
@@ -0,0 +1,19 @@
+#include "Physics/particlebody.hpp"
+
+#include <iostream>
+
+int main(int, char**)
+{
+ yage::ParticleBody body;
+ 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;
+}