From aa1e7fa1171b1be92b62005b5fc8fa2cd6ce7f0c Mon Sep 17 00:00:00 2001 From: austin Date: Thu, 21 Mar 2024 20:31:12 -0400 Subject: [PATCH] Defer physics overhaul 4 for larger timeblock --- docs/src/progress/renderertodo.md | 22 ++++++++++--------- .../collision/CollisionEngine.java | 14 ++++++++++-- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 572c1bcf..fd01fb48 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -182,16 +182,6 @@ Fix Character creation preview not working # TODO -Fix bad data with human mesh textures not mapping - -Clean up main method/class - -Include Remotery library - -Physics-controlled objects system - -Shader library system - - Abiltiy to include the shader library in individual files (ie implement #include) Level loading/saving + Basic Editor - Spin up voxel level (think arena mode) @@ -199,6 +189,11 @@ Level loading/saving + Basic Editor - Basic editor functionality - Menu of types of entities to spawn - Button to spawn them at cursor + +Physics-controlled objects system + +Shader library system + - Abiltiy to include the shader library in individual files (ie implement #include) Transvoxel Algorithm @@ -233,6 +228,13 @@ Light Manager - Eventually support spot lights? - Point shadows ??? +Clean up main method/class + - Include Remotery library + +gltf Support + - Fix bad data with human mesh textures not mapping + - Texture loading from gltf file + Cellular Automata Fluid Dynamics System - Advect force diff --git a/src/main/java/electrosphere/collision/CollisionEngine.java b/src/main/java/electrosphere/collision/CollisionEngine.java index e608f5a4..3705719d 100644 --- a/src/main/java/electrosphere/collision/CollisionEngine.java +++ b/src/main/java/electrosphere/collision/CollisionEngine.java @@ -60,7 +60,7 @@ import electrosphere.logger.LoggerInterface; */ public class CollisionEngine { - public static final float ENGINE_STEP_SIZE = 1000.0f / 120.0f; + public static final float ENGINE_STEP_SIZE = 0.01f; //world data that the collision engine leverages for position correction and the like CollisionWorldData collisionWorldData; @@ -68,7 +68,7 @@ public class CollisionEngine { //Ode-specific stuff private DWorld world; private DSpace space; - private Semaphore spaceLock = new Semaphore(1); + private static Semaphore spaceLock = new Semaphore(1); private DJointGroup contactgroup; private static final int MAX_CONTACTS = 1; // maximum number of contact points per body @@ -713,5 +713,15 @@ public class CollisionEngine { spaceLock.release(); return rVal; } + + /** + * Sets a body to be kinematic (infinite mass, not affected by gravity) + * @param body The body to set + */ + protected void setKinematic(DBody body){ + spaceLock.acquireUninterruptibly(); + body.setKinematic(); + spaceLock.release(); + } }