aboutsummaryrefslogtreecommitdiffstats
path: root/src/ru/olamedia/olacraft/physics/GamePhysicsWorld.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ru/olamedia/olacraft/physics/GamePhysicsWorld.java')
-rw-r--r--src/ru/olamedia/olacraft/physics/GamePhysicsWorld.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ru/olamedia/olacraft/physics/GamePhysicsWorld.java b/src/ru/olamedia/olacraft/physics/GamePhysicsWorld.java
new file mode 100644
index 0000000..dd66ef0
--- /dev/null
+++ b/src/ru/olamedia/olacraft/physics/GamePhysicsWorld.java
@@ -0,0 +1,27 @@
+package ru.olamedia.olacraft.physics;
+
+import org.ode4j.ode.DBody;
+import org.ode4j.ode.DRay;
+import org.ode4j.ode.DWorld;
+import org.ode4j.ode.OdeHelper;
+
+public class GamePhysicsWorld {
+ private DWorld world;
+
+ public GamePhysicsWorld() {
+ world = OdeHelper.createWorld();
+ world.setGravity(0, -0.98, 0);
+ }
+
+ public DWorld getWorld() {
+ return world;
+ }
+
+ public DBody createBody(){
+ return OdeHelper.createBody(world);
+ }
+
+ public DRay createRay(int length){
+ return OdeHelper.createRay(length);
+ }
+}