small bugfixes
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-04-03 18:36:15 -04:00
parent 3379f5ca26
commit 86344ebfeb
4 changed files with 44 additions and 25 deletions

View File

@ -429,12 +429,14 @@ public class ServerAttackTree implements BehaviorTree {
this.stateTransitionUtil.simulate(AttackTreeState.BLOCK_RECOIL);
//deactivate hitboxes
List<Entity> attachedEntities = AttachUtils.getChildrenList(parent);
if(attachedEntities != null){
for(Entity currentAttached : attachedEntities){
if(HitboxCollectionState.hasHitboxState(currentAttached)){
HitboxCollectionState currentState = HitboxCollectionState.getHitboxState(currentAttached);
currentState.setActive(false);
}
}
}
if(this.currentMove.getActiveBones() != null && HitboxCollectionState.hasHitboxState(this.parent)){
HitboxCollectionState hitboxCollectionState = HitboxCollectionState.getHitboxState(this.parent);
for(String boneName : this.currentMove.getActiveBones()){
@ -451,12 +453,14 @@ public class ServerAttackTree implements BehaviorTree {
this.stateTransitionUtil.simulate(AttackTreeState.COOLDOWN);
//deactive hitboxes
List<Entity> attachedEntities = AttachUtils.getChildrenList(parent);
if(attachedEntities != null){
for(Entity currentAttached : attachedEntities){
if(HitboxCollectionState.hasHitboxState(currentAttached)){
HitboxCollectionState currentState = HitboxCollectionState.getHitboxState(currentAttached);
currentState.setActive(false);
}
}
}
if(this.currentMove.getActiveBones() != null && HitboxCollectionState.hasHitboxState(this.parent)){
HitboxCollectionState hitboxCollectionState = HitboxCollectionState.getHitboxState(this.parent);
for(String boneName : this.currentMove.getActiveBones()){

View File

@ -606,9 +606,8 @@ public class GriddedDataCellManager implements DataCellManager, VoxelCellManager
public void simulate(){
Globals.profiler.beginCpuSample("GriddedDataCellManager.simulate");
loadedCellsLock.lock();
Collection<ServerDataCell> groundCells = this.groundDataCells.values();
boolean runMicroSim = Globals.microSimulation != null && Globals.microSimulation.isReady();
for(ServerDataCell cell : groundCells){
for(ServerDataCell cell : this.groundDataCells.values()){
if(runMicroSim && this.shouldSimulate(cell)){
Globals.microSimulation.simulate(cell);
}

View File

@ -96,11 +96,6 @@ public class PoseActor {
for(ActorAnimationMask mask : toRemoveMasks){
animationQueue.remove(mask);
}
PoseModel model = Globals.assetManager.fetchPoseModel(modelPath);
if(model != null){
this.applyAnimationMasks(model);
this.calculateNodeTransforms(model);
}
}
/**
@ -392,6 +387,17 @@ public class PoseActor {
}
}
/**
* Updates the transform cache for this actor
*/
public void updateTransformCache(){
PoseModel model = Globals.assetManager.fetchPoseModel(modelPath);
if(model != null){
this.applyAnimationMasks(model);
this.calculateNodeTransforms(model);
}
}
/**
* Sets the animation scalar
* @param animationScalar The new animation scalar value

View File

@ -66,6 +66,16 @@ public class MicroSimulation {
for(Entity collidable : collidables){
ServerCollidableTree.getServerCollidableTree(collidable).simulate((float)Globals.timekeeper.getSimFrameTime());
}
//update actor transform caches
poseableEntities = dataCell.getScene().getEntitiesWithTag(EntityTags.POSEABLE);
if(poseableEntities != null){
for(Entity currentEntity : dataCell.getScene().getEntitiesWithTag(EntityTags.POSEABLE)){
//fetch actor
PoseActor currentPoseActor = EntityUtils.getPoseActor(currentEntity);
currentPoseActor.updateTransformCache();
}
}
}
Globals.profiler.endCpuSample();
}