use of com.mojang.math.Matrix3f in project MinecraftForge by MinecraftForge.
the class ForgeHooksClient method handleCameraTransforms.
public static BakedModel handleCameraTransforms(PoseStack matrixStack, BakedModel model, ItemTransforms.TransformType cameraTransformType, boolean leftHandHackery) {
PoseStack stack = new PoseStack();
model = model.handlePerspective(cameraTransformType, stack);
// If the stack is not empty, the code has added a matrix for us to use.
if (!stack.clear()) {
// Apply the transformation to the real matrix stack, flipping for left hand
Matrix4f tMat = stack.last().pose();
Matrix3f nMat = stack.last().normal();
if (leftHandHackery) {
tMat.multiplyBackward(flipX);
tMat.multiply(flipX);
nMat.multiplyBackward(flipXNormal);
nMat.mul(flipXNormal);
}
matrixStack.last().pose().multiply(tMat);
matrixStack.last().normal().mul(nMat);
}
return model;
}