NASA World Wind

gov.nasa.worldwind.util
Class GeometryBuilder

java.lang.Object
  extended by gov.nasa.worldwind.util.GeometryBuilder

public class GeometryBuilder
extends Object


Nested Class Summary
static class GeometryBuilder.IndexedTriangleArray
           
static class GeometryBuilder.IndexedTriangleBuffer
           
 
Field Summary
static int BOTTOM
           
static int CLOCKWISE
           
static int COUNTER_CLOCKWISE
           
static int INSIDE
           
protected static int LEADER_LOCATION_BOTTOM
          Bit code indicating that the leader's location is below the rectangle.
protected static int LEADER_LOCATION_INSIDE
          Bit code indicating that the leader's location is inside the rectangle.
protected static int LEADER_LOCATION_LEFT
          Bit code indicating that the leader's location is to the left of the rectangle.
protected static int LEADER_LOCATION_RIGHT
          Bit code indicating that the leader's location is to the right of the rectangle.
protected static int LEADER_LOCATION_TOP
          Bit code indicating that the leader's location is above the rectangle.
static int LEFT
           
static int OUTSIDE
           
static int RIGHT
           
static int TOP
           
 
Constructor Summary
GeometryBuilder()
           
 
Method Summary
protected  void addRectangleRoundedCorner(float x, float y, float radius, float start, float sweep, int slices, FloatBuffer buffer)
          Adds the vertices for one rounded corner of a two-dimensional rectangular to the specified buffer.
protected  int computeLeaderLocationCode(float x1, float y1, float x2, float y2, float leaderX, float leaderY)
          Returns a four bit code indicating the leader's location within the specified rectangle.
 float computePolygonArea2(int pos, int count, Vec4[] points)
           
 int computePolygonWindingOrder2(int pos, int count, Vec4[] points)
           
 void fixSphereSeam(GeometryBuilder.IndexedTriangleBuffer itb, float wrapThreshold)
           
 int getBilinearSurfaceFillDrawMode()
           
 int getBilinearSurfaceFillIndexCount(int uStacks, int vStacks)
           
 int getBilinearSurfaceOutlineDrawMode()
           
 int getBilinearSurfaceOutlineIndexCount(int uStacks, int vStacks, int mask)
           
 int getBilinearSurfaceVertexCount(int uStacks, int vStacks)
           
 int getCylinderDrawMode()
           
 int getCylinderIndexCount(int slices, int stacks)
           
 int getCylinderOutlineDrawMode()
           
 int getCylinderOutlineIndexCount(int slices, int stacks)
           
 int getCylinderVertexCount(int slices, int stacks)
           
 int getDiskDrawMode()
           
 int getDiskIndexCount(int slices, int loops)
           
 int getDiskVertexCount(int slices, int loops)
           
 int getIndexedTriangleArrayDrawMode()
           
 int getIndexedTriangleBufferDrawMode()
           
 int getLongCylinderDrawMode()
           
 int getLongCylinderIndexCount(int arcSlices, int lengthSlices, int stacks)
           
 int getLongCylinderOutlineDrawMode()
           
 int getLongCylinderOutlineIndexCount(int arcSlices, int lengthSlices, int stacks)
           
 int getLongCylinderVertexCount(int arcSlices, int lengthSlices, int stacks)
           
 int getLongDiskDrawMode()
           
 int getLongDiskIndexCount(int arcSlices, int lengthSlices, int loops)
           
 int getLongDiskVertexCount(int arcSlices, int lengthSlices, int loops)
           
 int getOrientation()
           
 int getPartialCylinderDrawMode()
           
 int getPartialCylinderIndexCount(int slices, int stacks)
           
 int getPartialCylinderOutlineDrawMode()
           
 int getPartialCylinderOutlineIndexCount(int slices, int stacks)
           
 int getPartialCylinderVertexCount(int slices, int stacks)
           
 int getPartialDiskDrawMode()
           
 int getPartialDiskIndexCount(int slices, int loops)
           
 int getPartialDiskVertexCount(int slices, int loops)
           
 int getRadialWallDrawMode()
           
 int getRadialWallIndexCount(int pillars, int stacks)
           
 int getRadialWallOutlineDrawMode()
           
 int getRadialWallOutlineIndexCount(int pillars, int stacks)
           
 int getRadialWallVertexCount(int pillars, int stacks)
           
 int getSubdivisionPointsVertexCount(int subdivisions)
           
 void makeBilinearSurfaceFillIndices(int vertexPos, int uStacks, int vStacks, int destPos, int[] dest)
           
 void makeBilinearSurfaceOutlineIndices(int vertexPos, int uStacks, int vStacks, int mask, int destPos, int[] dest)
           
 void makeBilinearSurfaceVertexNormals(int srcPos, int uStacks, int vStacks, float[] srcVerts, int destPos, float[] dest)
           
 void makeBilinearSurfaceVertices(float[] control, int destPos, int uStacks, int vStacks, float[] dest)
           
 void makeCylinderIndices(int slices, int stacks, int[] dest)
           
 void makeCylinderNormals(GeometryBuilder.IndexedTriangleBuffer itb, FloatBuffer dest)
           
 void makeCylinderNormals(int slices, int stacks, float[] dest)
           
 void makeCylinderNormals(int indexPos, int indexCount, IntBuffer indices, int vertexPos, int vertexCount, FloatBuffer vertices, FloatBuffer dest)
           
 void makeCylinderOutlineIndices(int slices, int stacks, int[] dest)
           
 void makeCylinderVertices(float radius, float height, int slices, int stacks, float[] dest)
           
 void makeDiskIndices(int slices, int loops, int[] dest)
           
 void makeDiskNormals(int slices, int loops, float[] dest)
           
 void makeDiskVertexNormals(float innerRadius, float outerRadius, int slices, int loops, float[] srcVerts, float[] dest)
           
 void makeDiskVertices(float innerRadius, float outerRadius, int slices, int loops, float[] dest)
           
 FloatBuffer makeEllipse(float x, float y, float majorRadius, float minorRadius, int slices)
          Creates a vertex buffer for a two-dimensional ellipse centered at the specified location and with the specified radii.
 FloatBuffer makeEllipseWithLeader(float x, float y, float majorRadius, float minorRadius, int slices, float leaderX, float leaderY, float leaderWidth)
          Creates a vertex buffer for a two-dimensional ellipse centered at the specified location and with the specified radii.
 void makeEllipsoidNormals(GeometryBuilder.IndexedTriangleBuffer itb, FloatBuffer dest)
           
 void makeEllipsoidNormals(int indexPos, int indexCount, IntBuffer indices, int vertexPos, int vertexCount, FloatBuffer vertices, FloatBuffer dest)
           
 void makeIndexedTriangleArrayNormals(GeometryBuilder.IndexedTriangleArray ita, float[] dest)
           
 void makeIndexedTriangleArrayNormals(int indexPos, int indexCount, int[] indices, int vertexPos, int vertexCount, float[] vertices, float[] dest)
           
 void makeIndexedTriangleBufferNormals(GeometryBuilder.IndexedTriangleBuffer itb, FloatBuffer dest)
           
 void makeIndexedTriangleBufferNormals(int indexPos, int indexCount, IntBuffer indices, int vertexPos, int vertexCount, FloatBuffer vertices, FloatBuffer dest)
           
 void makeIndexedTriangleStripNormals(int indexPos, int indexCount, int[] indices, int vertexPos, int vertexCount, float[] vertices, float[] dest)
           
 void makeLongCylinderIndices(int arcSlices, int lengthSlices, int stacks, int[] dest)
           
 void makeLongCylinderNormals(int arcSlices, int lengthSlices, int stacks, float[] dest)
           
 void makeLongCylinderOutlineIndices(int arcSlices, int lengthSlices, int stacks, int[] dest)
           
 void makeLongCylinderVertices(float radius, float length, float height, int arcSlices, int lengthSlices, int stacks, float[] dest)
           
 void makeLongDiskIndices(int arcSlices, int lengthSlices, int loops, int[] dest)
           
 void makeLongDiskNormals(int arcSlices, int lengthSlices, int loops, float[] dest)
           
 void makeLongDiskVertexNormals(float innerRadius, float outerRadius, float length, int arcSlices, int lengthSlices, int loops, float[] srcVerts, float[] dest)
           
 void makeLongDiskVertices(float innerRadius, float outerRadius, float length, int arcSlices, int lengthSlices, int loops, float[] dest)
           
 void makePartialCylinderIndices(int slices, int stacks, int[] dest)
           
 void makePartialCylinderNormals(float radius, float height, int slices, int stacks, float start, float sweep, float[] dest)
           
 void makePartialCylinderOutlineIndices(int slices, int stacks, int[] dest)
           
 void makePartialCylinderVertices(float radius, float height, int slices, int stacks, float start, float sweep, float[] dest)
           
 void makePartialDiskIndices(int slices, int loops, int[] dest)
           
 void makePartialDiskNormals(int slices, int loops, float[] dest)
           
 void makePartialDiskVertexNormals(float innerRadius, float outerRadius, int slices, int loops, float start, float sweep, float[] srcVerts, float[] dest)
           
 void makePartialDiskVertices(float innerRadius, float outerRadius, int slices, int loops, float start, float sweep, float[] dest)
           
 void makeRadialWallIndices(int pillars, int stacks, int[] dest)
           
 void makeRadialWallNormals(float innerRadius, float outerRadius, float height, float angle, int pillars, int stacks, float[] dest)
           
 void makeRadialWallOutlineIndices(int pillars, int stacks, int[] dest)
           
 void makeRadialWallVertices(float innerRadius, float outerRadius, float height, float angle, int pillars, int stacks, float[] dest)
           
 FloatBuffer makeRectangle(float x, float y, float width, float height)
          Creates a vertex buffer for a two-dimensional rectangle at the specified location, and with the specified size.
 FloatBuffer makeRectangle(float x, float y, float width, float height, float cornerRadius, int cornerSlices)
          Creates a vertex buffer for a two-dimensional rectangle at the specified location, with the specified size, and with optionally rounded corners.
 FloatBuffer makeRectangleWithLeader(float x, float y, float width, float height, float leaderX, float leaderY, float leaderWidth)
          Creates a vertex buffer for a two-dimensional rectangle at the specified location, with the specified size, and with an optional leader pointing to the specified leader location.
 FloatBuffer makeRectangleWithLeader(float x, float y, float width, float height, float cornerRadius, int cornerSlices, float leaderX, float leaderY, float leaderWidth)
          Creates a vertex buffer for a two-dimensional rectangle at the specified location, with the specified size, and with optionally rounded corners.
 void makeSubdivisionPoints(float x1, float y1, float z1, float x2, float y2, float z2, int subdivisions, float[] dest)
           
 void makeUnitBoxTextureCoordinates(FloatBuffer texCoords, int vertexCount)
           
 void makeUnitBoxTextureCoordinates(int index, FloatBuffer texCoords, int vertexCount)
           
 void makeUnitConeTextureCoordinates(FloatBuffer texCoords, int subdivisions)
           
 void makeUnitConeTextureCoordinates(int face, FloatBuffer texCoords, int subdivisions)
           
 void makeUnitCylinderTextureCoordinates(int face, FloatBuffer texCoords, int subdivisions)
           
 void makeUnitPyramidTextureCoordinates(FloatBuffer texCoords, int vertexCount)
           
 void makeUnitPyramidTextureCoordinates(int index, FloatBuffer texCoords, int vertexCount)
           
 void makeUnitSphereTextureCoordinates(GeometryBuilder.IndexedTriangleBuffer itb, FloatBuffer texCoords)
           
 void makeUnitSphereTextureCoordinates(GeometryBuilder.IndexedTriangleBuffer itb, FloatBuffer texCoords, int seamVerticesIndex)
           
 void makeUnitSphereTextureCoordinates(int vertexCount, FloatBuffer vertices, FloatBuffer texCoords, int seamVerticesIndex)
           
 void makeUnitWedgeTextureCoordinates(int face, FloatBuffer texCoords, int subdivisions, Angle angle)
           
 void makeWedgeTextureCoordinates(FloatBuffer texCoords, int subdivisions, Angle angle)
           
<T> void
reversePoints(int pos, int count, T[] points)
           
 void setOrientation(int orientation)
           
 void subdivideIndexedTriangleArray(GeometryBuilder.IndexedTriangleArray ita)
           
 void subdivideIndexedTriangleBuffer(GeometryBuilder.IndexedTriangleBuffer itb)
           
 GeometryBuilder.IndexedTriangleArray subdivideIndexedTriangles(int indexCount, int[] indices, int vertexCount, float[] vertices)
           
 GeometryBuilder.IndexedTriangleBuffer tessellateBoxBuffer(float radius, int subdivisions)
           
 GeometryBuilder.IndexedTriangleBuffer tessellateBoxBuffer(int face, float radius, int subdivisions)
           
 GeometryBuilder.IndexedTriangleBuffer tessellateConeBuffer(float radius, int subdivisions)
           
 GeometryBuilder.IndexedTriangleBuffer tessellateConeBuffer(int face, float radius, int subdivisions)
           
 GeometryBuilder.IndexedTriangleBuffer tessellateCylinderBuffer(float radius, int subdivisions)
           
 GeometryBuilder.IndexedTriangleBuffer tessellateCylinderBuffer(int face, float radius, int subdivisions)
           
 GeometryBuilder.IndexedTriangleBuffer tessellateEllipsoidBuffer(float a, float b, float c, int subdivisions)
           
 GeometryBuilder.IndexedTriangleArray tessellatePolygon(int pos, int count, float[] vertices, Vec4 normal)
           
 GeometryBuilder.IndexedTriangleArray tessellatePolygon2(int pos, int count, float[] vertices)
           
 GeometryBuilder.IndexedTriangleBuffer tessellatePyramidBuffer(float radius, int subdivisions)
           
 GeometryBuilder.IndexedTriangleBuffer tessellatePyramidBuffer(int face, float radius, int subdivisions)
           
 GeometryBuilder.IndexedTriangleArray tessellateSphere(float radius, int subdivisions)
           
 GeometryBuilder.IndexedTriangleBuffer tessellateSphereBuffer(float radius, int subdivisions)
           
 GeometryBuilder.IndexedTriangleBuffer tessellateWedgeBuffer(float radius, int subdivisions, Angle angle)
           
 GeometryBuilder.IndexedTriangleBuffer tessellateWedgeBuffer(int face, float radius, int subdivisions, Angle angle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOTTOM

public static final int BOTTOM
See Also:
Constant Field Values

CLOCKWISE

public static final int CLOCKWISE
See Also:
Constant Field Values

COUNTER_CLOCKWISE

public static final int COUNTER_CLOCKWISE
See Also:
Constant Field Values

INSIDE

public static final int INSIDE
See Also:
Constant Field Values

LEADER_LOCATION_BOTTOM

protected static final int LEADER_LOCATION_BOTTOM
Bit code indicating that the leader's location is below the rectangle. Used by computeLeaderLocationCode(float, float, float, float, float, float).

See Also:
Constant Field Values

LEADER_LOCATION_INSIDE

protected static final int LEADER_LOCATION_INSIDE
Bit code indicating that the leader's location is inside the rectangle. Used by computeLeaderLocationCode(float, float, float, float, float, float).

See Also:
Constant Field Values

LEADER_LOCATION_LEFT

protected static final int LEADER_LOCATION_LEFT
Bit code indicating that the leader's location is to the left of the rectangle. Used by computeLeaderLocationCode(float, float, float, float, float, float).

See Also:
Constant Field Values

LEADER_LOCATION_RIGHT

protected static final int LEADER_LOCATION_RIGHT
Bit code indicating that the leader's location is to the right of the rectangle. Used by computeLeaderLocationCode(float, float, float, float, float, float).

See Also:
Constant Field Values

LEADER_LOCATION_TOP

protected static final int LEADER_LOCATION_TOP
Bit code indicating that the leader's location is above the rectangle. Used by computeLeaderLocationCode(float, float, float, float, float, float).

See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

OUTSIDE

public static final int OUTSIDE
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

TOP

public static final int TOP
See Also:
Constant Field Values
Constructor Detail

GeometryBuilder

public GeometryBuilder()
Method Detail

addRectangleRoundedCorner

protected void addRectangleRoundedCorner(float x,
                                         float y,
                                         float radius,
                                         float start,
                                         float sweep,
                                         int slices,
                                         FloatBuffer buffer)
Adds the vertices for one rounded corner of a two-dimensional rectangular to the specified buffer. This assumes that the first and last vertices of each corner are created by the caller, so this adds only the intermediate vertices. The number of intermediate vertices is equal to slices - 2. This does nothing if slices is one or zero.

Parameters:
x - the x-coordinate of the corner's origin.
y - the y-coordinate of the corner's origin.
radius - the corner's radius.
start - the corner's starting angle, in radians.
sweep - the corner's angular distance, in radians.
slices - the number of slices in the corner.
buffer - the buffer the corner's xy coordinates are added to.

computeLeaderLocationCode

protected int computeLeaderLocationCode(float x1,
                                        float y1,
                                        float x2,
                                        float y2,
                                        float leaderX,
                                        float leaderY)
Returns a four bit code indicating the leader's location within the specified rectangle. The rectangle's lower left corner is located at (x1, y1) and its upper right corner is located at (x2, y2). The returned code includes the bit for any of LEADER_LOCATION_LEFT, LEADER_LOCATION_RIGHT, LEADER_LOCATION_BOTTOM, and LEADER_LOCATION_TOP, depending on whether the leader is located to the left, right, bottom, or top of the rectangle. If the leader is inside the rectangle, this returns LEADER_LOCATION_INSIDE.

Parameters:
x1 - the rectangle's minimum x-coordinate.
y1 - the rectangle's maximum x-coordinate.
x2 - the rectangle's minimum y-coordinate.
y2 - the rectangle's maximum y-coordinate.
leaderX - the leader's x-coordinate.
leaderY - the leader's y-coordinate.
Returns:
a four bit code indicating the leader's location relative to the rectangle.

computePolygonArea2

public float computePolygonArea2(int pos,
                                 int count,
                                 Vec4[] points)

computePolygonWindingOrder2

public int computePolygonWindingOrder2(int pos,
                                       int count,
                                       Vec4[] points)

fixSphereSeam

public void fixSphereSeam(GeometryBuilder.IndexedTriangleBuffer itb,
                          float wrapThreshold)

getBilinearSurfaceFillDrawMode

public int getBilinearSurfaceFillDrawMode()

getBilinearSurfaceFillIndexCount

public int getBilinearSurfaceFillIndexCount(int uStacks,
                                            int vStacks)

getBilinearSurfaceOutlineDrawMode

public int getBilinearSurfaceOutlineDrawMode()

getBilinearSurfaceOutlineIndexCount

public int getBilinearSurfaceOutlineIndexCount(int uStacks,
                                               int vStacks,
                                               int mask)

getBilinearSurfaceVertexCount

public int getBilinearSurfaceVertexCount(int uStacks,
                                         int vStacks)

getCylinderDrawMode

public int getCylinderDrawMode()

getCylinderIndexCount

public int getCylinderIndexCount(int slices,
                                 int stacks)

getCylinderOutlineDrawMode

public int getCylinderOutlineDrawMode()

getCylinderOutlineIndexCount

public int getCylinderOutlineIndexCount(int slices,
                                        int stacks)

getCylinderVertexCount

public int getCylinderVertexCount(int slices,
                                  int stacks)

getDiskDrawMode

public int getDiskDrawMode()

getDiskIndexCount

public int getDiskIndexCount(int slices,
                             int loops)

getDiskVertexCount

public int getDiskVertexCount(int slices,
                              int loops)

getIndexedTriangleArrayDrawMode

public int getIndexedTriangleArrayDrawMode()

getIndexedTriangleBufferDrawMode

public int getIndexedTriangleBufferDrawMode()

getLongCylinderDrawMode

public int getLongCylinderDrawMode()

getLongCylinderIndexCount

public int getLongCylinderIndexCount(int arcSlices,
                                     int lengthSlices,
                                     int stacks)

getLongCylinderOutlineDrawMode

public int getLongCylinderOutlineDrawMode()

getLongCylinderOutlineIndexCount

public int getLongCylinderOutlineIndexCount(int arcSlices,
                                            int lengthSlices,
                                            int stacks)

getLongCylinderVertexCount

public int getLongCylinderVertexCount(int arcSlices,
                                      int lengthSlices,
                                      int stacks)

getLongDiskDrawMode

public int getLongDiskDrawMode()

getLongDiskIndexCount

public int getLongDiskIndexCount(int arcSlices,
                                 int lengthSlices,
                                 int loops)

getLongDiskVertexCount

public int getLongDiskVertexCount(int arcSlices,
                                  int lengthSlices,
                                  int loops)

getOrientation

public int getOrientation()

getPartialCylinderDrawMode

public int getPartialCylinderDrawMode()

getPartialCylinderIndexCount

public int getPartialCylinderIndexCount(int slices,
                                        int stacks)

getPartialCylinderOutlineDrawMode

public int getPartialCylinderOutlineDrawMode()

getPartialCylinderOutlineIndexCount

public int getPartialCylinderOutlineIndexCount(int slices,
                                               int stacks)

getPartialCylinderVertexCount

public int getPartialCylinderVertexCount(int slices,
                                         int stacks)

getPartialDiskDrawMode

public int getPartialDiskDrawMode()

getPartialDiskIndexCount

public int getPartialDiskIndexCount(int slices,
                                    int loops)

getPartialDiskVertexCount

public int getPartialDiskVertexCount(int slices,
                                     int loops)

getRadialWallDrawMode

public int getRadialWallDrawMode()

getRadialWallIndexCount

public int getRadialWallIndexCount(int pillars,
                                   int stacks)

getRadialWallOutlineDrawMode

public int getRadialWallOutlineDrawMode()

getRadialWallOutlineIndexCount

public int getRadialWallOutlineIndexCount(int pillars,
                                          int stacks)

getRadialWallVertexCount

public int getRadialWallVertexCount(int pillars,
                                    int stacks)

getSubdivisionPointsVertexCount

public int getSubdivisionPointsVertexCount(int subdivisions)

makeBilinearSurfaceFillIndices

public void makeBilinearSurfaceFillIndices(int vertexPos,
                                           int uStacks,
                                           int vStacks,
                                           int destPos,
                                           int[] dest)

makeBilinearSurfaceOutlineIndices

public void makeBilinearSurfaceOutlineIndices(int vertexPos,
                                              int uStacks,
                                              int vStacks,
                                              int mask,
                                              int destPos,
                                              int[] dest)

makeBilinearSurfaceVertexNormals

public void makeBilinearSurfaceVertexNormals(int srcPos,
                                             int uStacks,
                                             int vStacks,
                                             float[] srcVerts,
                                             int destPos,
                                             float[] dest)

makeBilinearSurfaceVertices

public void makeBilinearSurfaceVertices(float[] control,
                                        int destPos,
                                        int uStacks,
                                        int vStacks,
                                        float[] dest)

makeCylinderIndices

public void makeCylinderIndices(int slices,
                                int stacks,
                                int[] dest)

makeCylinderNormals

public void makeCylinderNormals(GeometryBuilder.IndexedTriangleBuffer itb,
                                FloatBuffer dest)

makeCylinderNormals

public void makeCylinderNormals(int slices,
                                int stacks,
                                float[] dest)

makeCylinderNormals

public void makeCylinderNormals(int indexPos,
                                int indexCount,
                                IntBuffer indices,
                                int vertexPos,
                                int vertexCount,
                                FloatBuffer vertices,
                                FloatBuffer dest)

makeCylinderOutlineIndices

public void makeCylinderOutlineIndices(int slices,
                                       int stacks,
                                       int[] dest)

makeCylinderVertices

public void makeCylinderVertices(float radius,
                                 float height,
                                 int slices,
                                 int stacks,
                                 float[] dest)

makeDiskIndices

public void makeDiskIndices(int slices,
                            int loops,
                            int[] dest)

makeDiskNormals

public void makeDiskNormals(int slices,
                            int loops,
                            float[] dest)

makeDiskVertexNormals

public void makeDiskVertexNormals(float innerRadius,
                                  float outerRadius,
                                  int slices,
                                  int loops,
                                  float[] srcVerts,
                                  float[] dest)

makeDiskVertices

public void makeDiskVertices(float innerRadius,
                             float outerRadius,
                             int slices,
                             int loops,
                             float[] dest)

makeEllipse

public FloatBuffer makeEllipse(float x,
                               float y,
                               float majorRadius,
                               float minorRadius,
                               int slices)
Creates a vertex buffer for a two-dimensional ellipse centered at the specified location and with the specified radii. The ellipse's center is placed at (x, y), it has a width of 2 * majorRadius, and a height of 2 * minorRadius.

If the specified slices is greater than 1 this returns a buffer with vertices evenly spaced along the circumference of the ellipse. Otherwise this returns a buffer with one vertex.

The returned buffer contains pairs of xy coordinates representing the location of each vertex in the ellipse in a counter-clockwise winding order relative to the z axis. The buffer may be rendered in OpenGL as either a triangle fan or a line loop.

Parameters:
x - the x-coordinate of the ellipse's center.
y - the y-coordinate of the ellipse's center.
majorRadius - the ellipse's radius along the x axis.
minorRadius - the ellipse's radius along the y axis.
slices - the number of slices in the ellipse.
Returns:
a buffer containing the ellipse's x and y locations.
Throws:
IllegalArgumentException - if any of majorRadius, minorRadius, or slices are less than zero.

makeEllipseWithLeader

public FloatBuffer makeEllipseWithLeader(float x,
                                         float y,
                                         float majorRadius,
                                         float minorRadius,
                                         int slices,
                                         float leaderX,
                                         float leaderY,
                                         float leaderWidth)
Creates a vertex buffer for a two-dimensional ellipse centered at the specified location and with the specified radii. The ellipse's center is placed at (x, y), it has a width of 2 * majorRadius, and a height of 2 * minorRadius.

If the specified slices is greater than 1 this returns a buffer with vertices evenly spaced along the circumference of the ellipse. Otherwise this returns a buffer with one vertex.

If the specified leaderWidth is greater than zero and the location (leaderX, leaderY) is outside of the rectangle that encloses the ellipse, the ellipse has a triangle attached to one side with with its top pointing at (leaderX, leaderY). Otherwise this returns an ellipse with no leader and is equivalent to calling makeEllipse(float, float, float, float, int). The leader is attached at the center of either the top, bottom, left, or right side, depending on the leader's location relative to the ellipse. The leader width is limited in size by the side it is attached to. For example, if the leader is attached to the ellipse's bottom, its width is limited by the ellipse's major radius.

Parameters:
x - the x-coordinate of the ellipse's center.
y - the y-coordinate of the ellipse's center.
majorRadius - the ellipse's radius along the x axis.
minorRadius - the ellipse's radius along the y axis.
slices - the number of slices in the ellipse.
leaderX - the x-coordinate the leader points to.
leaderY - the y-coordinate the leader points to.
leaderWidth - the leader triangle's width.
Returns:
a buffer containing the ellipse's x and y locations.
Throws:
IllegalArgumentException - if any of majorRadius, minorRadius, slices, or leaderWidth are less than zero.

makeEllipsoidNormals

public void makeEllipsoidNormals(GeometryBuilder.IndexedTriangleBuffer itb,
                                 FloatBuffer dest)

makeEllipsoidNormals

public void makeEllipsoidNormals(int indexPos,
                                 int indexCount,
                                 IntBuffer indices,
                                 int vertexPos,
                                 int vertexCount,
                                 FloatBuffer vertices,
                                 FloatBuffer dest)

makeIndexedTriangleArrayNormals

public void makeIndexedTriangleArrayNormals(GeometryBuilder.IndexedTriangleArray ita,
                                            float[] dest)

makeIndexedTriangleArrayNormals

public void makeIndexedTriangleArrayNormals(int indexPos,
                                            int indexCount,
                                            int[] indices,
                                            int vertexPos,
                                            int vertexCount,
                                            float[] vertices,
                                            float[] dest)

makeIndexedTriangleBufferNormals

public void makeIndexedTriangleBufferNormals(GeometryBuilder.IndexedTriangleBuffer itb,
                                             FloatBuffer dest)

makeIndexedTriangleBufferNormals

public void makeIndexedTriangleBufferNormals(int indexPos,
                                             int indexCount,
                                             IntBuffer indices,
                                             int vertexPos,
                                             int vertexCount,
                                             FloatBuffer vertices,
                                             FloatBuffer dest)

makeIndexedTriangleStripNormals

public void makeIndexedTriangleStripNormals(int indexPos,
                                            int indexCount,
                                            int[] indices,
                                            int vertexPos,
                                            int vertexCount,
                                            float[] vertices,
                                            float[] dest)

makeLongCylinderIndices

public void makeLongCylinderIndices(int arcSlices,
                                    int lengthSlices,
                                    int stacks,
                                    int[] dest)

makeLongCylinderNormals

public void makeLongCylinderNormals(int arcSlices,
                                    int lengthSlices,
                                    int stacks,
                                    float[] dest)

makeLongCylinderOutlineIndices

public void makeLongCylinderOutlineIndices(int arcSlices,
                                           int lengthSlices,
                                           int stacks,
                                           int[] dest)

makeLongCylinderVertices

public void makeLongCylinderVertices(float radius,
                                     float length,
                                     float height,
                                     int arcSlices,
                                     int lengthSlices,
                                     int stacks,
                                     float[] dest)

makeLongDiskIndices

public void makeLongDiskIndices(int arcSlices,
                                int lengthSlices,
                                int loops,
                                int[] dest)

makeLongDiskNormals

public void makeLongDiskNormals(int arcSlices,
                                int lengthSlices,
                                int loops,
                                float[] dest)

makeLongDiskVertexNormals

public void makeLongDiskVertexNormals(float innerRadius,
                                      float outerRadius,
                                      float length,
                                      int arcSlices,
                                      int lengthSlices,
                                      int loops,
                                      float[] srcVerts,
                                      float[] dest)

makeLongDiskVertices

public void makeLongDiskVertices(float innerRadius,
                                 float outerRadius,
                                 float length,
                                 int arcSlices,
                                 int lengthSlices,
                                 int loops,
                                 float[] dest)

makePartialCylinderIndices

public void makePartialCylinderIndices(int slices,
                                       int stacks,
                                       int[] dest)

makePartialCylinderNormals

public void makePartialCylinderNormals(float radius,
                                       float height,
                                       int slices,
                                       int stacks,
                                       float start,
                                       float sweep,
                                       float[] dest)

makePartialCylinderOutlineIndices

public void makePartialCylinderOutlineIndices(int slices,
                                              int stacks,
                                              int[] dest)

makePartialCylinderVertices

public void makePartialCylinderVertices(float radius,
                                        float height,
                                        int slices,
                                        int stacks,
                                        float start,
                                        float sweep,
                                        float[] dest)

makePartialDiskIndices

public void makePartialDiskIndices(int slices,
                                   int loops,
                                   int[] dest)

makePartialDiskNormals

public void makePartialDiskNormals(int slices,
                                   int loops,
                                   float[] dest)

makePartialDiskVertexNormals

public void makePartialDiskVertexNormals(float innerRadius,
                                         float outerRadius,
                                         int slices,
                                         int loops,
                                         float start,
                                         float sweep,
                                         float[] srcVerts,
                                         float[] dest)

makePartialDiskVertices

public void makePartialDiskVertices(float innerRadius,
                                    float outerRadius,
                                    int slices,
                                    int loops,
                                    float start,
                                    float sweep,
                                    float[] dest)

makeRadialWallIndices

public void makeRadialWallIndices(int pillars,
                                  int stacks,
                                  int[] dest)

makeRadialWallNormals

public void makeRadialWallNormals(float innerRadius,
                                  float outerRadius,
                                  float height,
                                  float angle,
                                  int pillars,
                                  int stacks,
                                  float[] dest)

makeRadialWallOutlineIndices

public void makeRadialWallOutlineIndices(int pillars,
                                         int stacks,
                                         int[] dest)

makeRadialWallVertices

public void makeRadialWallVertices(float innerRadius,
                                   float outerRadius,
                                   float height,
                                   float angle,
                                   int pillars,
                                   int stacks,
                                   float[] dest)

makeRectangle

public FloatBuffer makeRectangle(float x,
                                 float y,
                                 float width,
                                 float height)
Creates a vertex buffer for a two-dimensional rectangle at the specified location, and with the specified size. The rectangle's lower left corner is placed at (x, y), and its upper right corner is placed at (x + width, y + height).

The returned buffer contains pairs of xy coordinates representing the location of each vertex in the rectangle in a counter-clockwise winding order relative to the z axis. The buffer may be rendered in OpenGL as either a triangle fan or a line loop.

Parameters:
x - the x-coordinate of the rectangle's lower left corner.
y - the y-coordinate of the rectangle's lower left corner.
width - the rectangle's width.
height - the rectangle's height.
Returns:
a buffer containing the rectangle's x and y locations.
Throws:
IllegalArgumentException - if either width or height are less than zero.

makeRectangle

public FloatBuffer makeRectangle(float x,
                                 float y,
                                 float width,
                                 float height,
                                 float cornerRadius,
                                 int cornerSlices)
Creates a vertex buffer for a two-dimensional rectangle at the specified location, with the specified size, and with optionally rounded corners. The rectangle's lower left corner is placed at the (x, y), and its upper right corner is placed at (x + width, y + height).

If the specified cornerRadius and cornerSlices are greater than 0, the rectangle's corners have a rounded appearance. The radius specifies the size of a rounded corner, and the slices specifies the number of segments that make a rounded corner. If either cornerRadius or cornerSlices are 0, this returns a rectangle with sharp corners and is equivalent to calling makeRectangle(float, float, float, float). The cornerRadius is limited by the rectangle's width and height. For example, if the corner radius is 100 and the width and height are 50 and 100, the actual corner radius used is 25 - half of the rectangle's smallest dimension.

The returned buffer contains pairs of xy coordinates representing the location of each vertex in the rectangle in a counter-clockwise winding order relative to the z axis. The buffer may be rendered in OpenGL as either a triangle fan or a line loop.

Parameters:
x - the x-coordinate of the rectangle's lower left corner.
y - the y-coordinate of the rectangle's lower left corner.
width - the rectangle's width.
height - the rectangle's height.
cornerRadius - the rectangle's rounded corner radius, or 0 to disable rounded corners.
cornerSlices - the number of slices in each rounded corner, or 0 to disable rounded corners.
Returns:
a buffer containing the rectangle's x and y locations.
Throws:
IllegalArgumentException - if any of width, height, cornerRadius, or cornerSlices are less than zero.

makeRectangleWithLeader

public FloatBuffer makeRectangleWithLeader(float x,
                                           float y,
                                           float width,
                                           float height,
                                           float leaderX,
                                           float leaderY,
                                           float leaderWidth)
Creates a vertex buffer for a two-dimensional rectangle at the specified location, with the specified size, and with an optional leader pointing to the specified leader location. The rectangle's lower left corner is placed at (x, y), and its upper right corner is placed at (x + width, y + height).

If the specified leaderWidth is greater than zero and the location (leaderX, leaderY) is outside of the rectangle, the rectangle has a triangle attached to one side with with its top pointing at (leaderX, leaderY). Otherwise this returns a rectangle with no leader and is equivalent to calling makeRectangle(float, float, float, float). The leader is attached at the center of either the top, bottom, left, or right side, depending on the leader's location relative to the rectangle. The leader width is limited in size by the side it is attached to. For example, if the leader is attached to the rectangle's bottom, its width is limited by the rectangle's width.

The returned buffer contains pairs of xy coordinates representing the location of each vertex in the rectangle in a counter-clockwise winding order relative to the z axis. The buffer may be rendered in OpenGL as either a triangle fan or a line loop.

Parameters:
x - the x-coordinate of the rectangle's lower left corner.
y - the y-coordinate of the rectangle's lower left corner.
width - the rectangle's width.
height - the rectangle's height.
leaderX - the x-coordinate the leader points to.
leaderY - the y-coordinate the leader points to.
leaderWidth - the leader triangle's width.
Returns:
a buffer containing the rectangle's x and y locations.
Throws:
IllegalArgumentException - if any of width, height, or leaderWidth are less than zero.

makeRectangleWithLeader

public FloatBuffer makeRectangleWithLeader(float x,
                                           float y,
                                           float width,
                                           float height,
                                           float cornerRadius,
                                           int cornerSlices,
                                           float leaderX,
                                           float leaderY,
                                           float leaderWidth)
Creates a vertex buffer for a two-dimensional rectangle at the specified location, with the specified size, and with optionally rounded corners. The rectangle's lower left corner is placed at the (x, y), and its upper right corner is placed at (x + width, y + height).

If the specified cornerRadius and cornerSlices are greater than 0, the rectangle's corners have a rounded appearance. The radius specifies the size of a rounded corner, and the slices specifies the number of segments that make a rounded corner. If either cornerRadius or cornerSlices are 0, this returns a rectangle with sharp corners and is equivalent to calling makeRectangleWithLeader(float, float, float, float, float, float, float) . The cornerRadius is limited by the rectangle's width and height. For example, if the corner radius is 100 and the width and height are 50 and 100, the actual corner radius used is 25 - half of the rectangle's smallest dimension.

If the specified leaderWidth is greater than zero and the location (leaderX, leaderY) is outside of the rectangle, the rectangle has a triangle attached to one side with with its top pointing at (leaderX, leaderY). Otherwise this returns a rectangle with no leader and is equivalent to calling makeRectangle(float, float, float, float, float, int). The leader is attached at the center of either the top, bottom, left, or right side, depending on the leader's location relative to the rectangle. The leader width is limited in size by the side it is attached to. For example, if the leader is attached to the rectangle's bottom, its width is limited by the rectangle's width minus any area used by the rounded corners.

The returned buffer contains pairs of xy coordinates representing the location of each vertex in the rectangle in a counter-clockwise winding order relative to the z axis. The buffer may be rendered in OpenGL as either a triangle fan or a line loop.

Parameters:
x - the x-coordinate of the rectangle's lower left corner.
y - the y-coordinate of the rectangle's lower left corner.
width - the rectangle's width.
height - the rectangle's height.
cornerRadius - the rectangle's rounded corner radius, or 0 to disable rounded corners.
cornerSlices - the number of slices in each rounded corner, or 0 to disable rounded corners.
leaderX - the x-coordinate the leader points to.
leaderY - the y-coordinate the leader points to.
leaderWidth - the leader triangle's width.
Returns:
a buffer containing the rectangle's x and y locations.
Throws:
IllegalArgumentException - if any of width, height, cornerRadius, cornerSlices, or leaderWidth are less than zero.

makeSubdivisionPoints

public void makeSubdivisionPoints(float x1,
                                  float y1,
                                  float z1,
                                  float x2,
                                  float y2,
                                  float z2,
                                  int subdivisions,
                                  float[] dest)

makeUnitBoxTextureCoordinates

public void makeUnitBoxTextureCoordinates(FloatBuffer texCoords,
                                          int vertexCount)

makeUnitBoxTextureCoordinates

public void makeUnitBoxTextureCoordinates(int index,
                                          FloatBuffer texCoords,
                                          int vertexCount)

makeUnitConeTextureCoordinates

public void makeUnitConeTextureCoordinates(FloatBuffer texCoords,
                                           int subdivisions)

makeUnitConeTextureCoordinates

public void makeUnitConeTextureCoordinates(int face,
                                           FloatBuffer texCoords,
                                           int subdivisions)

makeUnitCylinderTextureCoordinates

public void makeUnitCylinderTextureCoordinates(int face,
                                               FloatBuffer texCoords,
                                               int subdivisions)

makeUnitPyramidTextureCoordinates

public void makeUnitPyramidTextureCoordinates(FloatBuffer texCoords,
                                              int vertexCount)

makeUnitPyramidTextureCoordinates

public void makeUnitPyramidTextureCoordinates(int index,
                                              FloatBuffer texCoords,
                                              int vertexCount)

makeUnitSphereTextureCoordinates

public void makeUnitSphereTextureCoordinates(GeometryBuilder.IndexedTriangleBuffer itb,
                                             FloatBuffer texCoords)

makeUnitSphereTextureCoordinates

public void makeUnitSphereTextureCoordinates(GeometryBuilder.IndexedTriangleBuffer itb,
                                             FloatBuffer texCoords,
                                             int seamVerticesIndex)

makeUnitSphereTextureCoordinates

public void makeUnitSphereTextureCoordinates(int vertexCount,
                                             FloatBuffer vertices,
                                             FloatBuffer texCoords,
                                             int seamVerticesIndex)

makeUnitWedgeTextureCoordinates

public void makeUnitWedgeTextureCoordinates(int face,
                                            FloatBuffer texCoords,
                                            int subdivisions,
                                            Angle angle)

makeWedgeTextureCoordinates

public void makeWedgeTextureCoordinates(FloatBuffer texCoords,
                                        int subdivisions,
                                        Angle angle)

reversePoints

public <T> void reversePoints(int pos,
                              int count,
                              T[] points)

setOrientation

public void setOrientation(int orientation)

subdivideIndexedTriangleArray

public void subdivideIndexedTriangleArray(GeometryBuilder.IndexedTriangleArray ita)

subdivideIndexedTriangleBuffer

public void subdivideIndexedTriangleBuffer(GeometryBuilder.IndexedTriangleBuffer itb)

subdivideIndexedTriangles

public GeometryBuilder.IndexedTriangleArray subdivideIndexedTriangles(int indexCount,
                                                                      int[] indices,
                                                                      int vertexCount,
                                                                      float[] vertices)

tessellateBoxBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellateBoxBuffer(float radius,
                                                                 int subdivisions)

tessellateBoxBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellateBoxBuffer(int face,
                                                                 float radius,
                                                                 int subdivisions)

tessellateConeBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellateConeBuffer(float radius,
                                                                  int subdivisions)

tessellateConeBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellateConeBuffer(int face,
                                                                  float radius,
                                                                  int subdivisions)

tessellateCylinderBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellateCylinderBuffer(float radius,
                                                                      int subdivisions)

tessellateCylinderBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellateCylinderBuffer(int face,
                                                                      float radius,
                                                                      int subdivisions)

tessellateEllipsoidBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellateEllipsoidBuffer(float a,
                                                                       float b,
                                                                       float c,
                                                                       int subdivisions)

tessellatePolygon

public GeometryBuilder.IndexedTriangleArray tessellatePolygon(int pos,
                                                              int count,
                                                              float[] vertices,
                                                              Vec4 normal)

tessellatePolygon2

public GeometryBuilder.IndexedTriangleArray tessellatePolygon2(int pos,
                                                               int count,
                                                               float[] vertices)

tessellatePyramidBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellatePyramidBuffer(float radius,
                                                                     int subdivisions)

tessellatePyramidBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellatePyramidBuffer(int face,
                                                                     float radius,
                                                                     int subdivisions)

tessellateSphere

public GeometryBuilder.IndexedTriangleArray tessellateSphere(float radius,
                                                             int subdivisions)

tessellateSphereBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellateSphereBuffer(float radius,
                                                                    int subdivisions)

tessellateWedgeBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellateWedgeBuffer(float radius,
                                                                   int subdivisions,
                                                                   Angle angle)

tessellateWedgeBuffer

public GeometryBuilder.IndexedTriangleBuffer tessellateWedgeBuffer(int face,
                                                                   float radius,
                                                                   int subdivisions,
                                                                   Angle angle)

NASA World Wind