use of blusunrize.immersiveengineering.common.util.chickenbones.Matrix4 in project ImmersiveEngineering by BluSunrize.
the class ConveyorVertical method modifyQuads.
@Override
@SideOnly(Side.CLIENT)
public List<BakedQuad> modifyQuads(List<BakedQuad> baseModel, @Nullable TileEntity tile, EnumFacing facing) {
if (tile != null && this.renderBottomBelt(tile, facing)) {
TextureAtlasSprite sprite = ClientUtils.getSprite(isActive(tile) ? ConveyorBasic.texture_on : ConveyorBasic.texture_off);
TextureAtlasSprite spriteColour = ClientUtils.getSprite(getColouredStripesTexture());
boolean[] walls = { super.renderWall(tile, facing, 0), super.renderWall(tile, facing, 1) };
baseModel.addAll(ModelConveyor.getBaseConveyor(facing, .875f, new Matrix4(facing), ConveyorDirection.HORIZONTAL, sprite, walls, new boolean[] { true, false }, spriteColour, getDyeColour()));
}
return baseModel;
}
use of blusunrize.immersiveengineering.common.util.chickenbones.Matrix4 in project ImmersiveEngineering by BluSunrize.
the class ConveyorSplit method modifyQuads.
@Override
@SideOnly(Side.CLIENT)
public List<BakedQuad> modifyQuads(List<BakedQuad> baseModel, @Nullable TileEntity tile, EnumFacing facing) {
TextureAtlasSprite tex_casing0 = ClientUtils.getSprite(texture_casing);
Matrix4 matrix = new Matrix4(facing);
float[] colour = { 1, 1, 1, 1 };
Vector3f[] vertices = { new Vector3f(.0625f, .1875f, 0), new Vector3f(.0625f, .1875f, 1), new Vector3f(.9375f, .1875f, 1), new Vector3f(.9375f, .1875f, 0) };
baseModel.add(ClientUtils.createBakedQuad(DefaultVertexFormats.ITEM, ClientUtils.applyMatrixToVertices(matrix, vertices), EnumFacing.UP, tex_casing0, new double[] { 1, 16, 15, 0 }, colour, false));
vertices = new Vector3f[] { new Vector3f(.0625f, 0, 0), new Vector3f(.0625f, .1875f, 0), new Vector3f(.9375f, .1875f, 0), new Vector3f(.9375f, 0, 0) };
baseModel.set(15, ClientUtils.createBakedQuad(DefaultVertexFormats.ITEM, ClientUtils.applyMatrixToVertices(matrix, vertices), facing, ClientUtils.getSprite(ModelConveyor.rl_casing[1]), new double[] { 1, 16, 15, 13 }, colour, false));
vertices = new Vector3f[] { new Vector3f(.0625f, .125f, 0), new Vector3f(.0625f, .1875f, 0), new Vector3f(.9375f, .1875f, 0), new Vector3f(.9375f, .125f, 0) };
Vector3f[] vertices2 = new Vector3f[] { new Vector3f(.5f, .125f, 0), new Vector3f(.5f, .125f, .5f), new Vector3f(.5f, .1875f, .5f), new Vector3f(.5f, .1875f, 0) };
Vector3f[] vertices3 = new Vector3f[] { new Vector3f(.5f, .125f, 0), new Vector3f(.5f, .125f, .5f), new Vector3f(.5f, .1875f, .5f), new Vector3f(.5f, .1875f, 0) };
for (int i = 0; i < 8; i++) {
for (int iv = 0; iv < vertices.length; iv++) {
vertices[iv].setZ((i + 1) * .0625f);
vertices2[iv].setX(vertices2[iv].getX() + .0625f);
vertices3[iv].setX(vertices3[iv].getX() - .0625f);
}
double v = 16 - i;
baseModel.add(ClientUtils.createBakedQuad(DefaultVertexFormats.ITEM, ClientUtils.applyMatrixToVertices(matrix, vertices), facing, tex_casing0, new double[] { 1, v - 1, 15, v }, colour, true));
if (i < 7) {
double u = 8 - i;
baseModel.add(ClientUtils.createBakedQuad(DefaultVertexFormats.ITEM, ClientUtils.applyMatrixToVertices(matrix, vertices2), facing, tex_casing0, new double[] { u - 1, 16, u, 8 }, colour, true));
baseModel.add(ClientUtils.createBakedQuad(DefaultVertexFormats.ITEM, ClientUtils.applyMatrixToVertices(matrix, vertices3), facing, tex_casing0, new double[] { u - 1, 16, u, 8 }, colour, false));
}
}
return baseModel;
}
use of blusunrize.immersiveengineering.common.util.chickenbones.Matrix4 in project ImmersiveEngineering by BluSunrize.
the class TileEntityRedstoneBreaker method getRaytraceOffset.
@Override
public Vec3d getRaytraceOffset(IImmersiveConnectable link) {
Matrix4 mat = new Matrix4(facing);
mat.translate(.5, .5, 0).rotate(Math.PI / 2 * rotation, 0, 0, 1).translate(-.5, -.5, 0);
Vec3d ret = mat.apply(new Vec3d(.5, .5, .99));
return ret;
}
use of blusunrize.immersiveengineering.common.util.chickenbones.Matrix4 in project ImmersiveEngineering by BluSunrize.
the class TileEntityRedstoneBreaker method getConnectionOffset.
@Override
public Vec3d getConnectionOffset(Connection con) {
Matrix4 mat = new Matrix4(facing);
mat.translate(.5, .5, 0).rotate(Math.PI / 2 * rotation, 0, 0, 1).translate(-.5, -.5, 0);
if (endOfLeftConnection == null)
calculateLeftConn(mat);
boolean isLeft = con.end.equals(endOfLeftConnection) || con.start.equals(endOfLeftConnection);
Vec3d ret = mat.apply(isLeft ? new Vec3d(.125, .5, 1.03125) : new Vec3d(.875, .5, 1.03125));
return ret;
}
use of blusunrize.immersiveengineering.common.util.chickenbones.Matrix4 in project ImmersiveEngineering by BluSunrize.
the class TileEntityRedstoneBreaker method getBlockBounds.
@Override
public float[] getBlockBounds() {
Vec3d start = new Vec3d(0, .125f, 0);
Vec3d end = new Vec3d(1, .875f, 1);
Matrix4 mat = new Matrix4(facing);
mat.translate(.5, .5, 0).rotate(Math.PI / 2 * rotation, 0, 0, 1).translate(-.5, -.5, 0);
start = mat.apply(start);
end = mat.apply(end);
return new float[] { (float) start.xCoord, (float) start.yCoord, (float) start.zCoord, (float) end.xCoord, (float) end.yCoord, (float) end.zCoord };
}
Aggregations