本文整理汇总了Java中codechicken.lib.colour.ColourRGBA类的典型用法代码示例。如果您正苦于以下问题:Java ColourRGBA类的具体用法?Java ColourRGBA怎么用?Java ColourRGBA使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColourRGBA类属于codechicken.lib.colour包,在下文中一共展示了ColourRGBA类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: renderItem
import codechicken.lib.colour.ColourRGBA; //导入依赖的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();
}
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:20,代码来源:RenderGlowPanel.java
示例2: operate
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
@Override
public void operate() {
if(colourRef != null)
setColour(ColourRGBA.multiply(baseColour, colourRef[vertexIndex]));
else
setColour(baseColour);
}
开发者ID:4Space,项目名称:4Space-5,代码行数:8,代码来源:CCRenderState.java
示例3: getColourRGB
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
public Colour getColourRGB()
{
Matcher matcherRGB = patternRGB.matcher(getValue().replaceAll("\\s", ""));
if(matcherRGB.matches())
{
return new ColourRGBA(
Integer.parseInt(matcherRGB.group(1)),
Integer.parseInt(matcherRGB.group(2)),
Integer.parseInt(matcherRGB.group(3)),
0xFF);
}
return new ColourRGBA(getHexValue()<<8|0xFF);
}
开发者ID:4Space,项目名称:4Space-5,代码行数:15,代码来源:ConfigTag.java
示例4: operate
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
@Override
public void operate() {
LC lc = CCRenderState.lc;
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);
CCRenderState.setColour(ColourRGBA.multiplyC(CCRenderState.colour, f));
CCRenderState.setBrightness((int) (b[0] * lc.fa + b[1] * lc.fb + b[2] * lc.fc + b[3] * lc.fd) & 0xFF00FF);
}
开发者ID:4Space,项目名称:4Space-5,代码行数:10,代码来源:LightMatrix.java
示例5: apply
import codechicken.lib.colour.ColourRGBA; //导入依赖的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);
}
开发者ID:TheCBProject,项目名称:CCTweaks,代码行数:9,代码来源:AOLightMatrix.java
示例6: operate
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
@Override
public void operate(CCRenderState state) {
if (colourRef != null) {
state.colour = ColourRGBA.multiply(state.baseColour, colourRef[state.vertexIndex]);
} else {
state.colour = state.baseColour;
}
}
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:9,代码来源:ColourAttribute.java
示例7: operate
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
@Override
public void operate(CCRenderState state) {
LC lc = state.lc;
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);
state.colour = ColourRGBA.multiplyC(state.colour, f);
state.brightness = (int) (b[0] * lc.fa + b[1] * lc.fb + b[2] * lc.fc + b[3] * lc.fd) & 0xFF00FF;
}
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:10,代码来源:LightMatrix.java
示例8: blendOnto
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
public ColourTemperature blendOnto(ColourRGBA baseColour)
{
double sR = (r & 0xFF)/255D, sG = (g & 0xFF)/255D, sB = (b & 0xFF)/255D, sA = (a & 0xFF)/255D;
double dR = (baseColour.r & 0xFF)/255D, dG = (baseColour.g & 0xFF)/255D, dB = (baseColour.b & 0xFF)/255D, dA = (baseColour.a & 0xFF)/255D;
double rR = sR * sA + dR * (1-sA);
double rG = sG * sA + dG * (1-sA);
double rB = sB * sA + dB * (1-sA);
double rA = dA * 1D + sA * (1-dA);
return new ColourTemperature(rR, rG, rB, rA, temp);
}
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:13,代码来源:ColourTemperature.java
示例9: renderStatic
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
public void renderStatic(PartGlowPanel panel)
{
CCRenderState.reset();
CCRenderState.setBrightness(panel.world(), panel.x(), panel.y(), panel.z());
Colour colour = new ColourRGBA(panel.colour.getColor(0), panel.colour.getColor(1), panel.colour.getColor(2), 1);
int side = panel.side.ordinal();
frameModels[side].render(new Translation(panel.x(), panel.y(), panel.z()), new IconTransformation(icon));
lightModels[side].render(new Translation(panel.x(), panel.y(), panel.z()), new IconTransformation(icon), new ColourMultiplier(colour.rgba()));
}
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:12,代码来源:RenderGlowPanel.java
示例10: HeatMaterial
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
private HeatMaterial(double inversek, double inverseC, double insulationInversek, ColourRGBA colour)
{
inverseConduction = inversek;
inverseHeatCapacity = inverseC;
inverseConductionInsulation = insulationInversek;
baseColour = colour;
}
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:8,代码来源:MultipartHeatTransmitter.java
示例11: operate
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
@Override
public void operate()
{
if (colourRef != null)
{
setColour(ColourRGBA.multiply(baseColour, colourRef[vertexIndex]));
} else
{
setColour(baseColour);
}
}
开发者ID:Darkona,项目名称:AdventureBackpack2,代码行数:12,代码来源:CCRenderState.java
示例12: operate
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
@Override
public void operate()
{
LC lc = CCRenderState.lc;
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);
CCRenderState.setColour(ColourRGBA.multiplyC(CCRenderState.colour, f));
CCRenderState.setBrightness((int) (b[0] * lc.fa + b[1] * lc.fb + b[2] * lc.fc + b[3] * lc.fd) & 0xFF00FF);
}
开发者ID:Darkona,项目名称:AdventureBackpack2,代码行数:11,代码来源:LightMatrix.java
示例13: operate
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
@Override
public void operate() {
CCRenderState.setColour(ColourRGBA.multiply(CCRenderState.colour, colour));
}
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:ColourMultiplier.java
示例14: operate
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
@Override
public void operate() {
CCRenderState.setColour(ColourRGBA.multiply(CCRenderState.colour, colours[CCRenderState.side]));
}
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:PlanarLightModel.java
示例15: onTick
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
public void onTick()
{
int var2;
float var3;
int var5;
int var6;
int var7;
int var8;
int var9;
for (int var1 = 0; var1 < tileSizeBase; ++var1)
{
for (var2 = 0; var2 < tileSizeBase; ++var2)
{
var3 = 0.0F;
int var4 = (int)(MathHelper.sin(var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
var5 = (int)(MathHelper.sin(var1 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
for (var6 = var1 - 1; var6 <= var1 + 1; ++var6)
{
for (var7 = var2 - 1; var7 <= var2 + 1; ++var7)
{
var8 = var6 + var4 & tileSizeMask;
var9 = var7 + var5 & tileSizeMask;
var3 += this.field_76876_g[var8 + var9 * tileSizeBase];
}
}
this.field_76878_h[var1 + var2 * tileSizeBase] = var3 / 10.0F + (this.field_76879_i[(var1 + 0 & tileSizeMask) + (var2 + 0 & tileSizeMask) * tileSizeBase] + this.field_76879_i[(var1 + 1 & tileSizeMask) + (var2 + 0 & tileSizeMask) * tileSizeBase] + this.field_76879_i[(var1 + 1 & tileSizeMask) + (var2 + 1 & tileSizeMask) * tileSizeBase] + this.field_76879_i[(var1 + 0 & tileSizeMask) + (var2 + 1 & tileSizeMask) * tileSizeBase]) / 4.0F * 0.8F;
this.field_76879_i[var1 + var2 * tileSizeBase] += this.field_76877_j[var1 + var2 * tileSizeBase] * 0.01F;
if (this.field_76879_i[var1 + var2 * tileSizeBase] < 0.0F)
{
this.field_76879_i[var1 + var2 * tileSizeBase] = 0.0F;
}
this.field_76877_j[var1 + var2 * tileSizeBase] -= 0.06F;
if (Math.random() < 0.005D)
{
this.field_76877_j[var1 + var2 * tileSizeBase] = 1.5F;
}
}
}
float[] var11 = this.field_76878_h;
this.field_76878_h = this.field_76876_g;
this.field_76876_g = var11;
for (var2 = 0; var2 < tileSizeSquare; ++var2)
{
var3 = this.field_76876_g[var2] * 2.0F;
if (var3 > 1.0F)
{
var3 = 1.0F;
}
if (var3 < 0.0F)
{
var3 = 0.0F;
}
var5 = (int)(var3 * 100.0F + 155.0F);
var6 = (int)(var3 * var3 * 255.0F);
var7 = (int)(var3 * var3 * var3 * var3 * 128.0F);
if (this.anaglyphEnabled)
{
var8 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
var9 = (var5 * 30 + var6 * 70) / 100;
int var10 = (var5 * 30 + var7 * 70) / 100;
var5 = var8;
var6 = var9;
var7 = var10;
}
imageData[var2] = new ColourRGBA(var5, var6, var7, -1).argb();
}
}
开发者ID:4Space,项目名称:4Space-5,代码行数:81,代码来源:TextureLavaFX.java
示例16: writeColour
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
private void writeColour(int px, int py, int var5, int var6, int var7, int var8)
{
imageData[py*32+px] = new ColourRGBA(var5, var6, var7, var8).argb();
}
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:TextureWaterFlowFX.java
示例17: onTick
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
public void onTick() {
int var2;
float var3;
int var5;
int var6;
int var7;
int var8;
int var9;
for (int var1 = 0; var1 < tileSizeBase; ++var1) {
for (var2 = 0; var2 < tileSizeBase; ++var2) {
var3 = 0.0F;
int var4 = (int) (MathHelper.sin(var2 * (float) Math.PI * 2.0F / 16.0F) * 1.2F);
var5 = (int) (MathHelper.sin(var1 * (float) Math.PI * 2.0F / 16.0F) * 1.2F);
for (var6 = var1 - 1; var6 <= var1 + 1; ++var6) {
for (var7 = var2 - 1; var7 <= var2 + 1; ++var7) {
var8 = var6 + var4 & tileSizeMask;
var9 = var7 + var5 & tileSizeMask;
var3 += this.field_76876_g[var8 + var9 * tileSizeBase];
}
}
this.field_76878_h[var1 + var2 * tileSizeBase] = var3 / 10.0F + (this.field_76879_i[(var1 + 0 & tileSizeMask) + (var2 + 0 & tileSizeMask) * tileSizeBase] + this.field_76879_i[(var1 + 1 & tileSizeMask) + (var2 + 0 & tileSizeMask) * tileSizeBase] + this.field_76879_i[(var1 + 1 & tileSizeMask) + (var2 + 1 & tileSizeMask) * tileSizeBase] + this.field_76879_i[(var1 + 0 & tileSizeMask) + (var2 + 1 & tileSizeMask) * tileSizeBase]) / 4.0F * 0.8F;
this.field_76879_i[var1 + var2 * tileSizeBase] += this.field_76877_j[var1 + var2 * tileSizeBase] * 0.01F;
if (this.field_76879_i[var1 + var2 * tileSizeBase] < 0.0F) {
this.field_76879_i[var1 + var2 * tileSizeBase] = 0.0F;
}
this.field_76877_j[var1 + var2 * tileSizeBase] -= 0.06F;
if (Math.random() < 0.005D) {
this.field_76877_j[var1 + var2 * tileSizeBase] = 1.5F;
}
}
}
float[] var11 = this.field_76878_h;
this.field_76878_h = this.field_76876_g;
this.field_76876_g = var11;
for (var2 = 0; var2 < tileSizeSquare; ++var2) {
var3 = this.field_76876_g[var2] * 2.0F;
if (var3 > 1.0F) {
var3 = 1.0F;
}
if (var3 < 0.0F) {
var3 = 0.0F;
}
var5 = (int) (var3 * 100.0F + 155.0F);
var6 = (int) (var3 * var3 * 255.0F);
var7 = (int) (var3 * var3 * var3 * var3 * 128.0F);
if (this.anaglyphEnabled) {
var8 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
var9 = (var5 * 30 + var6 * 70) / 100;
int var10 = (var5 * 30 + var7 * 70) / 100;
var5 = var8;
var6 = var9;
var7 = var10;
}
imageData[var2] = new ColourRGBA(var5, var6, var7, -1).argb();
}
}
开发者ID:TheCBProject,项目名称:CCTweaks,代码行数:70,代码来源:TextureLavaFX.java
示例18: writeColour
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
private void writeColour(int px, int py, int var5, int var6, int var7, int var8) {
imageData[py * 32 + px] = new ColourRGBA(var5, var6, var7, var8).argb();
}
开发者ID:TheCBProject,项目名称:CCTweaks,代码行数:4,代码来源:TextureLavaFlowFX.java
示例19: onTick
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
public void onTick() {
int var1;
int var2;
float var3;
int r;
int g;
for (var1 = 0; var1 < tileSizeBase; ++var1) {
for (var2 = 0; var2 < tileSizeBase; ++var2) {
var3 = 0.0F;
for (int var4 = var1 - 1; var4 <= var1 + 1; ++var4) {
r = var4 & tileSizeMask;
g = var2 & tileSizeMask;
var3 += this.red[r + g * tileSizeBase];
}
this.green[var1 + var2 * tileSizeBase] = var3 / 3.3F + this.blue[var1 + var2 * tileSizeBase] * 0.8F;
}
}
for (var1 = 0; var1 < tileSizeBase; ++var1) {
for (var2 = 0; var2 < tileSizeBase; ++var2) {
this.blue[var1 + var2 * tileSizeBase] += this.alpha[var1 + var2 * tileSizeBase] * 0.05F;
if (this.blue[var1 + var2 * tileSizeBase] < 0.0F) {
this.blue[var1 + var2 * tileSizeBase] = 0.0F;
}
this.alpha[var1 + var2 * tileSizeBase] -= 0.1F;
if (Math.random() < 0.05D) {
this.alpha[var1 + var2 * tileSizeBase] = 0.5F;
}
}
}
float[] var12 = this.green;
this.green = this.red;
this.red = var12;
for (var2 = 0; var2 < tileSizeSquare; ++var2) {
var3 = this.red[var2];
if (var3 > 1.0F) {
var3 = 1.0F;
}
if (var3 < 0.0F) {
var3 = 0.0F;
}
float var13 = var3 * var3;
r = (int) (32.0F + var13 * 32.0F);
g = (int) (50.0F + var13 * 64.0F);
int b = 255;
int a = (int) (146.0F + var13 * 50.0F);
if (this.anaglyphEnabled) {
int var9 = (r * 30 + g * 59 + b * 11) / 100;
int var10 = (r * 30 + g * 70) / 100;
int var11 = (r * 30 + b * 70) / 100;
r = var9;
g = var10;
b = var11;
}
imageData[var2] = new ColourRGBA(r, g, b, a).argb();
}
}
开发者ID:TheCBProject,项目名称:CCTweaks,代码行数:71,代码来源:TextureWaterFX.java
示例20: renderQuad
import codechicken.lib.colour.ColourRGBA; //导入依赖的package包/类
private static void renderQuad(BakedQuad quad, IBlockAccess world, IBlockState state, BlockPos pos, VertexBuffer buffer, long rand, boolean useAO) {
AOLightMatrix matrix = new AOLightMatrix();
matrix.locate(world, pos, useAO);
CCQuad ccQuad = new CCQuad(quad);
ccQuad.quadulate();
ccQuad.computeNormals();
VertexFormat format = buffer.getVertexFormat();
BlockColors colours = Minecraft.getMinecraft().getBlockColors();
LightModel lightModel = quad.shouldApplyDiffuseLighting() ? standardLightModel : noDifuseLightModel;
int quadTintRenderPass = quad.getTintIndex();
int tintMultiplier = -1;
if (quadTintRenderPass != -1) {
tintMultiplier = colours.colorMultiplier(state, world, pos, quadTintRenderPass);
}
for (int v = 0; v < 4; v++) {
Vertex5 vert = ccQuad.vertices[v].copy();
Vector3 normal = ccQuad.normals[v].copy();
Colour colour = ccQuad.colours[v].copy().multiply(new ColourRGBA(lightModel.apply(tintMultiplier, normal)));
LC lc = new LC();
lc.compute(vert.vec, normal);
TripleABC<Integer, Integer, ?> lm = matrix.apply(lc, colour);
int finalColour = lm.getA();
int brightness = lm.getB();
for (int e = 0; e < format.getElementCount(); e++) {
VertexFormatElement element = format.getElement(e);
switch (element.getUsage()){
case POSITION:
buffer.pos(vert.vec.x, vert.vec.y, vert.vec.z);
break;
case UV:
if (element.getIndex() == 0) {
buffer.tex(vert.uv.u, vert.uv.v);
} else {
buffer.lightmap(brightness >> 16 & 65535, brightness & 65535);
}
break;
case COLOR:
buffer.color(finalColour >>> 24, finalColour >> 16 & 0xFF, finalColour >> 8 & 0xFF, finalColour & 0xFF);
break;
case NORMAL:
buffer.normal((float) normal.x, (float) normal.y, (float) normal.z);
break;
case PADDING:
break;
default:
throw new UnsupportedOperationException("Generic vertex format element");
}
}
buffer.endVertex();
}
buffer.putPosition(pos.getX(), pos.getY(), pos.getZ());
}
开发者ID:TheCBProject,项目名称:CCTweaks,代码行数:53,代码来源:RenderHooks.java
注:本文中的codechicken.lib.colour.ColourRGBA类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论