use of riskyken.armourersWorkshop.api.common.IPoint3D in project Armourers-Workshop by RiskyKen.
the class ArmourerWorldHelper method loadSkinPartIntoWorld.
private static void loadSkinPartIntoWorld(World world, SkinPart partData, int xCoord, int yCoord, int zCoord, ForgeDirection direction, boolean mirror) {
ISkinPartType skinPart = partData.getPartType();
IRectangle3D buildSpace = skinPart.getBuildingSpace();
IPoint3D offset = skinPart.getOffset();
SkinCubeData cubeData = partData.getCubeData();
for (int i = 0; i < cubeData.getCubeCount(); i++) {
ICube blockData = cubeData.getCube(i);
int meta = 0;
for (int j = 0; j < partData.getMarkerBlocks().size(); j++) {
CubeMarkerData cmd = partData.getMarkerBlocks().get(j);
byte[] loc = cubeData.getCubeLocation(i);
if (cmd.x == loc[0] & cmd.y == loc[1] & cmd.z == loc[2]) {
meta = cmd.meta;
break;
}
}
int xOrigin = -offset.getX();
int yOrigin = -offset.getY() + -buildSpace.getY();
int zOrigin = offset.getZ();
loadSkinBlockIntoWorld(world, xCoord, yCoord, zCoord, xOrigin, yOrigin, zOrigin, blockData, direction, meta, cubeData, i, mirror);
}
}
use of riskyken.armourersWorkshop.api.common.IPoint3D in project Armourers-Workshop by RiskyKen.
the class SkinItemRenderHelper method renderSkinWithoutHelper.
public static void renderSkinWithoutHelper(ISkinPointer skinPointer, boolean doLodLoading) {
Skin skin = ClientSkinCache.INSTANCE.getSkin(skinPointer);
if (skin == null) {
return;
}
float scale = 1F / 16F;
for (int i = 0; i < skin.getParts().size(); i++) {
GL11.glPushMatrix();
SkinPart skinPart = skin.getParts().get(i);
IPoint3D offset = skinPart.getPartType().getOffset();
GL11.glTranslated(offset.getX() * scale, (offset.getY() + 1) * scale, offset.getZ() * scale);
SkinPartRenderer.INSTANCE.renderPart(skinPart, 0.0625F, skinPointer.getSkinDye(), null, doLodLoading);
GL11.glPopMatrix();
}
}
use of riskyken.armourersWorkshop.api.common.IPoint3D in project Armourers-Workshop by RiskyKen.
the class SkinRenderHelper method renderBuildingGrid.
public static void renderBuildingGrid(ISkinType skinType, float scale, boolean showGuides, boolean hidden, boolean multiblock) {
for (int i = 0; i < skinType.getSkinParts().size(); i++) {
ISkinPartType skinPartType = skinType.getSkinParts().get(i);
IPoint3D partOffset = skinPartType.getOffset();
GL11.glTranslated(partOffset.getX() * scale, partOffset.getY() * scale, partOffset.getZ() * scale);
if (skinType == SkinTypeRegistry.skinBlock) {
if (skinPartType.getPartName().equals("multiblock") & multiblock) {
GL11.glColor4f(1F, 1F, 0.0F, 0.2F);
renderBuildingGrid(((SkinBlock) SkinTypeRegistry.skinBlock).partBase, scale, showGuides, hidden);
GL11.glPolygonOffset(6F, 6F);
GL11.glColor4f(0.5F, 0.5F, 0.5F, 0.25F);
renderBuildingGrid(skinPartType, scale, showGuides, hidden);
} else if (skinPartType.getPartName().equals("base") & !multiblock) {
GL11.glColor4f(0.5F, 0.5F, 0.5F, 0.25F);
renderBuildingGrid(skinPartType, scale, showGuides, hidden);
}
} else {
GL11.glColor4f(0.5F, 0.5F, 0.5F, 0.25F);
renderBuildingGrid(skinPartType, scale, showGuides, hidden);
}
GL11.glTranslated(-partOffset.getX() * scale, -partOffset.getY() * scale, -partOffset.getZ() * scale);
}
}
use of riskyken.armourersWorkshop.api.common.IPoint3D in project Armourers-Workshop by RiskyKen.
the class SkinRenderHelper method renderBuildingGuide.
public static void renderBuildingGuide(ISkinType skinType, float scale, boolean showSkinOverlay, boolean showHelper) {
for (int i = 0; i < skinType.getSkinParts().size(); i++) {
ISkinPartType skinPart = skinType.getSkinParts().get(i);
IPoint3D partOffset = skinPart.getOffset();
GL11.glTranslated(partOffset.getX() * scale, partOffset.getY() * scale, partOffset.getZ() * scale);
skinPart.renderBuildingGuide(scale, showSkinOverlay, showHelper);
GL11.glTranslated(-partOffset.getX() * scale, -partOffset.getY() * scale, -partOffset.getZ() * scale);
}
}
use of riskyken.armourersWorkshop.api.common.IPoint3D in project Armourers-Workshop by RiskyKen.
the class ItemStackRenderHelper method renderSkinWithoutHelper.
public static void renderSkinWithoutHelper(ISkinPointer skinPointer, boolean doLodLoading) {
Skin skin = ClientSkinCache.INSTANCE.getSkin(skinPointer);
if (skin == null) {
return;
}
float scale = 1F / 16F;
for (int i = 0; i < skin.getParts().size(); i++) {
GL11.glPushMatrix();
SkinPart skinPart = skin.getParts().get(i);
IPoint3D offset = skinPart.getPartType().getOffset();
GL11.glTranslated(offset.getX() * scale, (offset.getY() + 1) * scale, offset.getZ() * scale);
SkinPartRenderer.INSTANCE.renderPart(skinPart, 0.0625F, skinPointer.getSkinDye(), null, doLodLoading);
GL11.glPopMatrix();
}
}
Aggregations