aboutsummaryrefslogtreecommitdiffstats
path: root/test/particlebodytest.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-08-06 18:58:40 +0100
committerYann Herklotz <ymherklotz@gmail.com>2017-08-06 18:58:40 +0100
commit5401b4a6ea1055e27820fd1155c7093d63491214 (patch)
tree979789f6976c34baa76fc82b5fb9c61b5bf3c049 /test/particlebodytest.cpp
parent8aa516dbc3ed962894755b22e5cf88a83b0af812 (diff)
downloadYAGE-5401b4a6ea1055e27820fd1155c7093d63491214.tar.gz
YAGE-5401b4a6ea1055e27820fd1155c7093d63491214.zip
Removing unnecessary tests and formatting files
Diffstat (limited to 'test/particlebodytest.cpp')
-rw-r--r--test/particlebodytest.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/particlebodytest.cpp b/test/particlebodytest.cpp
new file mode 100644
index 00000000..54424b37
--- /dev/null
+++ b/test/particlebodytest.cpp
@@ -0,0 +1,29 @@
+/* ----------------------------------------------------------------------------
+ * rigidbodytest.cpp
+ *
+ * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
+ * See file LICENSE for more details
+ * ----------------------------------------------------------------------------
+ */
+
+#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;
+
+ std::cout << "Ideal Position: " << ideal_position << "\n";
+
+ if (body.yPosition() < ideal_position * 0.95 &&
+ body.yPosition() > ideal_position * 1.05)
+ return 0;
+ return 1;
+}