Search in sources :

Example 1 with ItemCameraTransforms

use of net.minecraft.client.renderer.block.model.ItemCameraTransforms in project SilentGems by SilentChaos512.

the class ToolModel method getItemCameraTransforms.

@Override
public ItemCameraTransforms getItemCameraTransforms() {
    Vector3f rotation = new Vector3f();
    Vector3f translation = new Vector3f();
    Vector3f scale = new Vector3f(1f, 1f, 1f);
    // Third Person
    // (0, 90, -35)
    rotation = new Vector3f(0f, (float) -Math.PI / 2f, (float) Math.PI * 7f / 36f);
    translation = new Vector3f(0f, 5.5f, 2.5f);
    if (tool != null && tool.getItem() == ModItems.katana) {
        translation.y += 2.0f;
    }
    translation.scale(0.0625f);
    thirdPersonRight = new ItemTransformVec3f(rotation, translation, scale);
    // (0, 90, -35)
    rotation = new Vector3f(0f, (float) Math.PI / 2f, (float) -Math.PI * 7f / 36f);
    thirdPersonLeft = new ItemTransformVec3f(rotation, translation, scale);
    // First Person
    rotation = new Vector3f(0f, (float) -Math.PI * 1f / 2f, (float) Math.PI * 5f / 36f);
    translation = new Vector3f(1.13f, 3.2f, 1.13f);
    if (tool != null && tool.getItem() == ModItems.katana) {
        translation.y += 1.5f;
    }
    translation.scale(0.0625f);
    scale = new Vector3f(0.68f, 0.68f, 0.68f);
    firstPersonRight = new ItemTransformVec3f(rotation, translation, scale);
    rotation = new Vector3f(0f, (float) Math.PI * 1f / 2f, (float) -Math.PI * 5f / 36f);
    firstPersonLeft = new ItemTransformVec3f(rotation, translation, scale);
    // Head and GUI are default.
    return new ItemCameraTransforms(thirdPersonLeft, thirdPersonRight, firstPersonLeft, firstPersonRight, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT);
}
Also used : Vector3f(org.lwjgl.util.vector.Vector3f) ItemTransformVec3f(net.minecraft.client.renderer.block.model.ItemTransformVec3f) ItemCameraTransforms(net.minecraft.client.renderer.block.model.ItemCameraTransforms)

Example 2 with ItemCameraTransforms

use of net.minecraft.client.renderer.block.model.ItemCameraTransforms in project BuildCraft by BuildCraft.

the class ModelItemSimple method scale.

private static ItemCameraTransforms scale(ItemCameraTransforms from, double by) {
    ItemTransformVec3f thirdperson_left = scale(from.thirdperson_left, by);
    ItemTransformVec3f thirdperson_right = scale(from.thirdperson_right, by);
    ItemTransformVec3f firstperson_left = scale(from.firstperson_left, by);
    ItemTransformVec3f firstperson_right = scale(from.firstperson_right, by);
    ItemTransformVec3f head = scale(from.head, by);
    ItemTransformVec3f gui = scale(from.gui, by);
    ItemTransformVec3f ground = scale(from.ground, by);
    ItemTransformVec3f fixed = scale(from.fixed, by);
    return new ItemCameraTransforms(thirdperson_left, thirdperson_right, firstperson_left, firstperson_right, head, gui, ground, fixed);
}
Also used : ItemTransformVec3f(net.minecraft.client.renderer.block.model.ItemTransformVec3f) ItemCameraTransforms(net.minecraft.client.renderer.block.model.ItemCameraTransforms)

Aggregations

ItemCameraTransforms (net.minecraft.client.renderer.block.model.ItemCameraTransforms)2 ItemTransformVec3f (net.minecraft.client.renderer.block.model.ItemTransformVec3f)2 Vector3f (org.lwjgl.util.vector.Vector3f)1