private void makeRadialWall(
      DrawContext dc,
      double[] radii,
      double angle,
      double[] altitudes,
      boolean[] terrainConformant,
      int pillars,
      int stacks,
      int orientation,
      Vec4 referenceCenter,
      Geometry dest) {
    GeometryBuilder gb = this.getGeometryBuilder();
    gb.setOrientation(orientation);
    float height = (float) (altitudes[1] - altitudes[0]);

    int count = gb.getRadialWallVertexCount(pillars, stacks);
    int numCoords = 3 * count;
    float[] verts = new float[numCoords];
    float[] norms = new float[numCoords];
    gb.makeRadialWallVertices(
        (float) radii[0], (float) radii[1], height, (float) angle, pillars, stacks, verts);
    this.makeRadialWallTerrainConformant(
        dc, pillars, stacks, verts, altitudes, terrainConformant, referenceCenter);
    gb.makeRadialWallNormals(
        (float) radii[0], (float) radii[1], height, (float) angle, pillars, stacks, norms);

    dest.setVertexData(count, verts);
    dest.setNormalData(count, norms);
  }
  private void makePartialCylinder(
      DrawContext dc,
      double radius,
      double[] altitudes,
      boolean[] terrainConformant,
      int slices,
      int stacks,
      int orientation,
      double start,
      double sweep,
      Vec4 referenceCenter,
      Geometry dest) {
    GeometryBuilder gb = this.getGeometryBuilder();
    gb.setOrientation(orientation);
    float height = (float) (altitudes[1] - altitudes[0]);

    int count = gb.getPartialCylinderVertexCount(slices, stacks);
    int numCoords = 3 * count;
    float[] verts = new float[numCoords];
    float[] norms = new float[numCoords];
    gb.makePartialCylinderVertices(
        (float) radius, height, slices, stacks, (float) start, (float) sweep, verts);
    gb.makePartialCylinderNormals(
        (float) radius, height, slices, stacks, (float) start, (float) sweep, norms);
    this.makePartialCylinderTerrainConformant(
        dc, slices, stacks, verts, altitudes, terrainConformant, referenceCenter);

    dest.setVertexData(count, verts);
    dest.setNormalData(count, norms);
  }
示例#3
0
  private void makeEdge(
      DrawContext dc,
      int count,
      float[] locations,
      Boolean[] edgeFlags,
      double[] altitudes,
      boolean[] terrainConformant,
      int subdivisions,
      int orientation,
      Matrix locationTransform,
      Vec4 referenceCenter,
      int fillIndexPos,
      int[] fillIndices,
      int outlineIndexPos,
      int[] outlineIndices,
      int vertexPos,
      float[] vertices,
      float[] normals) {
    GeometryBuilder gb = this.getGeometryBuilder();
    gb.setOrientation(orientation);

    int sectionFillIndexCount = this.getSectionFillIndexCount(subdivisions);
    int sectionVertexCount = this.getSectionVertexCount(subdivisions);

    for (int i = 0; i < count - 1; i++) {
      boolean beginEdgeFlag = edgeFlags[i];
      boolean endEdgeFlag = edgeFlags[i + 1];

      this.makeSectionFillIndices(subdivisions, vertexPos, fillIndexPos, fillIndices);
      this.makeSectionOutlineIndices(
          subdivisions, vertexPos, outlineIndexPos, outlineIndices, beginEdgeFlag, endEdgeFlag);
      this.makeSectionVertices(
          dc,
          i,
          locations,
          altitudes,
          terrainConformant,
          subdivisions,
          locationTransform,
          referenceCenter,
          vertexPos,
          vertices);
      gb.makeIndexedTriangleArrayNormals(
          fillIndexPos,
          sectionFillIndexCount,
          fillIndices,
          vertexPos,
          sectionVertexCount,
          vertices,
          normals);

      fillIndexPos += sectionFillIndexCount;
      outlineIndexPos += this.getSectionOutlineIndexCount(subdivisions, beginEdgeFlag, endEdgeFlag);
      vertexPos += sectionVertexCount;
    }
  }
  private void makeRadialWallIndices(int pillars, int stacks, int orientation, Geometry dest) {
    GeometryBuilder gb = this.getGeometryBuilder();
    gb.setOrientation(orientation);

    int mode = gb.getRadialWallDrawMode();
    int count = gb.getRadialWallIndexCount(pillars, stacks);
    int[] indices = new int[count];
    gb.makeRadialWallIndices(pillars, stacks, indices);

    dest.setElementData(mode, count, indices);
  }
  private void makePartialDiskIndices(int slices, int loops, int orientation, Geometry dest) {
    GeometryBuilder gb = this.getGeometryBuilder();
    gb.setOrientation(orientation);

    int mode = gb.getPartialDiskDrawMode();
    int count = gb.getPartialDiskIndexCount(slices, loops);
    int[] indices = new int[count];
    gb.makePartialDiskIndices(slices, loops, indices);

    dest.setElementData(mode, count, indices);
  }
  private void makePartialDisk(
      DrawContext dc,
      double[] radii,
      double altitude,
      boolean terrainConformant,
      int slices,
      int loops,
      int orientation,
      double start,
      double sweep,
      Vec4 referenceCenter,
      Geometry dest) {
    GeometryBuilder gb = this.getGeometryBuilder();
    gb.setOrientation(orientation);

    int count = gb.getPartialDiskIndexCount(slices, loops);
    int numCoords = 3 * count;
    float[] verts = new float[numCoords];
    float[] norms = new float[numCoords];
    gb.makePartialDiskVertices(
        (float) radii[0], (float) radii[1], slices, loops, (float) start, (float) sweep, verts);
    this.makePartialDiskTerrainConformant(
        dc, numCoords, verts, altitude, terrainConformant, referenceCenter);
    gb.makePartialDiskVertexNormals(
        (float) radii[0],
        (float) radii[1],
        slices,
        loops,
        (float) start,
        (float) sweep,
        verts,
        norms);

    dest.setVertexData(count, verts);
    dest.setNormalData(count, norms);
  }