还是优化动画代码

This commit is contained in:
Atsuihsio 2024-10-30 01:06:17 +08:00
parent 428ea24dea
commit 41dd80747c
2 changed files with 9 additions and 7 deletions

View file

@ -132,7 +132,7 @@ public class M4ItemModel extends GeoModel<M4Item> {
crossAlt.setPosY(-0.2f * (float) fpz); crossAlt.setPosY(-0.2f * (float) fpz);
cross3.setPosY(-0.2f * (float) fpz); cross3.setPosY(-0.2f * (float) fpz);
shen.setPosX((float) (shen.getPosX() * (1 - 0.5 * zt))); shen.setPosX((float) (shen.getPosX() * (1 - 0.8 * zt)));
shen.setPosY((float) (shen.getPosY() * (-1 + 0.8 * zt))); shen.setPosY((float) (shen.getPosY() * (-1 + 0.8 * zt)));
shen.setPosZ((float) (shen.getPosZ() * (1 - 0.6 * zt))); shen.setPosZ((float) (shen.getPosZ() * (1 - 0.6 * zt)));
shen.setRotX((float) (shen.getRotX() * (1 - (type == 3 ? 0.96 : type == 1 ? 0.4 : 0.9) * zt))); shen.setRotX((float) (shen.getRotX() * (1 - (type == 3 ? 0.96 : type == 1 ? 0.4 : 0.9) * zt)));

View file

@ -186,11 +186,13 @@ public class ClientEventHandler {
double spread = stack.is(ModTags.Items.SHOTGUN) || stack.is(ModItems.MINIGUN.get()) ? 1.2 * zoomSpread * (basicDev + 0.2 * (walk + sprint + crouching + prone + jump + ride) + fireSpread) : zoomSpread * (0.7 * basicDev + walk + sprint + crouching + prone + jump + ride + 0.8 * fireSpread); double spread = stack.is(ModTags.Items.SHOTGUN) || stack.is(ModItems.MINIGUN.get()) ? 1.2 * zoomSpread * (basicDev + 0.2 * (walk + sprint + crouching + prone + jump + ride) + fireSpread) : zoomSpread * (0.7 * basicDev + walk + sprint + crouching + prone + jump + ride + 0.8 * fireSpread);
if (gunSpread < spread) { // if (gunSpread < spread) {
gunSpread += 0.07 * Math.pow(spread - gunSpread, 2) * times; // gunSpread += 0.07 * Math.pow(spread - gunSpread, 2) * times;
} else { // } else {
gunSpread -= 0.07 * Math.pow(spread - gunSpread, 2) * times; // gunSpread -= 0.07 * Math.pow(spread - gunSpread, 2) * times;
} // }
gunSpread = Mth.lerp(0.07 * times, gunSpread, spread);
// 开火部分 // 开火部分
double weight = stack.getOrCreateTag().getDouble("weight") + stack.getOrCreateTag().getDouble("CustomWeight"); double weight = stack.getOrCreateTag().getDouble("weight") + stack.getOrCreateTag().getDouble("CustomWeight");
@ -786,7 +788,7 @@ public class ClientEventHandler {
p = zoomPos; p = zoomPos;
} }
customZoom = Mth.lerp(0.5 * times, customZoom, stack.getOrCreateTag().getDouble("CustomZoom")); customZoom = Mth.lerp(0.6 * times, customZoom, stack.getOrCreateTag().getDouble("CustomZoom"));
double zoom = 1.25 + customZoom; double zoom = 1.25 + customZoom;