diff --git a/src/main/java/net/mcreator/superbwarfare/client/model/item/Qbz95ItemModel.java b/src/main/java/net/mcreator/superbwarfare/client/model/item/Qbz95ItemModel.java index a7f8668bb..16b0de9e1 100644 --- a/src/main/java/net/mcreator/superbwarfare/client/model/item/Qbz95ItemModel.java +++ b/src/main/java/net/mcreator/superbwarfare/client/model/item/Qbz95ItemModel.java @@ -22,6 +22,13 @@ public class Qbz95ItemModel extends GeoModel { public static float fireRotY = 0f; public static float fireRotZ = 0f; public static float rotXBipod = 0f; + + public static float lHandPosX = 0f; + public static float lHandPosY= 0f; + public static float lHandPosZ = 0f; + public static float lHandRotX = 0f; + public static float lHandRotY= 0f; + public static float lHandRotZ = 0f; @Override public ResourceLocation getAnimationResource(Qbz95Item animatable) { return ModUtils.loc("animations/qbz95.animation.json"); @@ -88,15 +95,15 @@ public class Qbz95ItemModel extends GeoModel { default -> 0f; }; float posZ = switch (type) { - case 0 -> 5.9f; - case 1 -> 5.8f; + case 0 -> 10.6f; + case 1 -> 8.8f; case 2 -> 14.51f; case 3 -> 17.2f; default -> 0f; }; float scaleZ = switch (type) { - case 0 -> 0.2f; - case 1 -> 0.21f; + case 0 -> 0.5f; + case 1 -> 0.51f; case 2 -> 0.792f; case 3 -> 0.891f; default -> 0f; @@ -108,13 +115,11 @@ public class Qbz95ItemModel extends GeoModel { gun.setRotZ((float) (0.05f * zpz)); gun.setScaleZ(1f - (scaleZ * (float) zp)); - if (main.getRotZ() < 10 * Mth.DEG_TO_RAD) { - button.setScaleY(1f - (0.85f * (float) zp)); - button3.setScaleX(1f - (0.5f * (float) zp)); - button6.setScaleX(1f - (0.5f * (float) zp)); - } + button.setScaleY(1f - (0.85f * (float) zp)); + button3.setScaleX(1f - (0.5f * (float) zp)); + button6.setScaleX(1f - (0.8f * (float) zp)); - stack.getOrCreateTag().putBoolean("HoloHidden", gun.getPosX() < 3.1 || main.getRotZ() > 10 * Mth.DEG_TO_RAD); + stack.getOrCreateTag().putBoolean("HoloHidden", gun.getPosX() < 3.1); CoreGeoBone shen; if (zt < 0.5) { @@ -176,20 +181,31 @@ public class Qbz95ItemModel extends GeoModel { root.setRotY((float) (0.2f * movePosX + Mth.DEG_TO_RAD * 300 * ClientEventHandler.drawTime + Mth.DEG_TO_RAD * turnRotY)); root.setRotZ((float) (0.2f * movePosX + moveRotZ + Mth.DEG_TO_RAD * 90 * ClientEventHandler.drawTime + 2.7f * mph + Mth.DEG_TO_RAD * turnRotZ)); - float numR = 1; - float numP = 1; + float numR = (float) (1 - 0.975 * zt); + float numP = (float) (1 - 0.97 * zt); + + CoreGeoBone leftHand = getAnimationProcessor().getBone("Lefthand"); + CoreGeoBone anim = getAnimationProcessor().getBone("anim"); + + boolean isZooming = zt > 0 && anim.getPosZ() == 0 ; + + lHandPosX = Mth.lerp(1.5f * times, lHandPosX, isZooming ? 0 : leftHand.getPosX()); + lHandPosY = Mth.lerp(1.5f * times, lHandPosY, isZooming ? 0 : leftHand.getPosY()); + lHandPosZ = Mth.lerp(1.5f * times, lHandPosZ, isZooming ? 0 : leftHand.getPosZ()); + lHandRotX = Mth.lerp(1.5f * times, lHandRotX, isZooming ? -2.1f : leftHand.getRotX()); + lHandRotY = Mth.lerp(1.5f * times, lHandRotY, isZooming ? 0.2419f : leftHand.getRotY()); + lHandRotZ = Mth.lerp(1.5f * times, lHandRotZ, isZooming ? 2.9228f : leftHand.getRotZ()); + if (stack.getOrCreateTag().getBoolean("is_empty_reloading")) { - numR = (float) (1 - 0.72 * zt); - numP = (float) (1 - 0.95 * zt); + leftHand.setPosX(lHandPosX); + leftHand.setPosY(lHandPosY); + leftHand.setPosZ(lHandPosZ); + leftHand.setRotX(lHandRotX); + leftHand.setRotY(lHandRotY); + leftHand.setRotZ(lHandRotZ); } - if (stack.getOrCreateTag().getBoolean("is_normal_reloading")) { - numR = (float) (1 - 0.98 * zt); - numP = (float) (1 - 0.96 * 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()); } diff --git a/src/main/resources/assets/superbwarfare/animations/qbz95.animation.json b/src/main/resources/assets/superbwarfare/animations/qbz95.animation.json index 1db7c109d..9285fb446 100644 --- a/src/main/resources/assets/superbwarfare/animations/qbz95.animation.json +++ b/src/main/resources/assets/superbwarfare/animations/qbz95.animation.json @@ -632,6 +632,15 @@ "1.3": [0, -1.3107, 0.06869], "1.325": [0, 0, 0] } + }, + "anim": { + "position": { + "0.0": [0, 0, 0], + "2.6": [0, 0, 0], + "2.625": [0, 0, -10], + "3.125": [0, 0, -10], + "3.15": [0, 0, 0] + } } }, "sound_effects": { @@ -1350,6 +1359,15 @@ "1.3": [0, -1.3107, 0.06869], "1.325": [0, 0, 0] } + }, + "anim": { + "position": { + "0.0": [0, 0, 0], + "2.6": [0, 0, 0], + "2.625": [0, 0, -10], + "3.125": [0, 0, -10], + "3.15": [0, 0, 0] + } } }, "sound_effects": { @@ -2034,6 +2052,15 @@ "1.3": [0, -1.3107, 0.06869], "1.325": [0, 0, 0] } + }, + "anim": { + "position": { + "0.0": [0, 0, 0], + "2.6": [0, 0, 0], + "2.625": [0, 0, -10], + "3.125": [0, 0, -10], + "3.15": [0, 0, 0] + } } }, "sound_effects": { @@ -2716,6 +2743,15 @@ "1.3": [0, -1.3107, 0.06869], "1.325": [0, 0, 0] } + }, + "anim": { + "position": { + "0.0": [0, 0, 0], + "2.6": [0, 0, 0], + "2.625": [0, 0, -10], + "3.125": [0, 0, -10], + "3.15": [0, 0, 0] + } } }, "sound_effects": { diff --git a/src/main/resources/assets/superbwarfare/geo/qbz95.geo.json b/src/main/resources/assets/superbwarfare/geo/qbz95.geo.json index 8a9f60b3d..618a629b4 100644 --- a/src/main/resources/assets/superbwarfare/geo/qbz95.geo.json +++ b/src/main/resources/assets/superbwarfare/geo/qbz95.geo.json @@ -13,7 +13,7 @@ "bones": [ { "name": "camera", - "pivot": [3.87141, 8.56276, 13.57702] + "pivot": [3.8714, 8.5628, 13.577] }, { "name": "root", @@ -3474,7 +3474,6 @@ "name": "button3", "parent": "Scope3", "pivot": [-1.64609, 8.58315, 0.34398], - "rotation": [0, 0, 0], "cubes": [ { "origin": [-1.5182, 7.73861, 0.07448], @@ -3562,7 +3561,6 @@ "name": "button6", "parent": "Scope3", "pivot": [1.63438, 8.58315, 0.34398], - "rotation": [0, 0, 0], "cubes": [ { "origin": [1.1818, 7.73861, 0.07448], @@ -4115,8 +4113,6 @@ { "origin": [0.78962, 7.58803, -1.83623], "size": [0.39576, 1.98716, 2.38542], - "pivot": [0.9875, 8.58161, -0.64352], - "rotation": [0, 0, 0], "uv": { "north": {"uv": [14, 188], "uv_size": [0.25, 1.25]}, "south": {"uv": [24, 178], "uv_size": [0.25, 1.25]}, @@ -5662,8 +5658,6 @@ { "origin": [-0.03649, -1.23493, -145.76641], "size": [0.07299, 9.5308, 0], - "pivot": [0, 8.58047, -145.76641], - "rotation": [0, 0, 0], "uv": { "north": {"uv": [5.75, 5], "uv_size": [-0.75, 0.75]}, "east": {"uv": [5.75, 5], "uv_size": [-0.75, 0.75]}, @@ -5704,8 +5698,6 @@ { "origin": [-0.06892, -1.23493, -145.76641], "size": [0.13393, 4, 0], - "pivot": [0, 8.58047, -145.76641], - "rotation": [0, 0, 0], "uv": { "north": {"uv": [5, 5], "uv_size": [0.75, 0.75]}, "east": {"uv": [5, 5], "uv_size": [0.75, 0.75]}, @@ -13808,6 +13800,11 @@ } ] }, + { + "name": "anim", + "parent": "0", + "pivot": [0, 0, 0] + }, { "name": "gun", "parent": "0",