Fixed some crawling unit visual issues

This commit is contained in:
Anuken
2023-09-14 00:50:30 -04:00
parent cf503c0efc
commit 8c93fb5f10
@@ -63,7 +63,7 @@ abstract class CrawlComp implements Posc, Rotc, Hitboxc, Unitc{
@Override @Override
public void update(){ public void update(){
if(moving()){ if(moving()){
segmentRot = Angles.moveToward(segmentRot, rotation, type.segmentRotSpeed); segmentRot = Angles.moveToward(segmentRot, rotation, type.segmentRotSpeed * Time.delta);
int radius = (int)Math.max(0, hitSize / tilesize * 2f); int radius = (int)Math.max(0, hitSize / tilesize * 2f);
int count = 0, solids = 0, deeps = 0; int count = 0, solids = 0, deeps = 0;
@@ -106,10 +106,10 @@ abstract class CrawlComp implements Posc, Rotc, Hitboxc, Unitc{
lastDeepFloor = null; lastDeepFloor = null;
} }
lastCrawlSlowdown = Mathf.lerp(1f, type.crawlSlowdown, Mathf.clamp((float)solids / count / type.crawlSlowdownFrac)); lastCrawlSlowdown = Mathf.lerpDelta(1f, type.crawlSlowdown, Mathf.clamp((float)solids / count / type.crawlSlowdownFrac));
} }
segmentRot = Angles.clampRange(segmentRot, rotation, type.segmentMaxRot); segmentRot = Angles.clampRange(segmentRot, rotation, type.segmentMaxRot);
crawlTime += vel.len(); crawlTime += vel.len() * Time.delta;
} }
} }