From 0b4c08796e0a5c7514f4d716178912fcaa43ec8e Mon Sep 17 00:00:00 2001 From: austin Date: Sat, 31 May 2025 15:42:24 -0400 Subject: [PATCH] geom work --- docs/src/progress/renderertodo.md | 1 + .../groundmove/ServerGroundMovementTree.java | 15 ++++++++++++--- .../java/electrosphere/server/ai/AIManager.java | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 6476b6dc..e8f70895 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -2099,6 +2099,7 @@ Macro pathing test Actually fix pathing spinlock Support for observing ai entities ServerGroundMovementTree supports collidable entities +ServerGroundMovementTree geom work diff --git a/src/main/java/electrosphere/entity/state/movement/groundmove/ServerGroundMovementTree.java b/src/main/java/electrosphere/entity/state/movement/groundmove/ServerGroundMovementTree.java index fd2bba4a..8d623b5c 100644 --- a/src/main/java/electrosphere/entity/state/movement/groundmove/ServerGroundMovementTree.java +++ b/src/main/java/electrosphere/entity/state/movement/groundmove/ServerGroundMovementTree.java @@ -290,7 +290,10 @@ public class ServerGroundMovementTree implements BehaviorTree { CreatureUtils.setVelocity(parent, velocity); } if(body == null){ - ServerEntityUtils.repositionEntity(parent, new Vector3d(position).add(velocity,velocity,velocity)); + Vector3d velVec = new Vector3d(movementVector); + velVec.mul(velocity * Globals.engineState.timekeeper.getSimFrameTime()); + velVec.add(position); + ServerEntityUtils.repositionEntity(parent, velVec); } else { body.enable(); body.setLinearVel( @@ -339,7 +342,10 @@ public class ServerGroundMovementTree implements BehaviorTree { this.updateVelocity(); float velocity = this.getModifiedVelocity(); if(body == null){ - ServerEntityUtils.repositionEntity(parent, new Vector3d(position).add(velocity,velocity,velocity)); + Vector3d velVec = new Vector3d(movementVector); + velVec.mul(velocity * Globals.engineState.timekeeper.getSimFrameTime()); + velVec.add(position); + ServerEntityUtils.repositionEntity(parent, velVec); } else { body.enable(); body.setLinearVel( @@ -407,7 +413,10 @@ public class ServerGroundMovementTree implements BehaviorTree { GravityUtils.serverAttemptActivateGravity(parent); } if(body == null){ - ServerEntityUtils.repositionEntity(parent, new Vector3d(position).add(velocity,velocity,velocity)); + Vector3d velVec = new Vector3d(movementVector); + velVec.mul(velocity * Globals.engineState.timekeeper.getSimFrameTime()); + velVec.add(position); + ServerEntityUtils.repositionEntity(parent, velVec); } else { body.enable(); body.setLinearVel( diff --git a/src/main/java/electrosphere/server/ai/AIManager.java b/src/main/java/electrosphere/server/ai/AIManager.java index 60223237..b2d64ce1 100644 --- a/src/main/java/electrosphere/server/ai/AIManager.java +++ b/src/main/java/electrosphere/server/ai/AIManager.java @@ -44,7 +44,7 @@ public class AIManager { /** * Controls whether the ai manager should simulate each frame or not */ - private boolean active = true; + private boolean active = false; /** * The timer service