Class GeometryBuilder
- java.lang.Object
-
- gov.nasa.worldwind.util.GeometryBuilder
-
public class GeometryBuilder extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GeometryBuilder.IndexedTriangleArray
static class
GeometryBuilder.IndexedTriangleBuffer
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description GeometryBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addRectangleRoundedCorner(float x, float y, float radius, float start, float sweep, int slices, java.nio.FloatBuffer buffer)
Adds the vertices for one rounded corner of a two-dimensional rectangular to the specifiedbuffer
.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)
LatLon[]
makeCylinderLocations(Globe globe, LatLon center, double minorRadius, double majorRadius, Angle heading, int slices)
LatLon[]
makeCylinderLocations(Globe globe, LatLon center, double radius, int slices)
void
makeCylinderNormals(int slices, int stacks, float[] dest)
void
makeCylinderNormals(int indexPos, int indexCount, java.nio.IntBuffer indices, int vertexPos, int vertexCount, java.nio.FloatBuffer vertices, java.nio.FloatBuffer dest)
void
makeCylinderNormals(GeometryBuilder.IndexedTriangleBuffer itb, java.nio.FloatBuffer dest)
void
makeCylinderOutlineIndices(int slices, int stacks, int[] dest)
void
makeCylinderVertices(float radius, float height, int slices, int stacks, float[] dest)
void
makeCylinderVertices(Terrain terrain, LatLon center, double radius, double[] altitudes, boolean[] terrainConformant, int slices, int stacks, Vec4 refPoint, float[] dest)
void
makeCylinderVertices(Terrain terrain, LatLon center, double minorRadius, double majorRadius, Angle heading, double[] altitudes, boolean[] terrainConformant, int slices, int stacks, Vec4 refPoint, float[] dest)
void
makeDiskIndices(int slices, int loops, int[] dest)
LatLon[]
makeDiskLocations(Globe globe, LatLon center, double[] radii, Angle heading, int slices, int loops)
LatLon[]
makeDiskLocations(Globe globe, LatLon center, double innerRadius, double outerRadius, int slices, int loops)
void
makeDiskNormals(int slices, int loops, float[] dest)
void
makeDiskVertexNormals(double innerMinorRadius, double outerMinorRadius, int slices, int loops, float[] srcVerts, float[] dest)
void
makeDiskVertices(float innerRadius, float outerRadius, int slices, int loops, float[] dest)
void
makeDiskVertices(Terrain terrain, LatLon center, double[] radii, Angle heading, double altitude, boolean terrainConformant, int slices, int loops, Vec4 refPoint, float[] dest)
void
makeDiskVertices(Terrain terrain, LatLon center, double innerRadius, double outerRadius, double altitude, boolean terrainConformant, int slices, int loops, Vec4 refPoint, float[] dest)
java.nio.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.java.nio.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(int indexPos, int indexCount, java.nio.IntBuffer indices, int vertexPos, int vertexCount, java.nio.FloatBuffer vertices, java.nio.FloatBuffer dest)
void
makeEllipsoidNormals(GeometryBuilder.IndexedTriangleBuffer itb, java.nio.FloatBuffer dest)
void
makeEllipticalCylinderNormals(int slices, int stacks, double minorRadius, double majorRadius, Angle heading, float[] dest)
void
makeIndexedTriangleArrayNormals(int indexPos, int indexCount, int[] indices, int vertexPos, int vertexCount, float[] vertices, float[] dest)
void
makeIndexedTriangleArrayNormals(GeometryBuilder.IndexedTriangleArray ita, float[] dest)
void
makeIndexedTriangleBufferNormals(int indexPos, int indexCount, java.nio.IntBuffer indices, int vertexPos, int vertexCount, java.nio.FloatBuffer vertices, java.nio.FloatBuffer dest)
void
makeIndexedTriangleBufferNormals(GeometryBuilder.IndexedTriangleBuffer itb, java.nio.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)
LatLon[]
makeLongCylinderLocations(Globe globe, LatLon center1, LatLon center2, double radius, int arcSlices, int lengthSlices)
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
makeLongCylinderVertices(Terrain terrain, LatLon center1, LatLon center2, double radius, double[] altitudes, boolean[] terrainConformant, int arcSlices, int lengthSlices, int stacks, Vec4 refPoint, float[] dest)
void
makeLongDiskIndices(int arcSlices, int lengthSlices, int loops, int[] dest)
LatLon[]
makeLongDiskLocations(Globe globe, LatLon center1, LatLon center2, double innerRadius, double outerRadius, int arcSlices, int lengthSlices, int loops)
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
makeLongDiskVertices(Terrain terrain, LatLon center1, LatLon center2, double innerRadius, double outerRadius, double altitude, boolean terrainConformant, int arcSlices, int lengthSlices, int loops, Vec4 refPoint, float[] dest)
void
makePartialCylinderIndices(int slices, int stacks, int[] dest)
LatLon[]
makePartialCylinderLocations(Globe globe, LatLon center, double radius, int slices, double start, double sweep)
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
makePartialCylinderVertices(Terrain terrain, LatLon center, double radius, double[] altitudes, boolean[] terrainConformant, int slices, int stacks, double start, double sweep, Vec4 refPoint, float[] dest)
void
makePartialDiskIndices(int slices, int loops, int[] dest)
LatLon[]
makePartialDiskLocations(Globe globe, LatLon center, double innerRadius, double outerRadius, int slices, int loops, double start, double sweep)
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
makePartialDiskVertices(Terrain terrain, LatLon center, double innerRadius, double outerRadius, double altitude, boolean terrainConformant, int slices, int loops, double start, double sweep, Vec4 refPoint, 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)
void
makeRadialWallVertices(Terrain terrain, LatLon center, double innerRadius, double outerRadius, double angle, double[] altitudes, boolean[] terrainConformant, int pillars, int stacks, Vec4 refPoint, float[] dest)
java.nio.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.java.nio.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.java.nio.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.java.nio.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(int index, java.nio.FloatBuffer texCoords, int vertexCount)
void
makeUnitBoxTextureCoordinates(java.nio.FloatBuffer texCoords, int vertexCount)
void
makeUnitConeTextureCoordinates(int face, java.nio.FloatBuffer texCoords, int subdivisions)
void
makeUnitConeTextureCoordinates(java.nio.FloatBuffer texCoords, int subdivisions)
void
makeUnitCylinderTextureCoordinates(int face, java.nio.FloatBuffer texCoords, int subdivisions)
void
makeUnitPyramidTextureCoordinates(int index, java.nio.FloatBuffer texCoords, int vertexCount)
void
makeUnitPyramidTextureCoordinates(java.nio.FloatBuffer texCoords, int vertexCount)
void
makeUnitSphereTextureCoordinates(int vertexCount, java.nio.FloatBuffer vertices, java.nio.FloatBuffer texCoords, int seamVerticesIndex)
void
makeUnitSphereTextureCoordinates(GeometryBuilder.IndexedTriangleBuffer itb, java.nio.FloatBuffer texCoords)
void
makeUnitSphereTextureCoordinates(GeometryBuilder.IndexedTriangleBuffer itb, java.nio.FloatBuffer texCoords, int seamVerticesIndex)
void
makeUnitWedgeTextureCoordinates(int face, java.nio.FloatBuffer texCoords, int subdivisions, Angle angle)
void
makeWedgeTextureCoordinates(java.nio.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)
-
-
-
Field Detail
-
OUTSIDE
public static final int OUTSIDE
- See Also:
- Constant Field Values
-
INSIDE
public static final int INSIDE
- See Also:
- Constant Field Values
-
COUNTER_CLOCKWISE
public static final int COUNTER_CLOCKWISE
- See Also:
- Constant Field Values
-
CLOCKWISE
public static final int CLOCKWISE
- See Also:
- Constant Field Values
-
TOP
public static final int TOP
- See Also:
- Constant Field Values
-
BOTTOM
public static final int BOTTOM
- See Also:
- Constant Field Values
-
LEFT
public static final int LEFT
- See Also:
- Constant Field Values
-
RIGHT
public static final int RIGHT
- 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_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
-
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_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_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
-
-
Method Detail
-
getOrientation
public int getOrientation()
-
setOrientation
public void setOrientation(int orientation)
-
tessellateSphere
public GeometryBuilder.IndexedTriangleArray tessellateSphere(float radius, int subdivisions)
-
tessellateSphereBuffer
public GeometryBuilder.IndexedTriangleBuffer tessellateSphereBuffer(float radius, int subdivisions)
-
tessellateEllipsoidBuffer
public GeometryBuilder.IndexedTriangleBuffer tessellateEllipsoidBuffer(float a, float b, float c, int subdivisions)
-
tessellateBoxBuffer
public GeometryBuilder.IndexedTriangleBuffer tessellateBoxBuffer(float radius, int subdivisions)
-
tessellateBoxBuffer
public GeometryBuilder.IndexedTriangleBuffer tessellateBoxBuffer(int face, float radius, int subdivisions)
-
tessellatePyramidBuffer
public GeometryBuilder.IndexedTriangleBuffer tessellatePyramidBuffer(float radius, int subdivisions)
-
tessellatePyramidBuffer
public GeometryBuilder.IndexedTriangleBuffer tessellatePyramidBuffer(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)
-
tessellateWedgeBuffer
public GeometryBuilder.IndexedTriangleBuffer tessellateWedgeBuffer(float radius, int subdivisions, Angle angle)
-
tessellateWedgeBuffer
public GeometryBuilder.IndexedTriangleBuffer tessellateWedgeBuffer(int face, float radius, int subdivisions, Angle angle)
-
tessellateConeBuffer
public GeometryBuilder.IndexedTriangleBuffer tessellateConeBuffer(float radius, int subdivisions)
-
tessellateConeBuffer
public GeometryBuilder.IndexedTriangleBuffer tessellateConeBuffer(int face, float radius, int subdivisions)
-
getCylinderVertexCount
public int getCylinderVertexCount(int slices, int stacks)
-
getCylinderIndexCount
public int getCylinderIndexCount(int slices, int stacks)
-
getCylinderOutlineIndexCount
public int getCylinderOutlineIndexCount(int slices, int stacks)
-
getCylinderDrawMode
public int getCylinderDrawMode()
-
getCylinderOutlineDrawMode
public int getCylinderOutlineDrawMode()
-
makeCylinderLocations
public LatLon[] makeCylinderLocations(Globe globe, LatLon center, double radius, int slices)
-
makeCylinderLocations
public LatLon[] makeCylinderLocations(Globe globe, LatLon center, double minorRadius, double majorRadius, Angle heading, int slices)
-
makeCylinderVertices
public void makeCylinderVertices(Terrain terrain, LatLon center, double radius, double[] altitudes, boolean[] terrainConformant, int slices, int stacks, Vec4 refPoint, float[] dest)
-
makeCylinderVertices
public void makeCylinderVertices(Terrain terrain, LatLon center, double minorRadius, double majorRadius, Angle heading, double[] altitudes, boolean[] terrainConformant, int slices, int stacks, Vec4 refPoint, float[] dest)
-
makeCylinderVertices
public void makeCylinderVertices(float radius, float height, int slices, int stacks, float[] dest)
-
makeCylinderNormals
public void makeCylinderNormals(int slices, int stacks, float[] dest)
-
makeEllipticalCylinderNormals
public void makeEllipticalCylinderNormals(int slices, int stacks, double minorRadius, double majorRadius, Angle heading, float[] dest)
-
makeCylinderIndices
public void makeCylinderIndices(int slices, int stacks, int[] dest)
-
makeCylinderOutlineIndices
public void makeCylinderOutlineIndices(int slices, int stacks, int[] dest)
-
getPartialCylinderVertexCount
public int getPartialCylinderVertexCount(int slices, int stacks)
-
getPartialCylinderIndexCount
public int getPartialCylinderIndexCount(int slices, int stacks)
-
getPartialCylinderOutlineIndexCount
public int getPartialCylinderOutlineIndexCount(int slices, int stacks)
-
getPartialCylinderDrawMode
public int getPartialCylinderDrawMode()
-
getPartialCylinderOutlineDrawMode
public int getPartialCylinderOutlineDrawMode()
-
makePartialCylinderLocations
public LatLon[] makePartialCylinderLocations(Globe globe, LatLon center, double radius, int slices, double start, double sweep)
-
makePartialCylinderVertices
public void makePartialCylinderVertices(Terrain terrain, LatLon center, double radius, double[] altitudes, boolean[] terrainConformant, int slices, int stacks, double start, double sweep, Vec4 refPoint, float[] dest)
-
makePartialCylinderVertices
public void makePartialCylinderVertices(float radius, float height, int slices, int stacks, float start, float sweep, float[] dest)
-
makePartialCylinderNormals
public void makePartialCylinderNormals(float radius, float height, int slices, int stacks, float start, float sweep, float[] dest)
-
makePartialCylinderIndices
public void makePartialCylinderIndices(int slices, int stacks, int[] dest)
-
makePartialCylinderOutlineIndices
public void makePartialCylinderOutlineIndices(int slices, int stacks, int[] dest)
-
getDiskVertexCount
public int getDiskVertexCount(int slices, int loops)
-
getDiskIndexCount
public int getDiskIndexCount(int slices, int loops)
-
getDiskDrawMode
public int getDiskDrawMode()
-
makeDiskLocations
public LatLon[] makeDiskLocations(Globe globe, LatLon center, double innerRadius, double outerRadius, int slices, int loops)
-
makeDiskLocations
public LatLon[] makeDiskLocations(Globe globe, LatLon center, double[] radii, Angle heading, int slices, int loops)
-
makeDiskVertices
public void makeDiskVertices(Terrain terrain, LatLon center, double innerRadius, double outerRadius, double altitude, boolean terrainConformant, int slices, int loops, Vec4 refPoint, float[] dest)
-
makeDiskVertices
public void makeDiskVertices(Terrain terrain, LatLon center, double[] radii, Angle heading, double altitude, boolean terrainConformant, int slices, int loops, Vec4 refPoint, float[] dest)
-
makeDiskVertices
public void makeDiskVertices(float innerRadius, float outerRadius, int slices, int loops, float[] dest)
-
makeDiskNormals
public void makeDiskNormals(int slices, int loops, float[] dest)
-
makeDiskVertexNormals
public void makeDiskVertexNormals(double innerMinorRadius, double outerMinorRadius, int slices, int loops, float[] srcVerts, float[] dest)
-
makeDiskIndices
public void makeDiskIndices(int slices, int loops, int[] dest)
-
getPartialDiskVertexCount
public int getPartialDiskVertexCount(int slices, int loops)
-
getPartialDiskIndexCount
public int getPartialDiskIndexCount(int slices, int loops)
-
getPartialDiskDrawMode
public int getPartialDiskDrawMode()
-
makePartialDiskLocations
public LatLon[] makePartialDiskLocations(Globe globe, LatLon center, double innerRadius, double outerRadius, int slices, int loops, double start, double sweep)
-
makePartialDiskVertices
public void makePartialDiskVertices(Terrain terrain, LatLon center, double innerRadius, double outerRadius, double altitude, boolean terrainConformant, int slices, int loops, double start, double sweep, Vec4 refPoint, float[] dest)
-
makePartialDiskVertices
public void makePartialDiskVertices(float innerRadius, float outerRadius, int slices, int loops, float start, float sweep, float[] 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)
-
makePartialDiskIndices
public void makePartialDiskIndices(int slices, int loops, int[] dest)
-
getRadialWallVertexCount
public int getRadialWallVertexCount(int pillars, int stacks)
-
getRadialWallIndexCount
public int getRadialWallIndexCount(int pillars, int stacks)
-
getRadialWallOutlineIndexCount
public int getRadialWallOutlineIndexCount(int pillars, int stacks)
-
getRadialWallDrawMode
public int getRadialWallDrawMode()
-
getRadialWallOutlineDrawMode
public int getRadialWallOutlineDrawMode()
-
makeRadialWallVertices
public void makeRadialWallVertices(Terrain terrain, LatLon center, double innerRadius, double outerRadius, double angle, double[] altitudes, boolean[] terrainConformant, int pillars, int stacks, Vec4 refPoint, float[] dest)
-
makeRadialWallVertices
public void makeRadialWallVertices(float innerRadius, float outerRadius, float height, float angle, int pillars, int stacks, float[] dest)
-
makeRadialWallNormals
public void makeRadialWallNormals(float innerRadius, float outerRadius, float height, float angle, int pillars, int stacks, float[] dest)
-
makeRadialWallIndices
public void makeRadialWallIndices(int pillars, int stacks, int[] dest)
-
makeRadialWallOutlineIndices
public void makeRadialWallOutlineIndices(int pillars, int stacks, int[] dest)
-
getLongCylinderVertexCount
public int getLongCylinderVertexCount(int arcSlices, int lengthSlices, int stacks)
-
getLongCylinderIndexCount
public int getLongCylinderIndexCount(int arcSlices, int lengthSlices, int stacks)
-
getLongCylinderOutlineIndexCount
public int getLongCylinderOutlineIndexCount(int arcSlices, int lengthSlices, int stacks)
-
getLongCylinderDrawMode
public int getLongCylinderDrawMode()
-
getLongCylinderOutlineDrawMode
public int getLongCylinderOutlineDrawMode()
-
makeLongCylinderLocations
public LatLon[] makeLongCylinderLocations(Globe globe, LatLon center1, LatLon center2, double radius, int arcSlices, int lengthSlices)
-
makeLongCylinderVertices
public void makeLongCylinderVertices(Terrain terrain, LatLon center1, LatLon center2, double radius, double[] altitudes, boolean[] terrainConformant, int arcSlices, int lengthSlices, int stacks, Vec4 refPoint, float[] dest)
-
makeLongCylinderVertices
public void makeLongCylinderVertices(float radius, float length, float height, int arcSlices, int lengthSlices, int stacks, float[] dest)
-
makeLongCylinderNormals
public void makeLongCylinderNormals(int arcSlices, int lengthSlices, int stacks, float[] dest)
-
makeLongCylinderIndices
public void makeLongCylinderIndices(int arcSlices, int lengthSlices, int stacks, int[] dest)
-
makeLongCylinderOutlineIndices
public void makeLongCylinderOutlineIndices(int arcSlices, int lengthSlices, int stacks, int[] dest)
-
getLongDiskVertexCount
public int getLongDiskVertexCount(int arcSlices, int lengthSlices, int loops)
-
getLongDiskIndexCount
public int getLongDiskIndexCount(int arcSlices, int lengthSlices, int loops)
-
getLongDiskDrawMode
public int getLongDiskDrawMode()
-
makeLongDiskLocations
public LatLon[] makeLongDiskLocations(Globe globe, LatLon center1, LatLon center2, double innerRadius, double outerRadius, int arcSlices, int lengthSlices, int loops)
-
makeLongDiskVertices
public void makeLongDiskVertices(Terrain terrain, LatLon center1, LatLon center2, double innerRadius, double outerRadius, double altitude, boolean terrainConformant, int arcSlices, int lengthSlices, int loops, Vec4 refPoint, float[] dest)
-
makeLongDiskVertices
public void makeLongDiskVertices(float innerRadius, float outerRadius, float length, int arcSlices, int lengthSlices, int loops, float[] 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)
-
makeLongDiskIndices
public void makeLongDiskIndices(int arcSlices, int lengthSlices, int loops, int[] dest)
-
computePolygonWindingOrder2
public int computePolygonWindingOrder2(int pos, int count, Vec4[] points)
-
computePolygonArea2
public float computePolygonArea2(int pos, int count, Vec4[] points)
-
tessellatePolygon
public GeometryBuilder.IndexedTriangleArray tessellatePolygon(int pos, int count, float[] vertices, Vec4 normal)
-
tessellatePolygon2
public GeometryBuilder.IndexedTriangleArray tessellatePolygon2(int pos, int count, float[] vertices)
-
getIndexedTriangleBufferDrawMode
public int getIndexedTriangleBufferDrawMode()
-
subdivideIndexedTriangleBuffer
public void subdivideIndexedTriangleBuffer(GeometryBuilder.IndexedTriangleBuffer itb)
-
makeIndexedTriangleBufferNormals
public void makeIndexedTriangleBufferNormals(GeometryBuilder.IndexedTriangleBuffer itb, java.nio.FloatBuffer dest)
-
makeIndexedTriangleBufferNormals
public void makeIndexedTriangleBufferNormals(int indexPos, int indexCount, java.nio.IntBuffer indices, int vertexPos, int vertexCount, java.nio.FloatBuffer vertices, java.nio.FloatBuffer dest)
-
makeEllipsoidNormals
public void makeEllipsoidNormals(GeometryBuilder.IndexedTriangleBuffer itb, java.nio.FloatBuffer dest)
-
makeEllipsoidNormals
public void makeEllipsoidNormals(int indexPos, int indexCount, java.nio.IntBuffer indices, int vertexPos, int vertexCount, java.nio.FloatBuffer vertices, java.nio.FloatBuffer dest)
-
makeCylinderNormals
public void makeCylinderNormals(GeometryBuilder.IndexedTriangleBuffer itb, java.nio.FloatBuffer dest)
-
makeCylinderNormals
public void makeCylinderNormals(int indexPos, int indexCount, java.nio.IntBuffer indices, int vertexPos, int vertexCount, java.nio.FloatBuffer vertices, java.nio.FloatBuffer dest)
-
fixSphereSeam
public void fixSphereSeam(GeometryBuilder.IndexedTriangleBuffer itb, float wrapThreshold)
-
makeUnitSphereTextureCoordinates
public void makeUnitSphereTextureCoordinates(GeometryBuilder.IndexedTriangleBuffer itb, java.nio.FloatBuffer texCoords)
-
makeUnitSphereTextureCoordinates
public void makeUnitSphereTextureCoordinates(GeometryBuilder.IndexedTriangleBuffer itb, java.nio.FloatBuffer texCoords, int seamVerticesIndex)
-
makeUnitSphereTextureCoordinates
public void makeUnitSphereTextureCoordinates(int vertexCount, java.nio.FloatBuffer vertices, java.nio.FloatBuffer texCoords, int seamVerticesIndex)
-
makeUnitBoxTextureCoordinates
public void makeUnitBoxTextureCoordinates(java.nio.FloatBuffer texCoords, int vertexCount)
-
makeUnitBoxTextureCoordinates
public void makeUnitBoxTextureCoordinates(int index, java.nio.FloatBuffer texCoords, int vertexCount)
-
makeUnitPyramidTextureCoordinates
public void makeUnitPyramidTextureCoordinates(java.nio.FloatBuffer texCoords, int vertexCount)
-
makeUnitPyramidTextureCoordinates
public void makeUnitPyramidTextureCoordinates(int index, java.nio.FloatBuffer texCoords, int vertexCount)
-
makeUnitCylinderTextureCoordinates
public void makeUnitCylinderTextureCoordinates(int face, java.nio.FloatBuffer texCoords, int subdivisions)
-
makeWedgeTextureCoordinates
public void makeWedgeTextureCoordinates(java.nio.FloatBuffer texCoords, int subdivisions, Angle angle)
-
makeUnitWedgeTextureCoordinates
public void makeUnitWedgeTextureCoordinates(int face, java.nio.FloatBuffer texCoords, int subdivisions, Angle angle)
-
makeUnitConeTextureCoordinates
public void makeUnitConeTextureCoordinates(java.nio.FloatBuffer texCoords, int subdivisions)
-
makeUnitConeTextureCoordinates
public void makeUnitConeTextureCoordinates(int face, java.nio.FloatBuffer texCoords, int subdivisions)
-
getIndexedTriangleArrayDrawMode
public int getIndexedTriangleArrayDrawMode()
-
subdivideIndexedTriangleArray
public void subdivideIndexedTriangleArray(GeometryBuilder.IndexedTriangleArray ita)
-
subdivideIndexedTriangles
public GeometryBuilder.IndexedTriangleArray subdivideIndexedTriangles(int indexCount, int[] indices, int vertexCount, float[] vertices)
-
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)
-
makeIndexedTriangleStripNormals
public void makeIndexedTriangleStripNormals(int indexPos, int indexCount, int[] indices, int vertexPos, int vertexCount, float[] vertices, float[] dest)
-
getSubdivisionPointsVertexCount
public int getSubdivisionPointsVertexCount(int subdivisions)
-
makeSubdivisionPoints
public void makeSubdivisionPoints(float x1, float y1, float z1, float x2, float y2, float z2, int subdivisions, float[] dest)
-
getBilinearSurfaceFillIndexCount
public int getBilinearSurfaceFillIndexCount(int uStacks, int vStacks)
-
getBilinearSurfaceOutlineIndexCount
public int getBilinearSurfaceOutlineIndexCount(int uStacks, int vStacks, int mask)
-
getBilinearSurfaceVertexCount
public int getBilinearSurfaceVertexCount(int uStacks, int vStacks)
-
getBilinearSurfaceFillDrawMode
public int getBilinearSurfaceFillDrawMode()
-
getBilinearSurfaceOutlineDrawMode
public int getBilinearSurfaceOutlineDrawMode()
-
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)
-
makeBilinearSurfaceVertices
public void makeBilinearSurfaceVertices(float[] control, int destPos, int uStacks, int vStacks, float[] dest)
-
makeBilinearSurfaceVertexNormals
public void makeBilinearSurfaceVertexNormals(int srcPos, int uStacks, int vStacks, float[] srcVerts, int destPos, float[] dest)
-
makeEllipse
public java.nio.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 of2 * majorRadius
, and a height of2 * 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:
java.lang.IllegalArgumentException
- if any ofmajorRadius
,minorRadius
, orslices
are less than zero.
-
makeEllipseWithLeader
public java.nio.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 of2 * majorRadius
, and a height of2 * 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
. 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.makeEllipse(float, float, float, float, int)
- 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:
java.lang.IllegalArgumentException
- if any ofmajorRadius
,minorRadius
,slices
, orleaderWidth
are less than zero.
-
makeRectangle
public java.nio.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:
java.lang.IllegalArgumentException
- if eitherwidth
orheight
are less than zero.
-
makeRectangle
public java.nio.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
andcornerSlices
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 eithercornerRadius
orcornerSlices
are 0, this returns a rectangle with sharp corners and is equivalent to calling
. ThemakeRectangle(float, float, float, float)
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:
java.lang.IllegalArgumentException
- if any ofwidth
,height
,cornerRadius
, orcornerSlices
are less than zero.
-
makeRectangleWithLeader
public java.nio.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
. 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.makeRectangle(float, float, float, float)
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:
java.lang.IllegalArgumentException
- if any ofwidth
,height
, orleaderWidth
are less than zero.
-
makeRectangleWithLeader
public java.nio.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
andcornerSlices
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 eithercornerRadius
orcornerSlices
are 0, this returns a rectangle with sharp corners and is equivalent to calling
. ThemakeRectangleWithLeader(float, float, float, float, float, float, float)
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
. 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.makeRectangle(float, float, float, float, float, int)
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:
java.lang.IllegalArgumentException
- if any ofwidth
,height
,cornerRadius
,cornerSlices
, orleaderWidth
are less than zero.
-
addRectangleRoundedCorner
protected void addRectangleRoundedCorner(float x, float y, float radius, float start, float sweep, int slices, java.nio.FloatBuffer buffer)
Adds the vertices for one rounded corner of a two-dimensional rectangular to the specifiedbuffer
. 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 toslices - 2
. This does nothing ifslices
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 ofLEADER_LOCATION_LEFT
,LEADER_LOCATION_RIGHT
,LEADER_LOCATION_BOTTOM
, andLEADER_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 returnsLEADER_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.
-
reversePoints
public <T> void reversePoints(int pos, int count, T[] points)
-
-