@Override public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) { if (baseSpellPageModel instanceof IPerspectiveAwareModel) { Matrix4f matrix4f = ((IPerspectiveAwareModel) baseSpellPageModel).handlePerspective(cameraTransformType) .getRight(); return Pair.of(this, matrix4f); } ItemCameraTransforms itemCameraTransforms = baseSpellPageModel.getItemCameraTransforms(); ItemTransformVec3f itemTransformVec3f = itemCameraTransforms.getTransform(cameraTransformType); TRSRTransformation tr = new TRSRTransformation(itemTransformVec3f); Matrix4f mat = null; if (tr != null) { mat = tr.getMatrix(); } return Pair.of(this, mat); }
@Override public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) { if (baseKnowledgeBookModel instanceof IPerspectiveAwareModel) { Matrix4f matrix4f = ((IPerspectiveAwareModel) baseKnowledgeBookModel).handlePerspective(cameraTransformType) .getRight(); return Pair.of(this, matrix4f); } ItemCameraTransforms itemCameraTransforms = baseKnowledgeBookModel.getItemCameraTransforms(); ItemTransformVec3f itemTransformVec3f = itemCameraTransforms.getTransform(cameraTransformType); TRSRTransformation tr = new TRSRTransformation(itemTransformVec3f); Matrix4f mat = null; if (tr != null) { mat = tr.getMatrix(); } return Pair.of(this, mat); }
@Override public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) { if (parentModel instanceof IPerspectiveAwareModel) { Matrix4f matrix4f = ((IPerspectiveAwareModel) parentModel).handlePerspective(cameraTransformType) .getRight(); return Pair.of(this, matrix4f); } ItemCameraTransforms itemCameraTransforms = parentModel.getItemCameraTransforms(); ItemTransformVec3f itemTransformVec3f = itemCameraTransforms.getTransform(cameraTransformType); TRSRTransformation tr = new TRSRTransformation(itemTransformVec3f); Matrix4f mat = null; if (tr != null) { mat = tr.getMatrix(); } return Pair.of(this, mat); }
@SuppressWarnings("deprecation") public FWSmartItemModel(Item item) { super(); this.item = item; // Change the default transforms to the default Item transforms this.itemCameraTransforms = new ItemCameraTransforms( new ItemTransformVec3f(new Vector3f(0, -90, 130), new Vector3f(0, 1f / 24f, -2.75f / 16f), new Vector3f(0.9f, 0.9f, 0.9f)), // Third Person new ItemTransformVec3f(new Vector3f(0, -135, 25/*-135/*-25*/), new Vector3f(0, 0.25f, 0.125f/*0.5f, 0.25f*/), new Vector3f(1.7f, 1.7f, 1.7f)), // First Person ItemTransformVec3f.DEFAULT, // Head new ItemTransformVec3f(new Vector3f(-30, 135, 0), new Vector3f(), new Vector3f(1.6F, 1.6F, 1.6F))); // GUI }
@SuppressWarnings("deprecation") public FWSmartBlockModel(Block block, Optional<Item> item) { super(); this.block = block; this.item = item; // Change the default transforms to the default full Block transforms this.itemCameraTransforms = new ItemCameraTransforms( new ItemTransformVec3f(new Vector3f(10, -45, 170), new Vector3f(0, 0.09375f, -0.171875f), new Vector3f(0.375f, 0.375f, 0.375f)), // Third Person ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT); }
public static ItemTransformVec3f parseVec3(ItemTransformVec3f itemTransformVec3f) { Vector3f vector3f = itemTransformVec3f.rotation; Vector3f vector3f1 = itemTransformVec3f.translation; vector3f1.scale(0.0625F); MathHelper.clamp_double((double) vector3f1.x, -1.5D, 1.5D); MathHelper.clamp_double((double)vector3f1.y, -1.5D, 1.5D); MathHelper.clamp_double((double)vector3f1.z, -1.5D, 1.5D); Vector3f vector3f2 = itemTransformVec3f.scale; MathHelper.clamp_double((double)vector3f2.x, -1.5D, 1.5D); MathHelper.clamp_double((double)vector3f2.y, -1.5D, 1.5D); MathHelper.clamp_double((double)vector3f2.z, -1.5D, 1.5D); return new ItemTransformVec3f(vector3f, vector3f1, vector3f2); }
@Override public void update() { super.update(); try { ItemTransformVec3f vec = new ItemTransformVec3f(new Vector3f((float)Double.parseDouble(rotation.textFields.get(0).getText()), (float)Double.parseDouble(rotation.textFields.get(1).getText()), (float)Double.parseDouble(rotation.textFields.get(2).getText())), new Vector3f((float)Double.parseDouble(position.textFields.get(0).getText()), (float)Double.parseDouble(position.textFields.get(1).getText()), (float)Double.parseDouble(position.textFields.get(2).getText())), new Vector3f((float)Double.parseDouble(scale.textFields.get(0).getText()), (float)Double.parseDouble(scale.textFields.get(1).getText()), (float)Double.parseDouble(scale.textFields.get(2).getText()))); itemTransformVec3f = vec; } catch(Exception ignored){} }
private boolean func_183005_a(ItemTransformVec3f p_183005_1_) { return p_183005_1_.scale.x < 0.0F ^ p_183005_1_.scale.y < 0.0F ^ p_183005_1_.scale.z < 0.0F; }
/** * Return true if only one scale is negative */ private boolean isThereOneNegativeScale(ItemTransformVec3f itemTranformVec) { return itemTranformVec.scale.x < 0.0F ^ itemTranformVec.scale.y < 0.0F ^ itemTranformVec.scale.z < 0.0F; }
public ItemTransformVec3f getThirdPersonTransform() { return this.parent != null && this.cameraTransforms.thirdPerson == ItemTransformVec3f.DEFAULT ? this.parent.getThirdPersonTransform() : this.cameraTransforms.thirdPerson; }
public ItemTransformVec3f getFirstPersonTransform() { return this.parent != null && this.cameraTransforms.firstPerson == ItemTransformVec3f.DEFAULT ? this.parent.getFirstPersonTransform() : this.cameraTransforms.firstPerson; }
public ItemTransformVec3f getHeadTransform() { return this.parent != null && this.cameraTransforms.head == ItemTransformVec3f.DEFAULT ? this.parent.getHeadTransform() : this.cameraTransforms.head; }
public ItemTransformVec3f getInGuiTransform() { return this.parent != null && this.cameraTransforms.gui == ItemTransformVec3f.DEFAULT ? this.parent.getInGuiTransform() : this.cameraTransforms.gui; }