适配换弹屏幕抖动
This commit is contained in:
parent
9061c74513
commit
e6e6f69e58
37 changed files with 44 additions and 40 deletions
|
@ -148,7 +148,7 @@ public class AK12ItemModel extends GeoModel<AK12Item> {
|
|||
float numP = (float) (1 - 0.8 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 1f, 0.35f);
|
||||
data.save();
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ public class AK47ItemModel extends GeoModel<AK47Item> {
|
|||
float numP = (float) (1 - 0.92 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 1f, 0.35f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class Aa12ItemModel extends GeoModel<Aa12Item> {
|
|||
float numP = (float) (1 - 0.68 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 1f, 0.55f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public class BocekItemModel extends GeoModel<BocekItem> {
|
|||
ClientEventHandler.gunRootMove(getAnimationProcessor());
|
||||
|
||||
GeoBone camera = getAnimationProcessor().getBone("camera");
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
|
||||
public static void wingControl(GeoBone GeoBone, float m) {
|
||||
|
|
|
@ -95,7 +95,7 @@ public class DevotionItemModel extends GeoModel<DevotionItem> {
|
|||
float numP = (float) (1 - 0.78 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 1f, 0.55f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ public class Glock17ItemModel extends GeoModel<Glock17Item> {
|
|||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 0.7f, 1f);
|
||||
|
||||
GeoBone shell = getAnimationProcessor().getBone("shell");
|
||||
|
|
|
@ -117,7 +117,7 @@ public class Glock18ItemModel extends GeoModel<Glock18Item> {
|
|||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 0.7f, 1f);
|
||||
|
||||
GeoBone shell = getAnimationProcessor().getBone("shell");
|
||||
|
|
|
@ -147,7 +147,7 @@ public class Hk416ItemModel extends GeoModel<Hk416Item> {
|
|||
float numP = (float) (1 - 0.92 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 1f, 0.55f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,6 +77,6 @@ public class HomemadeShotgunItemModel extends GeoModel<HomemadeShotgunItem> {
|
|||
float numP = (float) (1 - 0.48 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,6 +86,6 @@ public class HuntingRifleItemModel extends GeoModel<HuntingRifleItem> {
|
|||
float numP = (float) (1 - 0.78 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,6 +87,6 @@ public class InsidiousItemModel extends GeoModel<InsidiousItem> {
|
|||
float numP = (float) (1 - 0.92 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,6 +70,6 @@ public class JavelinItemModel extends GeoModel<JavelinItem> {
|
|||
ClientEventHandler.gunRootMove(getAnimationProcessor());
|
||||
|
||||
GeoBone camera = getAnimationProcessor().getBone("camera");
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,6 +110,6 @@ public class K98ItemModel extends GeoModel<K98Item> {
|
|||
camera.setRotY(numR * camera.getRotY());
|
||||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,6 @@ public class LungeMineModel extends GeoModel<LungeMine> {
|
|||
@Override
|
||||
public void setCustomAnimations(LungeMine animatable, long instanceId, AnimationState animationState) {
|
||||
GeoBone camera = getAnimationProcessor().getBone("camera");
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ public class M1911ItemModel extends GeoModel<M1911Item> {
|
|||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 0.7f, 1f);
|
||||
GeoBone shell = getAnimationProcessor().getBone("shell");
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ public class M4ItemModel extends GeoModel<M4Item> {
|
|||
float numP = (float) (1 - 0.92 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 1f, 0.55f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,6 +156,6 @@ public class M60ItemModel extends GeoModel<M60Item> {
|
|||
shell.setScaleY(1);
|
||||
shell.setScaleZ(1);
|
||||
}
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,6 +84,6 @@ public class M79ItemModel extends GeoModel<M79Item> {
|
|||
float numP = (float) (1 - 0.58 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,6 +96,6 @@ public class M870ItemModel extends GeoModel<M870Item> {
|
|||
camera.setRotY(numR * camera.getRotY());
|
||||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,6 +102,6 @@ public class M98bItemModel extends GeoModel<M98bItem> {
|
|||
scope.setPosY(numP * scope.getPosY());
|
||||
scope.setPosZ(numP * scope.getPosZ());
|
||||
}
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,6 +97,6 @@ public class MarlinItemModel extends GeoModel<MarlinItem> {
|
|||
camera.setRotY(numR * camera.getRotY());
|
||||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,6 +65,6 @@ public class MinigunItemModel extends GeoModel<MinigunItem> {
|
|||
ClientEventHandler.gunRootMove(getAnimationProcessor());
|
||||
|
||||
GeoBone camera = getAnimationProcessor().getBone("camera");
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ public class Mk14ItemModel extends GeoModel<Mk14Item> {
|
|||
r.setRotX(rotXBipod * Mth.DEG_TO_RAD);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 1.2f, 0.55f);
|
||||
|
||||
GeoBone shell = getAnimationProcessor().getBone("shell");
|
||||
|
|
|
@ -118,6 +118,6 @@ public class MosinNagantItemModel extends GeoModel<MosinNagantItem> {
|
|||
camera.setRotY(numR * camera.getRotY());
|
||||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public class Mp443ItemModel extends GeoModel<Mp443Item> {
|
|||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 0.7f, 1f);
|
||||
|
||||
GeoBone shell = getAnimationProcessor().getBone("shell");
|
||||
|
|
|
@ -154,6 +154,6 @@ public class Ntw20Model extends GeoModel<Ntw20Item> {
|
|||
camera.setRotY(numR * camera.getRotY());
|
||||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,6 +189,6 @@ public class Qbz95ItemModel extends GeoModel<Qbz95Item> {
|
|||
}
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,6 +89,6 @@ public class RpgItemModel extends GeoModel<RpgItem> {
|
|||
float numP = (float) (1 - 0.78 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ public class RpkItemModel extends GeoModel<RpkItem> {
|
|||
float numP = (float) (1 - 0.92 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 1f, 0.35f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,6 +98,6 @@ public class SecondaryCataclysmModel extends GeoModel<SecondaryCataclysm> {
|
|||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,6 +108,6 @@ public class SentinelItemModel extends GeoModel<SentinelItem> {
|
|||
camera.setRotY(numR * camera.getRotY());
|
||||
camera.setRotZ(numR * camera.getRotZ());
|
||||
}
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public class SksItemModel extends GeoModel<SksItem> {
|
|||
float numP = (float) (1 - 0.88 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 0.7f, 1.2f);
|
||||
GeoBone shell = getAnimationProcessor().getBone("shell");
|
||||
|
|
|
@ -153,7 +153,7 @@ public class SvdItemModel extends GeoModel<SvdItem> {
|
|||
float numP = (float) (1 - 0.9 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 1f, 0.65f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,6 +81,6 @@ public class TaserItemModel extends GeoModel<TaserItem> {
|
|||
float numP = (float) (1 - 0.68 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ public class TracheliumItemModel extends GeoModel<Trachelium> {
|
|||
float numP = (float) (1 - 0.48 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
|
||||
barrel1.setPosZ((scopeType == 0 && gripType == 0) ? 17.9f : 0);
|
||||
barrel2.setPosZ((scopeType == 0 && gripType == 0) ? 15.3f : 3);
|
||||
|
|
|
@ -139,7 +139,7 @@ public class VectorItemModel extends GeoModel<VectorItem> {
|
|||
float numP = (float) (1 - 0.88 * zt);
|
||||
|
||||
AnimationHelper.handleReloadShakeAnimation(stack, main, camera, numR, numP);
|
||||
ClientEventHandler.shake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
ClientEventHandler.handleReloadShake(Mth.RAD_TO_DEG * camera.getRotX(), Mth.RAD_TO_DEG * camera.getRotY(), Mth.RAD_TO_DEG * camera.getRotZ());
|
||||
AnimationHelper.handleShellsAnimation(getAnimationProcessor(), 1.2f, 0.45f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1384,12 +1384,16 @@ public class ClientEventHandler {
|
|||
}
|
||||
}
|
||||
|
||||
public static void shake(double boneRotX, double boneRotY, double boneRotZ) {
|
||||
public static void handleReloadShake(double boneRotX, double boneRotY, double boneRotZ) {
|
||||
LocalPlayer player = Minecraft.getInstance().player;
|
||||
|
||||
float shakeStrength = (float) (DisplayConfig.WEAPON_SCREEN_SHAKE.get() / 100.0);
|
||||
if (shakeStrength <= 0.0f) return;
|
||||
|
||||
if (player != null) {
|
||||
cameraRot[0] = -boneRotX;
|
||||
cameraRot[1] = -boneRotY;
|
||||
cameraRot[2] = -boneRotZ;
|
||||
cameraRot[0] = -boneRotX * shakeStrength;
|
||||
cameraRot[1] = -boneRotY * shakeStrength;
|
||||
cameraRot[2] = -boneRotZ * shakeStrength;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue