matrix.setIdentity(); matrix.setRotation( new AxisAngle4f( 0, 1, 0, rotation ) );
@Nonnull @Override @SideOnly(Side.CLIENT) public Pair<IBakedModel, Matrix4f> getModel(@Nonnull IVehicleAccess access) { Pair<IBakedModel, Matrix4f> model = handler.getModel(0); Matrix4f transform = new Matrix4f(); transform.setIdentity(); // Center the view (-0.5) and then move half a pixel back out. transform.setTranslation(new Vector3f(0, 0, -0.5f + (1 / 32.0f))); transform.mul(transform, model.getRight()); return Pair.of(model.getLeft(), transform); }
private static Matrix4f blockCenterToCorner(Matrix4f transform) { Matrix4f ret = new Matrix4f(transform); Matrix4f tmp = new Matrix4f(); tmp.setIdentity(); tmp.m03 = tmp.m13 = tmp.m23 = +0.5f; ret.mul(tmp, ret); tmp.m03 = tmp.m13 = tmp.m23 = -0.5f; ret.mul(tmp); return ret; }
@Nonnull @Override @SideOnly(Side.CLIENT) public Pair<IBakedModel, Matrix4f> getModel(float delta) { Matrix4f matrix = new Matrix4f(); matrix.setIdentity(); matrix.setRotation(new AxisAngle4f(0f, 1f, 0f, delta)); IBakedModel model = this.model; if (model == null) { model = this.model = RenderHelpers.getMesher().getItemModel(new ItemStack(item)); } return Pair.of(model, matrix); }
public void init() { createModel(this.weaponModelLocation); loadWeaponMetadata(); identity = new Matrix4f(); identity.setIdentity(); Matrix4f mat = new Matrix4f(); mat.setIdentity(); mat.rotY((float) Math.toRadians(180)); mat.setTranslation(new Vector3f(-0.8f, 0.8f, -0.6f)); mat.setScale(1.6f); transforms.put(ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, mat); mat = new Matrix4f(); mat.setIdentity(); mat.mul(getCombinedRotation(20f, 45f, 0f)); mat.setTranslation(new Vector3f(0.8f, 0.9f, 0f)); mat.setScale(1.5f); transforms.put(ItemCameraTransforms.TransformType.GUI, mat); mat = new Matrix4f(); mat.setIdentity(); mat.setTranslation(new Vector3f(0.6f, 0.5f, 0.3f)); mat.setScale(1.2f); transforms.put(ItemCameraTransforms.TransformType.GROUND, mat); }
@Nonnull @Override @SideOnly(Side.CLIENT) public Pair<IBakedModel, Matrix4f> getModel(float delta) { Matrix4f matrix = new Matrix4f(); matrix.setIdentity(); // We flip the laser so it points forwards on turtles. if (stack.getItemDamage() == LASER_ID) { delta = (float) ((delta + Math.PI) % (2 * Math.PI)); } matrix.setRotation(new AxisAngle4f(0f, 1f, 0f, delta)); return Pair.of( RenderHelpers.getMesher().getItemModel(stack), matrix ); } }
public ItemRendererPhaser() { super(new ResourceLocation(MODEL)); phaserTextureColorMask = new ResourceLocation(TEXTURE_COLOR_MASK); Matrix4f mat = new Matrix4f(); mat.setIdentity(); mat.mul(getCombinedRotation(45f, 120f, 0f)); mat.setTranslation(new Vector3f(0.2f, 2.1f, 0f)); mat.setScale(2.65f); transforms.put(ItemCameraTransforms.TransformType.GUI, mat); }
transform.setIdentity(); float scale = 1 / 16.0F;
trans.setIdentity(); temp.setIdentity(); temp.setTranslation(new Vector3f((float) x + ox, (float) y + 0.375f + oy, (float) z + oz)); trans.mul(temp); temp.setIdentity(); temp.rotY((float) Math.toRadians(180 - yaw)); trans.mul(temp); temp.setIdentity(); temp.rotZ((float) Math.toRadians(-pitch)); trans.mul(temp); temp.setIdentity(); temp.rotX((float) Math.toRadians(MathHelper.sin(amplitude) * amplitude * roll / 10.0F * (float) getRollingDirection())); trans.mul(temp); temp.setIdentity(); temp.setTranslation(new Vector3f(-0.5F, (float) (offset - 8) / 16.0F, 0.5F)); trans.mul(temp);
rotMat.setIdentity();
transform.setIdentity(); float scale = 1 / 16.0F;
currEffectMat.setIdentity(); effectStack.push(new EffectStackItem(currEffectMat, projMat, 1.0f, null)); for (int r = 0; r < 4; r++)
tempMat.setIdentity(); boolean rv = false; if ((effectType & EFFECT_SLIDE) != 0)