diff --git a/buildNumber.properties b/buildNumber.properties index 92431573..472a0d47 100644 --- a/buildNumber.properties +++ b/buildNumber.properties @@ -1,3 +1,3 @@ #maven.buildNumber.plugin properties file -#Sun May 25 09:48:39 EDT 2025 -buildNumber=634 +#Sun May 25 10:30:51 EDT 2025 +buildNumber=635 diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 9f877a0b..873598be 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1987,6 +1987,7 @@ Performance improvements - Behavior tree addition/subtraction from scene optimization - Reduce bones on LOD human model Increase human move speed +LOD components re-attach physics diff --git a/src/main/java/electrosphere/entity/state/lod/ClientLODComponent.java b/src/main/java/electrosphere/entity/state/lod/ClientLODComponent.java index f0a9257e..6322bd1f 100644 --- a/src/main/java/electrosphere/entity/state/lod/ClientLODComponent.java +++ b/src/main/java/electrosphere/entity/state/lod/ClientLODComponent.java @@ -3,11 +3,13 @@ package electrosphere.entity.state.lod; import electrosphere.collision.PhysicsEntityUtils; import electrosphere.collision.PhysicsUtils; +import electrosphere.data.entity.common.CommonEntityType; import electrosphere.engine.Globals; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.Entity; import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums; import electrosphere.entity.btree.BehaviorTree; +import electrosphere.entity.types.common.CommonEntityUtils; import electrosphere.net.synchronization.annotation.SyncedField; import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree; @@ -38,7 +40,10 @@ public class ClientLODComponent implements BehaviorTree { if(cachedLodLevel != lodLevel){ cachedLodLevel = lodLevel; if(cachedLodLevel == ServerLODComponent.FULL_RES){ - + CommonEntityType type = CommonEntityUtils.getCommonData(this.parent); + if(type.getCollidable() != null){ + PhysicsEntityUtils.clientAttachCollidableTemplate(parent, type.getCollidable()); + } } else if(cachedLodLevel == ServerLODComponent.LOW_RES){ if(PhysicsEntityUtils.containsDBody(this.parent)){ PhysicsUtils.destroyPhysicsPair( diff --git a/src/main/java/electrosphere/entity/state/lod/ServerLODComponent.java b/src/main/java/electrosphere/entity/state/lod/ServerLODComponent.java index 70ded6db..94997dd7 100644 --- a/src/main/java/electrosphere/entity/state/lod/ServerLODComponent.java +++ b/src/main/java/electrosphere/entity/state/lod/ServerLODComponent.java @@ -5,6 +5,7 @@ import org.joml.Vector3d; import electrosphere.collision.PhysicsEntityUtils; import electrosphere.collision.PhysicsUtils; +import electrosphere.data.entity.common.CommonEntityType; import electrosphere.engine.Globals; import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityUtils; @@ -16,6 +17,7 @@ import electrosphere.entity.Entity; import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums; import electrosphere.server.datacell.utils.ServerBehaviorTreeUtils; import electrosphere.entity.btree.BehaviorTree; +import electrosphere.entity.types.common.CommonEntityUtils; import electrosphere.net.synchronization.annotation.SyncedField; import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree; @@ -59,6 +61,11 @@ public class ServerLODComponent implements BehaviorTree { if(lodLevel != FULL_RES){ //make full res this.setLodLevel(FULL_RES); + Realm realm = Globals.serverState.realmManager.getEntityRealm(this.parent); + CommonEntityType type = CommonEntityUtils.getCommonData(this.parent); + if(type.getCollidable() != null){ + PhysicsEntityUtils.serverAttachCollidableTemplate(realm, this.parent, type.getCollidable()); + } } } else { if(lodLevel != LOW_RES){