本文整理汇总了Java中codechicken.lib.colour.Colour类的典型用法代码示例。如果您正苦于以下问题:Java Colour类的具体用法?Java Colour怎么用?Java Colour使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Colour类属于codechicken.lib.colour包,在下文中一共展示了Colour类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderPearl
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public static void renderPearl(CCRenderState ccrs, Vector3 pos, WirelessPart p) {
GlStateManager.pushMatrix();
pos.translation().glApply();
p.rotationT().at(center).glApply();
p.getPearlPos().translation().glApply();
p.getPearlRotation().glApply();
new Scale(p.getPearlScale()).glApply();
float light = 1;
if (p.tile() != null) {
GlStateManager.rotate((float) (p.getPearlSpin() * MathHelper.todeg), 0, 1, 0);
light = p.getPearlLight();
}
GlStateManager.disableLighting();
ccrs.reset();
TextureUtils.changeTexture("wrcbe:textures/hedronmap.png");
ccrs.pullLightmap();
ccrs.colour = Colour.packRGBA(light, light, light, 1);
ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_NORMAL);
CCModelLibrary.icosahedron4.render(ccrs);
ccrs.draw();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
示例2: getColourRGB
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public Colour getColourRGB(Colour defaultvalue)
{
if(value == null)
{
setColourRGB(defaultvalue);
}
try
{
return getColourRGB();
}
catch(NumberFormatException nfe)
{
setColourRGB(defaultvalue);
return getColourRGB();
}
}
示例3: buildQuad
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public static BakedQuad buildQuad(VertexFormat format, TextureAtlasSprite sprite, EnumFacing face, Colour colour, UVTransformation t, Vertex5 v1, Vertex5 v2, Vertex5 v3, Vertex5 v4) {
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(format);
builder.setQuadTint(-1);
builder.setQuadOrientation(face);
builder.setTexture(sprite);
t.apply(v1.uv);
t.apply(v2.uv);
t.apply(v3.uv);
t.apply(v4.uv);
putVertex(builder, format, face, v1, colour);
putVertex(builder, format, face, v2, colour);
putVertex(builder, format, face, v3, colour);
putVertex(builder, format, face, v4, colour);
return copyQuad(builder.build());
}
示例4: putVertex
import codechicken.lib.colour.Colour; //导入依赖的package包/类
private static void putVertex(UnpackedBakedQuad.Builder builder, VertexFormat format, EnumFacing face, Vertex5 vert, Colour colour) {
for (int e = 0; e < format.getElementCount(); e++) {
VertexFormatElement element = format.getElement(e);
switch (element.getUsage()) {
case POSITION:
Vector3 vec = vert.vec;
builder.put(e, (float) vec.x, (float) vec.y, (float) vec.z, 1);
break;
case NORMAL:
builder.put(e, face.getFrontOffsetX(), face.getFrontOffsetY(), face.getFrontOffsetZ(), 0);
break;
case COLOR:
builder.put(e, (colour.r & 0xFF) / 255F, (colour.g & 0xFF) / 255F, (colour.b & 0xFF) / 255F, (colour.a & 0xFF) / 255F);
break;
case UV:
UV uv = vert.uv;
builder.put(e, (float) uv.u, (float) uv.v, 0, 1);
break;
default:
builder.put(e);
break;
}
}
}
示例5: drawLine
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public static void drawLine(int x1, int y1, int x2, int y2, float thickness, int colour) {
GlStateManager.glLineWidth(thickness);
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Colour.glColourARGB(colour);
Tessellator tess = Tessellator.getInstance();
BufferBuilder vb = tess.getBuffer();
vb.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION);
vb.pos(x1, y1, gui.getZLevel()).endVertex();
vb.pos(x2, y2, gui.getZLevel()).endVertex();
tess.draw();
GlStateManager.resetColor();
GlStateManager.disableBlend();
GlStateManager.enableTexture2D();
}
示例6: render
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public static void render(double x, double y, double z, Colour colour, double s, double u1, double v1, double u2, double v2) {
x -= Particle.interpPosX;
y -= Particle.interpPosY;
z -= Particle.interpPosZ;
float par3 = ActiveRenderInfo.getRotationX();
float par4 = ActiveRenderInfo.getRotationXZ();
float par5 = ActiveRenderInfo.getRotationZ();
float par6 = ActiveRenderInfo.getRotationYZ();
float par7 = ActiveRenderInfo.getRotationXY();
VertexBuffer b = Tessellator.getInstance().getBuffer();
b.pos((x - par3 * s - par6 * s), (y - par4 * s), (z - par5 * s - par7 * s)).tex(u2, v2).color(colour.r & 0xFF, colour.g & 0xFF, colour.b & 0xFF, colour.a & 0xFF).endVertex();
b.pos((x - par3 * s + par6 * s), (y + par4 * s), (z - par5 * s + par7 * s)).tex(u2, v1).color(colour.r & 0xFF, colour.g & 0xFF, colour.b & 0xFF, colour.a & 0xFF).endVertex();
b.pos((x + par3 * s + par6 * s), (y + par4 * s), (z + par5 * s + par7 * s)).tex(u1, v1).color(colour.r & 0xFF, colour.g & 0xFF, colour.b & 0xFF, colour.a & 0xFF).endVertex();
b.pos((x + par3 * s - par6 * s), (y - par4 * s), (z + par5 * s - par7 * s)).tex(u1, v2).color(colour.r & 0xFF, colour.g & 0xFF, colour.b & 0xFF, colour.a & 0xFF).endVertex();
}
示例7: renderItem
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public void renderItem(int metadata)
{
TextureUtils.bindAtlas(0);
CCRenderState.reset();
CCRenderState.startDrawing();
CCRenderState.hasColour = true;
EnumColor c = EnumColor.DYES[metadata];
Colour colour = new ColourRGBA(c.getColor(0), c.getColor(1), c.getColor(2), 1);
Colour white = new ColourRGBA(1.0, 1.0, 1.0, 1.0);
for(int i = 4; i < 5; i++)
{
frameModels[i].render(new IconTransformation(icon), new ColourMultiplier(white.rgba()));
lightModels[i].render(new IconTransformation(icon), new ColourMultiplier(colour.rgba()));
}
CCRenderState.draw();
}
示例8: getColour
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public Colour getColour(int freq)
{
if(RedstoneEther.get(true).isPlayerJammed(mc.player) || !RedstoneEther.get(true).canBroadcastOnFrequency(mc.player, freq))
return colourJammed;
return colourOff.copy().interpolate(colourOn, brightness[freq-1] / 64F);
}
示例9: getBorder
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public Colour getBorder(int freq)
{
if(RedstoneEther.get(true).isPlayerJammed(mc.player) || !RedstoneEther.get(true).canBroadcastOnFrequency(mc.player, freq))
{
return borderJammed;
}
else if(RedstoneEther.get(true).getFreqColourId(freq) != -1)
{
return new ColourARGB(RedstoneEther.get(true).getFreqColour(freq));
}
else
{
return borderOff.copy().interpolate(borderOn, brightness[freq-1] / 64F);
}
}
示例10: getColour
import codechicken.lib.colour.Colour; //导入依赖的package包/类
@Override
public Colour getColour(int freq)
{
if(RedstoneEther.get(true).isPlayerJammed(mc.player) || !RedstoneEther.get(true).canBroadcastOnFrequency(mc.player, freq))
return colourJammed;
if(RedstoneEther.get(true).isFreqPrivate(freq) && RedstoneEther.get(true).getFreqOwner(freq).equalsIgnoreCase(mc.player.getName()))
return colourPOff.copy().interpolate(colourPOn, brightness[freq-1] / 64F);
Colour colour = colourOff.copy().interpolate(colourOn, brightness[freq-1] / 64F);
if(freq <= RedstoneEther.get(true).getLastPublicFrequency())
colour.interpolate(colourJammed, 0.5);
return colour;
}
示例11: mergeTexturesWithColour
import codechicken.lib.colour.Colour; //导入依赖的package包/类
private static void mergeTexturesWithColour(ColourARGB texcolour) {
for (int i = 0; i < 256; i++) {
Colour colour;
if (texGrad[i].a == 0) {
colour = texRing[i];
} else {
colour = texGrad[i].copy().multiply(texcolour);
}
imageData[i] = colour.argb();
}
}
示例12: mergeTexturesWithColour
import codechicken.lib.colour.Colour; //导入依赖的package包/类
private static void mergeTexturesWithColour(Colour texcolour, boolean on) {
for (int i = 0; i < 256; i++) {
Colour colour;
if (texGrad[i].a == 0) {
colour = on ? texOn[i] : texOff[i];
} else {
colour = texGrad[i].copy().multiply(texcolour);
}
imageData[i] = colour.argb();
}
}
示例13: loadTextureColours
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public static Colour[] loadTextureColours(ResourceLocation resource) {
int[] idata = loadTextureData(resource);
Colour[] data = new Colour[idata.length];
for (int i = 0; i < data.length; i++)
data[i] = new ColourARGB(idata[i]);
return data;
}
示例14: setColourRGB
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public void setColourRGB(Colour c)
{
String s = Long.toString(((long)c.rgb()) << 32 >>> 32, 16);
while(s.length() < 6)
s = "0"+s;
setValue("0x"+s.toUpperCase());
}
示例15: apply
import codechicken.lib.colour.Colour; //导入依赖的package包/类
public TripleABC<Integer, Integer, ?> apply(LC lc, Colour colour) {
float[] a = ao(lc.side);
float f = (a[0] * lc.fa + a[1] * lc.fb + a[2] * lc.fc + a[3] * lc.fd);
int[] b = brightness(lc.side);
int finalColour = ColourRGBA.multiplyC(colour.rgba(), f);
int finalBright = (int) (b[0] * lc.fa + b[1] * lc.fb + b[2] * lc.fc + b[3] * lc.fd) & 0xFF00FF;
return new TripleABC<Integer, Integer, Object>(finalColour, finalBright, null);
}