QuadInstance.java

com.mojang.blaze3d.vertex.QuadInstance

信息

  • 全限定名:com.mojang.blaze3d.vertex.QuadInstance
  • 类型:public class
  • 包:com.mojang.blaze3d.vertex
  • 源码路径:src/main/java/com/mojang/blaze3d/vertex/QuadInstance.java
  • 起始行号:L10
  • 职责:

    TODO

字段/常量

  • color0

    • 类型: int
    • 修饰符: private
    • 源码定位: L11
    • 说明:

      TODO

  • color1

    • 类型: int
    • 修饰符: private
    • 源码定位: L12
    • 说明:

      TODO

  • color2

    • 类型: int
    • 修饰符: private
    • 源码定位: L13
    • 说明:

      TODO

  • color3

    • 类型: int
    • 修饰符: private
    • 源码定位: L14
    • 说明:

      TODO

  • lightCoords0

    • 类型: int
    • 修饰符: private
    • 源码定位: L15
    • 说明:

      TODO

  • lightCoords1

    • 类型: int
    • 修饰符: private
    • 源码定位: L16
    • 说明:

      TODO

  • lightCoords2

    • 类型: int
    • 修饰符: private
    • 源码定位: L17
    • 说明:

      TODO

  • lightCoords3

    • 类型: int
    • 修饰符: private
    • 源码定位: L18
    • 说明:

      TODO

  • overlayCoords

    • 类型: int
    • 修饰符: private
    • 源码定位: L19
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

下面的方法块按源码顺序生成。

public int getColor(int vertex) @ L21

  • 方法名:getColor
  • 源码定位:L21
  • 返回类型:int
  • 修饰符:public

参数:

  • vertex: int

说明:

TODO

public int getLightCoords(int vertex) @ L31

  • 方法名:getLightCoords
  • 源码定位:L31
  • 返回类型:int
  • 修饰符:public

参数:

  • vertex: int

说明:

TODO

public int getLightCoordsWithEmission(int vertex, int lightEmission) @ L41

  • 方法名:getLightCoordsWithEmission
  • 源码定位:L41
  • 返回类型:int
  • 修饰符:public

参数:

  • vertex: int
  • lightEmission: int

说明:

TODO

public int overlayCoords() @ L45

  • 方法名:overlayCoords
  • 源码定位:L45
  • 返回类型:int
  • 修饰符:public

参数:

说明:

TODO

public void setColor(int vertex, int color) @ L49

  • 方法名:setColor
  • 源码定位:L49
  • 返回类型:void
  • 修饰符:public

参数:

  • vertex: int
  • color: int

说明:

TODO

public void setLightCoords(int vertex, int lightCoords) @ L68

  • 方法名:setLightCoords
  • 源码定位:L68
  • 返回类型:void
  • 修饰符:public

参数:

  • vertex: int
  • lightCoords: int

说明:

TODO

public void setColor(int color) @ L87

  • 方法名:setColor
  • 源码定位:L87
  • 返回类型:void
  • 修饰符:public

参数:

  • color: int

说明:

TODO

public void setLightCoords(int lightCoords) @ L94

  • 方法名:setLightCoords
  • 源码定位:L94
  • 返回类型:void
  • 修饰符:public

参数:

  • lightCoords: int

说明:

TODO

public void setOverlayCoords(int overlayCoords) @ L101

  • 方法名:setOverlayCoords
  • 源码定位:L101
  • 返回类型:void
  • 修饰符:public

参数:

  • overlayCoords: int

说明:

TODO

public void multiplyColor(int color) @ L105

  • 方法名:multiplyColor
  • 源码定位:L105
  • 返回类型:void
  • 修饰符:public

参数:

  • color: int

说明:

TODO

public void scaleColor(float scale) @ L112

  • 方法名:scaleColor
  • 源码定位:L112
  • 返回类型:void
  • 修饰符:public

参数:

  • scale: float

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class QuadInstance {
    private int color0 = -1;
    private int color1 = -1;
    private int color2 = -1;
    private int color3 = -1;
    private int lightCoords0 = 15728880;
    private int lightCoords1 = 15728880;
    private int lightCoords2 = 15728880;
    private int lightCoords3 = 15728880;
    private int overlayCoords = OverlayTexture.NO_OVERLAY;
 
    public int getColor(int vertex) {
        return switch (vertex) {
            case 0 -> this.color0;
            case 1 -> this.color1;
            case 2 -> this.color2;
            case 3 -> this.color3;
            default -> throw new IndexOutOfBoundsException();
        };
    }
 
    public int getLightCoords(int vertex) {
        return switch (vertex) {
            case 0 -> this.lightCoords0;
            case 1 -> this.lightCoords1;
            case 2 -> this.lightCoords2;
            case 3 -> this.lightCoords3;
            default -> throw new IndexOutOfBoundsException();
        };
    }
 
    public int getLightCoordsWithEmission(int vertex, int lightEmission) {
        return LightCoordsUtil.lightCoordsWithEmission(this.getLightCoords(vertex), lightEmission);
    }
 
    public int overlayCoords() {
        return this.overlayCoords;
    }
 
    public void setColor(int vertex, int color) {
        switch (vertex) {
            case 0:
                this.color0 = color;
                break;
            case 1:
                this.color1 = color;
                break;
            case 2:
                this.color2 = color;
                break;
            case 3:
                this.color3 = color;
                break;
            default:
                throw new IndexOutOfBoundsException();
        }
    }
 
    public void setLightCoords(int vertex, int lightCoords) {
        switch (vertex) {
            case 0:
                this.lightCoords0 = lightCoords;
                break;
            case 1:
                this.lightCoords1 = lightCoords;
                break;
            case 2:
                this.lightCoords2 = lightCoords;
                break;
            case 3:
                this.lightCoords3 = lightCoords;
                break;
            default:
                throw new IndexOutOfBoundsException();
        }
    }
 
    public void setColor(int color) {
        this.color0 = color;
        this.color1 = color;
        this.color2 = color;
        this.color3 = color;
    }
 
    public void setLightCoords(int lightCoords) {
        this.lightCoords0 = lightCoords;
        this.lightCoords1 = lightCoords;
        this.lightCoords2 = lightCoords;
        this.lightCoords3 = lightCoords;
    }
 
    public void setOverlayCoords(int overlayCoords) {
        this.overlayCoords = overlayCoords;
    }
 
    public void multiplyColor(int color) {
        this.color0 = ARGB.multiply(this.color0, color);
        this.color1 = ARGB.multiply(this.color1, color);
        this.color2 = ARGB.multiply(this.color2, color);
        this.color3 = ARGB.multiply(this.color3, color);
    }
 
    public void scaleColor(float scale) {
        this.color0 = ARGB.scaleRGB(this.color0, scale);
        this.color1 = ARGB.scaleRGB(this.color1, scale);
        this.color2 = ARGB.scaleRGB(this.color2, scale);
        this.color3 = ARGB.scaleRGB(this.color3, scale);
    }
}

引用的其他类

  • ARGB

    • 引用位置: 方法调用
    • 关联成员: ARGB.multiply(), ARGB.scaleRGB()
  • LightCoordsUtil

    • 引用位置: 方法调用
    • 关联成员: LightCoordsUtil.lightCoordsWithEmission()