CompactVectorArray.java

com.mojang.blaze3d.vertex.CompactVectorArray

信息

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

    TODO

字段/常量

  • contents
    • 类型: float[]
    • 修饰符: private final
    • 源码定位: L10
    • 说明:

      TODO

内部类/嵌套类型

构造器

public CompactVectorArray(int count) @ L12

  • 构造器名:CompactVectorArray
  • 源码定位:L12
  • 修饰符:public

参数:

  • count: int

说明:

TODO

方法

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

public int size() @ L16

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

参数:

说明:

TODO

public void set(int index, Vector3fc v) @ L20

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

参数:

  • index: int
  • v: Vector3fc

说明:

TODO

public void set(int index, float x, float y, float z) @ L24

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

参数:

  • index: int
  • x: float
  • y: float
  • z: float

说明:

TODO

public Vector3f get(int index, Vector3f output) @ L30

  • 方法名:get
  • 源码定位:L30
  • 返回类型:Vector3f
  • 修饰符:public

参数:

  • index: int
  • output: Vector3f

说明:

TODO

public float getX(int index) @ L34

  • 方法名:getX
  • 源码定位:L34
  • 返回类型:float
  • 修饰符:public

参数:

  • index: int

说明:

TODO

public float getY(int index) @ L38

  • 方法名:getY
  • 源码定位:L38
  • 返回类型:float
  • 修饰符:public

参数:

  • index: int

说明:

TODO

public float getZ(int index) @ L42

  • 方法名:getZ
  • 源码定位:L42
  • 返回类型:float
  • 修饰符:public

参数:

  • index: int

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class CompactVectorArray {
    private final float[] contents;
 
    public CompactVectorArray(int count) {
        this.contents = new float[3 * count];
    }
 
    public int size() {
        return this.contents.length / 3;
    }
 
    public void set(int index, Vector3fc v) {
        this.set(index, v.x(), v.y(), v.z());
    }
 
    public void set(int index, float x, float y, float z) {
        this.contents[3 * index + 0] = x;
        this.contents[3 * index + 1] = y;
        this.contents[3 * index + 2] = z;
    }
 
    public Vector3f get(int index, Vector3f output) {
        return output.set(this.contents[3 * index + 0], this.contents[3 * index + 1], this.contents[3 * index + 2]);
    }
 
    public float getX(int index) {
        return this.contents[3 * index + 0];
    }
 
    public float getY(int index) {
        return this.contents[3 * index + 1];
    }
 
    public float getZ(int index) {
        return this.contents[3 * index + 1];
    }
}

引用的其他类