client LOD fix
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-05-28 16:13:12 -04:00
parent a7bb4300ae
commit d12353b2cf
3 changed files with 14 additions and 0 deletions

View File

@ -2026,6 +2026,7 @@ Fix macro structure rotation generation
Improvement to building placement math in TownLayout Improvement to building placement math in TownLayout
Scaffold character job data Scaffold character job data
Moving data packages around Moving data packages around
Fix client LOD tree re-enabling physics positioning

View File

@ -32,6 +32,16 @@ public class ClientEntityUtils {
CollisionObjUtils.clientPositionCharacter(entity, position, rotation); CollisionObjUtils.clientPositionCharacter(entity, position, rotation);
} }
/**
* Called when the creature is first spawned to serialize to all people in its initial chunk
* @param entity
* @param position
*/
public static void reositionEntity(Entity entity, Vector3d position, Quaterniond rotation){
//reposition entity
CollisionObjUtils.clientPositionCharacter(entity, position, rotation);
}
/** /**
* Destroys an entity on the client * Destroys an entity on the client
* @param entity the entity to destroy * @param entity the entity to destroy

View File

@ -8,6 +8,7 @@ import electrosphere.data.entity.common.CommonEntityType;
import electrosphere.engine.Globals; import electrosphere.engine.Globals;
import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityDataStrings;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
import electrosphere.entity.ClientEntityUtils;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums; import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums;
import electrosphere.entity.btree.BehaviorTree; import electrosphere.entity.btree.BehaviorTree;
@ -49,6 +50,7 @@ public class ClientLODComponent implements BehaviorTree {
){ ){
CollidableTemplate physicsTemplate = commonData.getCollidable(); CollidableTemplate physicsTemplate = commonData.getCollidable();
PhysicsEntityUtils.clientAttachCollidableTemplate(this.parent, physicsTemplate); PhysicsEntityUtils.clientAttachCollidableTemplate(this.parent, physicsTemplate);
ClientEntityUtils.reositionEntity(parent, EntityUtils.getPosition(parent), EntityUtils.getRotation(parent));
} }
} }
if(cachedLodLevel != lodLevel){ if(cachedLodLevel != lodLevel){
@ -57,6 +59,7 @@ public class ClientLODComponent implements BehaviorTree {
CommonEntityType type = CommonEntityUtils.getCommonData(this.parent); CommonEntityType type = CommonEntityUtils.getCommonData(this.parent);
if(type.getCollidable() != null && PhysicsEntityUtils.getCollidable(this.parent) == null){ if(type.getCollidable() != null && PhysicsEntityUtils.getCollidable(this.parent) == null){
PhysicsEntityUtils.clientAttachCollidableTemplate(parent, type.getCollidable()); PhysicsEntityUtils.clientAttachCollidableTemplate(parent, type.getCollidable());
ClientEntityUtils.reositionEntity(parent, EntityUtils.getPosition(parent), EntityUtils.getRotation(parent));
} }
} else if(cachedLodLevel == ServerLODComponent.LOW_RES){ } else if(cachedLodLevel == ServerLODComponent.LOW_RES){
if(PhysicsEntityUtils.containsDBody(this.parent)){ if(PhysicsEntityUtils.containsDBody(this.parent)){