优化动画
This commit is contained in:
parent
83db870bc0
commit
62963a36d3
35 changed files with 79 additions and 62 deletions
|
@ -70,7 +70,7 @@ public class AK47ItemModel extends GeoModel<AK47Item> {
|
|||
if (GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) == GLFW.GLFW_PRESS) {
|
||||
shen.setPosY(-0.01f * (float) (fp + 2 * fr));
|
||||
shen.setPosZ(0.2f * (float) (fp + 0.54f * fr));
|
||||
shen.setRotX(0.003f * (float) (fp + fr));
|
||||
shen.setRotX(0.007f * (float) (fp + fr));
|
||||
shen.setRotZ(0f);
|
||||
} else {
|
||||
shen.setPosY(-0.03f * (float) (fp + 2 * fr));
|
||||
|
@ -78,7 +78,7 @@ public class AK47ItemModel extends GeoModel<AK47Item> {
|
|||
shen.setRotX(0.07f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float) fr * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.25 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
shuan.setPosZ(2.4f * (float) fp);
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ public class Aa12ItemModel extends GeoModel<Aa12Item> {
|
|||
shen.setRotX(0.07f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float) fr * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||
CoreGeoBone move = getAnimationProcessor().getBone("move");
|
||||
|
|
|
@ -64,7 +64,7 @@ public class AbekiriItemModel extends GeoModel<AbekiriItem> {
|
|||
|
||||
gun.setRotZ((float) (0.05f * zpz));
|
||||
|
||||
shen.setPosX(-0.2f * (float) (fp + 2 * fr));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
shen.setPosY(0.2f * (float) (fp + 2 * fr));
|
||||
shen.setPosZ(4.2f * (float) (1.3 * fp + 0.54f * fr));
|
||||
shen.setRotX(0.25f * (float) (1.28f * fp + fr));
|
||||
|
|
|
@ -114,6 +114,7 @@ public class BocekItemModel extends GeoModel<BocekItem> {
|
|||
fire.setRotX(0.07f * (float) (0.18f * fp + fr));
|
||||
fire.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
fire.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||
CoreGeoBone move = getAnimationProcessor().getBone("move");
|
||||
|
|
|
@ -91,7 +91,7 @@ public class DevotionItemModel extends GeoModel<DevotionItem> {
|
|||
shen.setRotX(0.02f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
bolt.setPosZ(-2f * (float) fp);
|
||||
|
||||
CoreGeoBone n0 = getAnimationProcessor().getBone("00");
|
||||
|
|
|
@ -80,7 +80,7 @@ public class Glock17ItemModel extends GeoModel<Glock17Item> {
|
|||
shen.setRotY(0.1f * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.7f * (float) fr * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
slide.setPosZ(1.5f * (float) fp);
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ public class Glock18ItemModel extends GeoModel<Glock18Item> {
|
|||
shen.setRotY(0.1f * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.7f * (float) fr * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
slide.setPosZ(1.5f * (float) fp);
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public class Hk416ItemModel extends GeoModel<Hk416Item> {
|
|||
if (GLFW.glfwGetMouseButton(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_MOUSE_BUTTON_RIGHT) == GLFW.GLFW_PRESS) {
|
||||
shen.setPosY(-0.01f * (float) (fp + 2 * fr));
|
||||
shen.setPosZ(1.2f * (float) (fp + 0.54f * fr));
|
||||
shen.setRotX(0.003f * (float) (fp + fr));
|
||||
shen.setRotX(0.007f * (float) (fp + fr));
|
||||
shen.setRotZ(0f);
|
||||
} else {
|
||||
shen.setPosY(-0.03f * (float) (fp + 2 * fr));
|
||||
|
@ -77,7 +77,7 @@ public class Hk416ItemModel extends GeoModel<Hk416Item> {
|
|||
shen.setRotX(0.07f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||
CoreGeoBone move = getAnimationProcessor().getBone("move");
|
||||
|
|
|
@ -65,7 +65,7 @@ public class HuntingRifleItemModel extends GeoModel<HuntingRifleItem> {
|
|||
|
||||
gun.setScaleZ(1f - (0.5f * (float) zp));
|
||||
|
||||
shen.setPosX(-0.05f * (float) (fp + 0.2 * fr));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
shen.setPosY(0.3f * (float) (fp + 2 * fr));
|
||||
shen.setPosZ(4.2f * (float) (1.3 * fp + 0.54f * fr));
|
||||
shen.setRotX(0.06f * (float) (1.28f * fp + fr));
|
||||
|
|
|
@ -68,7 +68,7 @@ public class JavelinItemModel extends GeoModel<JavelinItem> {
|
|||
shen.setPosZ(3.8f * (float) (fp + 0.54f * fr));
|
||||
shen.setRotX(0.17f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
shen.setPosX((float)(0.75f * fr * ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||
CoreGeoBone move = getAnimationProcessor().getBone("move");
|
||||
|
|
|
@ -84,7 +84,7 @@ public class K98ItemModel extends GeoModel<K98Item> {
|
|||
shen.setRotX(0.17f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
|
||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||
|
|
|
@ -78,7 +78,7 @@ public class M1911ItemModel extends GeoModel<M1911Item> {
|
|||
shen.setRotY(0.1f * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.7f * (float) fr * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
slide.setPosZ(2.75f * (float) fp);
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ public class M4ItemModel extends GeoModel<M4Item> {
|
|||
shen.setRotX(0.03f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||
CoreGeoBone move = getAnimationProcessor().getBone("move");
|
||||
|
|
|
@ -120,7 +120,7 @@ public class M60ItemModel extends GeoModel<M60Item> {
|
|||
shen.setRotX(0.04f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
tiba.setRotZ((float) (-0.25f * fp + 0.4 * fr));
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public class M79ItemModel extends GeoModel<M79Item> {
|
|||
shen.setRotX(0.1f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||
CoreGeoBone move = getAnimationProcessor().getBone("move");
|
||||
|
|
|
@ -77,7 +77,7 @@ public class M870ItemModel extends GeoModel<M870Item> {
|
|||
shen.setRotX(0.3f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float) fr * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
|
||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||
|
|
|
@ -71,7 +71,7 @@ public class M98bItemModel extends GeoModel<M98bItem> {
|
|||
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
scope.setPosZ(75.2f * (float) (fp + 0.54f * fr));
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
gun.setPosX(2.245f * (float) zp);
|
||||
gun.setPosY(0.3f * (float) zp - (float) (0.2f * zpz));
|
||||
|
|
|
@ -66,7 +66,7 @@ public class MarlinItemModel extends GeoModel<MarlinItem> {
|
|||
|
||||
gun.setScaleZ(1f - (0.5f * (float) zp));
|
||||
|
||||
shen.setPosX(-0.2f * (float) (fp + 2 * fr));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
shen.setPosY(0.4f * (float) (fp + 2 * fr));
|
||||
shen.setPosZ(1.9f * (float) (1.3 * fp + 0.54f * fr));
|
||||
shen.setRotX(0.085f * (float) (1.28f * fp + fr));
|
||||
|
|
|
@ -69,7 +69,7 @@ public class MinigunItemModel extends GeoModel<MinigunItem> {
|
|||
shen.setPosZ(2.2f * (float) (0.5 * fp + 1.54f * fr));
|
||||
shen.setRotX(0.05f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.02f * (float) (fp + 1.3 * fr));
|
||||
shen.setPosX(0.5f * (float) fr * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||
CoreGeoBone move = getAnimationProcessor().getBone("move");
|
||||
|
|
|
@ -100,7 +100,7 @@ public class Mk14ItemModel extends GeoModel<Mk14Item> {
|
|||
|
||||
rex.setPosY(-0.23f * (float) (fp + 2.3 * fr));
|
||||
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
action.setPosZ(2.5f * (float) fp);
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ public class MosinNagantItemModel extends GeoModel<MosinNagantItem> {
|
|||
shen.setRotX(0.17f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX((float)(0.75f * fr * ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
rex.setPosY(0.05f + 0.1f * (float) fp);
|
||||
rex.setRotZ((float) (-0.08f * fp * ClientEventHandler.recoilHorizon * fp));
|
||||
|
|
|
@ -78,7 +78,7 @@ public class Ntw20Model extends GeoModel<Ntw20Item> {
|
|||
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
gun.setPosX(4.54f * (float) zp);
|
||||
gun.setPosY(-0.45f * (float) zp - (float) (0.2f * zpz));
|
||||
gun.setPosZ(10.0f * (float) zp + (float) (0.3f * zpz));
|
||||
|
|
|
@ -76,7 +76,7 @@ public class Qbz95ItemModel extends GeoModel<Qbz95Item> {
|
|||
shen.setRotX(0.07f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
bolt.setPosZ(5f * (float) fp);
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public class RpgItemModel extends GeoModel<RpgItem> {
|
|||
shen.setRotX(0.07f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
gun.setPosX(0.91f * (float) zp);
|
||||
gun.setPosY(-0.04f * (float) zp - (float) (0.2f * zpz));
|
||||
|
|
|
@ -92,7 +92,7 @@ public class RpkItemModel extends GeoModel<RpkItem> {
|
|||
shen.setRotX(0.04f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
shuan.setPosZ(2.4f * (float) fp);
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ public class SentinelItemModel extends GeoModel<SentinelItem> {
|
|||
shen.setRotX(0.15f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float) fr * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
CoreGeoBone charge = getAnimationProcessor().getBone("charge");
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ public class SksItemModel extends GeoModel<SksItem> {
|
|||
shen.setRotX(0.07f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
shuan.setPosZ(2f * (float) fp);
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public class SvdItemModel extends GeoModel<SvdItem> {
|
|||
shen.setRotX(0.07f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.04f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float)fr * (float)(ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
holo.setPosY(0.05f + 1.1f * (float) fp);
|
||||
holo.setRotZ(-0.04f * (float) fp);
|
||||
holo.setScaleX(0.75f);
|
||||
|
|
|
@ -89,7 +89,7 @@ public class TaserItemModel extends GeoModel<TaserItem> {
|
|||
redcover.setScaleZ(1);
|
||||
}
|
||||
|
||||
shen.setPosX(-0.05f * (float) (fp + 0.2 * fr));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
shen.setPosY(0.1f * (float) (fp + 2 * fr));
|
||||
shen.setPosZ(1.2f * (float) (1.3 * fp + 0.54f * fr));
|
||||
shen.setRotX(0.04f * (float) (1.28f * fp + fr));
|
||||
|
|
|
@ -65,7 +65,7 @@ public class TracheliumItemModel extends GeoModel<Trachelium> {
|
|||
|
||||
gun.setScaleZ(1f - (0.2f * (float) zp));
|
||||
|
||||
shen.setPosX(-0.4f * (float) (fp + 0.2 * fr));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
shen.setPosY(0.6f * (float) (fp + 2 * fr));
|
||||
shen.setPosZ(4.2f * (float) (1.3 * fp + 0.54f * fr));
|
||||
shen.setRotX(0.18f * (float) (1.28f * fp + fr));
|
||||
|
|
|
@ -86,14 +86,14 @@ public class VectorItemModel extends GeoModel<VectorItem> {
|
|||
shen.setPosY(0.05f * (float) (fp + 2 * fr));
|
||||
holo.setPosY(-0.43f * (float) (fp + 2.3 * fr));
|
||||
shen.setPosZ(0.9f * (float) (fp + 0.54f * fr));
|
||||
shen.setRotX(0.006f * (float) (fp + fr));
|
||||
shen.setRotX(0.01f * (float) (fp + fr));
|
||||
} else {
|
||||
shen.setPosY(0.08f * (float) (fp + 2 * fr));
|
||||
shen.setPosZ(0.9f * (float) (fp + 0.54f * fr));
|
||||
shen.setRotX(0.03f * (float) (0.18f * fp + fr));
|
||||
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
|
||||
}
|
||||
shen.setPosX(0.5f * (float) fr * (float) (ClientEventHandler.recoilHorizon * fp));
|
||||
shen.setPosX(0.2f * (float) (ClientEventHandler.recoilHorizon * (0.5 + 0.4 * ClientEventHandler.fireSpread)));
|
||||
|
||||
CoreGeoBone root = getAnimationProcessor().getBone("root");
|
||||
CoreGeoBone move = getAnimationProcessor().getBone("move");
|
||||
|
|
|
@ -19,6 +19,7 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.player.LocalPlayer;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
|
@ -77,6 +78,10 @@ public class ClientEventHandler {
|
|||
public static double recoilTime = 0;
|
||||
|
||||
public static double recoilHorizon = 0;
|
||||
|
||||
public static boolean recoil = false;
|
||||
|
||||
public static double recoilY = 0;
|
||||
public static double droneCameraRotX = 0;
|
||||
public static double droneCameraRotY = 0;
|
||||
public static double droneRotX = 0;
|
||||
|
@ -110,7 +115,7 @@ public class ClientEventHandler {
|
|||
float xRot = player.getViewXRot(event.getPartialTick()) - xRotOffset;
|
||||
float yRot = player.getViewYRot(event.getPartialTick()) - yRotOffset;
|
||||
turnRot[0] = Mth.clamp(0.05 * xRot, -5, 5) * (1 - 0.75 * zoomTime);
|
||||
turnRot[1] = Mth.clamp(0.05 * yRot, -10, 10) * (1 - 0.75 * zoomTime);
|
||||
turnRot[1] = Mth.clamp(0.05 * yRot, -10, 10) * (1 - 0.75 * zoomTime) + 1.5f * (Mth.DEG_TO_RAD * recoilHorizon) * (0.5 + 0.4 * fireSpread);
|
||||
turnRot[2] = Mth.clamp(0.1 * yRot, -10, 10) * (1 - zoomTime);
|
||||
|
||||
droneCameraRotX = Mth.clamp(0.25f * xRot, -10, 10);
|
||||
|
@ -358,8 +363,10 @@ public class ClientEventHandler {
|
|||
} else {
|
||||
pose = 1;
|
||||
}
|
||||
if (fireRecoilTime == 0) {
|
||||
swayTime += 0.05 * times;
|
||||
}
|
||||
|
||||
swayTime += 0.05 * times;
|
||||
swayX = pose * -0.008 * Math.sin(swayTime) * (1 - 0.95 * zoomTime);
|
||||
swayY = pose * 0.125 * Math.sin(swayTime - 1.585) * (1 - 0.95 * zoomTime) - 3 * moveRotZ;
|
||||
}
|
||||
|
@ -484,9 +491,7 @@ public class ClientEventHandler {
|
|||
fireRotTimer = 0.001;
|
||||
firePosZ = 0.1;
|
||||
fireRecoilTime -= 7 * times;
|
||||
recoilHorizon = 2 * Math.random() - 1;
|
||||
fireSpread += 0.1;
|
||||
recoilTime = 0.01;
|
||||
}
|
||||
|
||||
fireSpread = Mth.clamp(fireSpread - 0.1 * (Math.pow(fireSpread, 2) * times), 0, 100);
|
||||
|
@ -508,11 +513,11 @@ public class ClientEventHandler {
|
|||
|
||||
if (0 < fireRotTimer && fireRotTimer < 1.732) {
|
||||
fireRot = 1 / 6.3 * (fireRotTimer - 0.5) * Math.sin(6.3 * (fireRotTimer - 0.5)) * (3 - Math.pow(fireRotTimer, 2));
|
||||
if (recoilHorizon > 0) {
|
||||
if (recoilY> 0) {
|
||||
event.setYaw((float) (yaw - 1.3 * amplitude * (1 / 6.3 * (fireRotTimer - 0.5)) * Math.sin(6.3 * (fireRotTimer - 0.5)) * (3 - Math.pow(fireRotTimer, 2)) + 1 * Mth.clamp(0.3 - fireRotTimer, 0, 1) * (2 * Math.random() - 1)));
|
||||
event.setPitch((float) (pitch + 1.3 * amplitude * (1 / 6.3 * (fireRotTimer - 0.5)) * Math.sin(6.3 * (fireRotTimer - 0.5)) * (3 - Math.pow(fireRotTimer, 2)) + 1 * Mth.clamp(0.3 - fireRotTimer, 0, 1) * (2 * Math.random() - 1)));
|
||||
event.setRoll((float) (roll + 4.2 * amplitude * (1 / 6.3 * (fireRotTimer - 0.5)) * Math.sin(6.3 * (fireRotTimer - 0.5)) * (3 - Math.pow(fireRotTimer, 2)) + 3 * Mth.clamp(0.5 - fireRotTimer, 0, 0.5) * (2 * Math.random() - 1)));
|
||||
} else if (recoilHorizon <= 0) {
|
||||
} else if (recoilY <= 0) {
|
||||
event.setYaw((float) (yaw + 1.3 * amplitude * (1 / 6.3 * (fireRotTimer - 0.5)) * Math.sin(6.3 * (fireRotTimer - 0.5)) * (3 - Math.pow(fireRotTimer, 2)) + 1 * Mth.clamp(0.3 - fireRotTimer, 0, 1) * (2 * Math.random() - 1)));
|
||||
event.setPitch((float) (pitch - 1.3 * amplitude * (1 / 6.3 * (fireRotTimer - 0.5)) * Math.sin(6.3 * (fireRotTimer - 0.5)) * (3 - Math.pow(fireRotTimer, 2)) + 1 * Mth.clamp(0.3 - fireRotTimer, 0, 1) * (2 * Math.random() - 1)));
|
||||
event.setRoll((float) (roll - 4.2 * amplitude * (1 / 6.3 * (fireRotTimer - 0.5)) * Math.sin(6.3 * (fireRotTimer - 0.5)) * (3 - Math.pow(fireRotTimer, 2)) + 3 * Mth.clamp(0.5 - fireRotTimer, 0, 0.5) * (2 * Math.random() - 1)));
|
||||
|
@ -535,36 +540,51 @@ public class ClientEventHandler {
|
|||
|
||||
CompoundTag tag = player.getMainHandItem().getOrCreateTag();
|
||||
float times = Minecraft.getInstance().getDeltaFrameTime();
|
||||
float recoilX = (float) tag.getDouble("recoil_x");
|
||||
float recoilY = (float) tag.getDouble("recoil_y");
|
||||
float recoilPitch = 50f;
|
||||
float recoilYaw = 25f;
|
||||
float gunRecoilX = (float) tag.getDouble("recoil_x") * 80;
|
||||
float gunRecoilY = (float) tag.getDouble("recoil_y") * 60;
|
||||
|
||||
if (fireRecoilTime > 0) {
|
||||
recoil = true;
|
||||
}
|
||||
|
||||
if (recoil) {
|
||||
recoilTime = 0.01;
|
||||
recoilY = (float) (2 * Math.random() - 1) * gunRecoilY;
|
||||
recoil = false;
|
||||
}
|
||||
|
||||
if (recoilHorizon > 0) {
|
||||
recoilHorizon -= (4 * Math.pow(recoilHorizon, 2) + recoilY) * times;
|
||||
} else {
|
||||
recoilHorizon += (4 * Math.pow(recoilHorizon, 2) + recoilY) * times;
|
||||
}
|
||||
recoilY = 0;
|
||||
|
||||
player.displayClientMessage(Component.literal(new java.text.DecimalFormat("##.##").format(recoilY) + " " + new java.text.DecimalFormat("##.#").format(recoilHorizon)), true);
|
||||
|
||||
/*
|
||||
计算后坐力
|
||||
*/
|
||||
|
||||
float rx, ry;
|
||||
float pose = 1;
|
||||
if (player.isShiftKeyDown() && player.getBbHeight() >= 1 && !isProne(player)) {
|
||||
rx = 0.7f;
|
||||
ry = 0.8f;
|
||||
pose = 0.7f;
|
||||
} else if (isProne(player)) {
|
||||
if (tag.getDouble("bipod") == 1) {
|
||||
rx = 0.05f;
|
||||
ry = 0.1f;
|
||||
pose = 0.1f;
|
||||
} else {
|
||||
rx = 0.5f;
|
||||
ry = 0.7f;
|
||||
pose = 0.5f;
|
||||
}
|
||||
} else {
|
||||
rx = 1f;
|
||||
ry = 1f;
|
||||
}
|
||||
|
||||
float newYaw = (float) (player.getYRot() - 0.6 * recoilHorizon * pose * times * (0.5 + fireSpread));
|
||||
player.setYRot(newYaw);
|
||||
player.yRotO = player.getYRot();
|
||||
|
||||
double sinRes = 0;
|
||||
|
||||
if (0 < recoilTime && recoilTime < 0.5) {
|
||||
float newPitch = player.getXRot() - 0.02f * ry * times;
|
||||
float newPitch = player.getXRot() - 0.02f * gunRecoilX * times;
|
||||
player.setXRot(newPitch);
|
||||
player.xRotO = player.getXRot();
|
||||
}
|
||||
|
@ -580,13 +600,9 @@ public class ClientEventHandler {
|
|||
}
|
||||
|
||||
if (0 < recoilTime && recoilTime < 2.5) {
|
||||
float newPitch = (float) (player.getXRot() - recoilPitch * recoilY * ry * (sinRes + Mth.clamp(0.5 - recoilTime, 0, 0.5)) * times * (0.7 + fireSpread));
|
||||
float newPitch = (float) (player.getXRot() - 1.5 * gunRecoilX * (sinRes + Mth.clamp(0.5 - recoilTime, 0, 0.5)) * times * (0.5 + fireSpread));
|
||||
player.setXRot(newPitch);
|
||||
player.xRotO = player.getXRot();
|
||||
|
||||
float newYaw = (float) (player.getYRot() - recoilYaw * recoilHorizon * recoilX * rx * sinRes * times - 100 * recoilHorizon * firePos * recoilX * rx * times * (0.7 + fireSpread));
|
||||
player.setYRot(newYaw);
|
||||
player.yRotO = player.getYRot();
|
||||
}
|
||||
|
||||
if (recoilTime >= 2.5) recoilTime = 0d;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"zoom_speed": 1.1,
|
||||
"zoom": 1.25,
|
||||
"spread": 4,
|
||||
"recoil_x": 0.0025,
|
||||
"recoil_x": 0.002,
|
||||
"recoil_y": 0.012,
|
||||
"damage": 8.5,
|
||||
"headshot": 2,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"zoom": 1.25,
|
||||
"spread": 5.5,
|
||||
"bipod": 1,
|
||||
"recoil_x": 0.0035,
|
||||
"recoil_x": 0.0018,
|
||||
"recoil_y": 0.012,
|
||||
"damage": 8.75,
|
||||
"headshot": 2,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"zoom_speed": 1.6,
|
||||
"zoom": 1.25,
|
||||
"spread": 2.3,
|
||||
"recoil_x": 0.007,
|
||||
"recoil_x": 0.002,
|
||||
"recoil_y": 0.007,
|
||||
"damage": 6,
|
||||
"headshot": 1.5,
|
||||
|
|
Loading…
Add table
Reference in a new issue