use of riskyken.armourersWorkshop.api.common.skin.Point3D in project Armourers-Workshop by RiskyKen.
the class ModelSkinWings method renderRightWing.
private void renderRightWing(SkinPart part, float scale, ISkinDye skinDye, byte[] extraColour, double distance, double angle, boolean doLodLoading, MovementType movmentType) {
GL11.glPushMatrix();
Point3D point = new Point3D(0, 0, 0);
ForgeDirection axis = ForgeDirection.DOWN;
if (part.getMarkerCount() > 0) {
point = part.getMarker(0);
axis = part.getMarkerSide(0);
}
GL11.glRotatef((float) Math.toDegrees(this.bipedBody.rotateAngleZ), 0, 0, 1);
GL11.glRotatef((float) Math.toDegrees(this.bipedBody.rotateAngleY), 0, 1, 0);
// GL11.glRotatef((float) Math.toDegrees(this.bipedBody.rotateAngleX), 1, 0, 0);
GL11.glTranslated(SCALE * 0.5F, SCALE * 0.5F, SCALE * 0.5F);
GL11.glTranslated(SCALE * point.getX(), SCALE * point.getY(), SCALE * point.getZ());
switch(axis) {
case UP:
GL11.glRotated(angle, 0, 1, 0);
break;
case DOWN:
GL11.glRotated(angle, 0, -1, 0);
break;
case SOUTH:
GL11.glRotated(angle, 0, 0, -1);
break;
case NORTH:
GL11.glRotated(angle, 0, 0, 1);
break;
case EAST:
GL11.glRotated(angle, 1, 0, 0);
break;
case WEST:
GL11.glRotated(angle, -1, 0, 0);
break;
case UNKNOWN:
break;
}
GL11.glTranslated(SCALE * -point.getX(), SCALE * -point.getY(), SCALE * -point.getZ());
GL11.glTranslated(SCALE * -0.5F, SCALE * -0.5F, SCALE * -0.5F);
renderPart(part, scale, skinDye, extraColour, distance, doLodLoading);
GL11.glPopMatrix();
}
use of riskyken.armourersWorkshop.api.common.skin.Point3D in project Armourers-Workshop by RiskyKen.
the class BlockSkinnable method sitOnSeat.
private boolean sitOnSeat(World world, int x, int y, int z, EntityPlayer player, Skin skin) {
List<Seat> seats = world.getEntitiesWithinAABB(Seat.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1));
if (seats.size() == 0) {
Point3D point = null;
if (skin.getParts().get(0).getMarkerCount() > 0) {
point = skin.getParts().get(0).getMarker(0);
} else {
point = new Point3D(0, 0, 0);
}
int rotation = world.getBlockMetadata(x, y, z);
skin.getParts().get(0).getMarker(0);
Seat seat = new Seat(world, x, y, z, point, rotation);
world.spawnEntityInWorld(seat);
player.mountEntity(seat);
return true;
}
return false;
}
use of riskyken.armourersWorkshop.api.common.skin.Point3D in project Armourers-Workshop by RiskyKen.
the class BlockSkinnable method sleepInBed.
private boolean sleepInBed(World world, int x, int y, int z, EntityPlayer player, Skin skin, ForgeDirection direction, TileEntitySkinnable tileEntity) {
if (world.isRemote) {
return true;
}
Point3D point = null;
if (skin.getParts().get(0).getMarkerCount() > 0) {
point = skin.getParts().get(0).getMarker(0);
} else {
point = new Point3D(0, 0, 16);
}
int xBlockOffset = MathHelper.floor_double(((double) point.getX() + 8) / 16D);
int zBlockOffset = MathHelper.floor_double(((double) point.getZ() + 8) / 16D);
int xOffset = (point.getX() + 8) - x * 16;
int zOffset = (point.getY() + 8) - y * 16;
x -= xBlockOffset * direction.offsetZ + zBlockOffset * direction.offsetX;
;
z -= zBlockOffset * direction.offsetZ + xBlockOffset * direction.offsetX;
float scale = 1F / 16F;
EntityPlayer.EnumStatus enumstatus = player.sleepInBedAt(x, y, z);
if (enumstatus == EntityPlayer.EnumStatus.OK) {
tileEntity.setBedOccupied(true);
ModLogger.log("sleeping!");
player.field_71079_bU = 0.0F;
player.field_71089_bV = 0.0F;
player.setPosition(x + 10, y - 0.5F, z + 1);
player.playerLocation = new ChunkCoordinates(x, y, z);
world.updateAllPlayersSleepingFlag();
return true;
} else {
if (enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW) {
player.addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep", new Object[0]));
} else if (enumstatus == EntityPlayer.EnumStatus.NOT_SAFE) {
player.addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe", new Object[0]));
}
return true;
}
}
use of riskyken.armourersWorkshop.api.common.skin.Point3D in project Armourers-Workshop by RiskyKen.
the class BlockSkinnable method addCollisionBoxesToList.
@Override
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, Entity entity) {
if (entity instanceof Seat) {
return;
}
if (entity != null && entity instanceof EntityPlayer) {
if (((EntityPlayer) entity).isPlayerSleeping()) {
Skin skin = getSkin(world, x, y, z);
if (skin != null) {
Point3D point = null;
if (skin.getParts().get(0).getMarkerCount() > 0) {
point = skin.getParts().get(0).getMarker(0);
} else {
point = new Point3D(0, 0, 16);
}
float scale = 1F / 16F;
// list.add(AxisAlignedBB.getBoundingBox(x, y, z, x + 1F, y + 0.5F + -point.getY() * scale, z + 1F));
// ModLogger.log(-point.getY() * scale);
} else {
// list.add(AxisAlignedBB.getBoundingBox(x, y, z, x + 1F, y + 0.5F, z + 1F));
}
list.add(AxisAlignedBB.getBoundingBox(x, y, z, x + 1F, y + 0.5F, z + 1F));
return;
}
}
super.addCollisionBoxesToList(world, x, y, z, mask, list, entity);
}
use of riskyken.armourersWorkshop.api.common.skin.Point3D in project Armourers-Workshop by RiskyKen.
the class ModelSkinWings method renderLeftWing.
private void renderLeftWing(SkinPart part, float scale, ISkinDye skinDye, byte[] extraColour, double distance, double angle, boolean doLodLoading, MovementType movmentType) {
GL11.glPushMatrix();
Point3D point = new Point3D(0, 0, 0);
ForgeDirection axis = ForgeDirection.DOWN;
if (part.getMarkerCount() > 0) {
point = part.getMarker(0);
axis = part.getMarkerSide(0);
}
GL11.glRotatef((float) Math.toDegrees(this.bipedBody.rotateAngleZ), 0, 0, 1);
GL11.glRotatef((float) Math.toDegrees(this.bipedBody.rotateAngleY), 0, 1, 0);
// GL11.glRotatef((float) Math.toDegrees(this.bipedBody.rotateAngleX), 1, 0, 0);
GL11.glTranslated(SCALE * 0.5F, SCALE * 0.5F, SCALE * 0.5F);
GL11.glTranslated(SCALE * point.getX(), SCALE * point.getY(), SCALE * point.getZ());
switch(axis) {
case UP:
GL11.glRotated(angle, 0, 1, 0);
break;
case DOWN:
GL11.glRotated(angle, 0, -1, 0);
break;
case SOUTH:
GL11.glRotated(angle, 0, 0, -1);
break;
case NORTH:
GL11.glRotated(angle, 0, 0, 1);
break;
case EAST:
GL11.glRotated(angle, 1, 0, 0);
break;
case WEST:
GL11.glRotated(angle, -1, 0, 0);
break;
case UNKNOWN:
break;
}
GL11.glTranslated(SCALE * -point.getX(), SCALE * -point.getY(), SCALE * -point.getZ());
GL11.glTranslated(SCALE * -0.5F, SCALE * -0.5F, SCALE * -0.5F);
renderPart(part, scale, skinDye, extraColour, distance, doLodLoading);
GL11.glPopMatrix();
}
Aggregations