class
ShapeMeshes3D
Helper class for easily creating common 3D shapes.
Public
Methods
staticWireAaBox
Fills the mesh data with vertices representing an outline of axis aligned box.
staticSolidAaBox
Fills the mesh data with vertices representing a solid axis aligned box.
staticWireSphere
Fills the mesh data with vertices representing an outline of a sphere.
- sphere
- Sphere to get the mesh data for
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the sphere will have. Higher level means higher quality but also more vertices and primitives.
staticWireHemisphere
Fills the mesh data with vertices representing an outline of a hemisphere.
- sphere
- Sphere to get the mesh data for
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the sphere will have. Higher level means higher quality but also more vertices and primitives.
staticSolidSphere
Fills the mesh data with vertices representing a sphere.
- sphere
- Sphere to get the mesh data for
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the sphere will have. Higher level means higher quality but also more vertices and primitives.
staticWireArc
Fills the mesh data with vertices representing an outline of an arc.
- center
- Center of the arc to generate geometry for.
- radius
- Radius of the arc to generate geometry for.
- normal
- Normal around which the arc is generated. Arc geometry will be perpendicular to the normal.
- startAngle
- Angle at which the arc starts.
- amountAngle
- Angle that the arc spans.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the arc will have. Higher level means higher quality but also more vertices and primitives.
staticSolidArc
Fills the mesh data with vertices representing a solid double-sided arc.
- center
- Center of the arc to generate geometry for.
- radius
- Radius of the arc to generate geometry for.
- normal
- Normal around which the arc is generated. Arc geometry will be perpendicular to the normal.
- startAngle
- Angle at which the arc starts.
- amountAngle
- Angle that the arc spans.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the arc will have. Higher level means higher quality but also more vertices and primitives.
staticWireDisc
Fills the mesh data with vertices representing an outline of a disc.
- center
- Center of the disc to generate geometry for.
- radius
- Radius of the disc to generate geometry for.
- normal
- Normal around which the disc is generated. Disc geometry will be perpendicular to the normal.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the disc will have. Higher level means higher quality but also more vertices and primitives.
staticSolidDisc
Fills the mesh data with vertices representing a solid double-sided disc.
- center
- Center of the disc to generate geometry for.
- radius
- Radius of the disc to generate geometry for.
- normal
- Normal around which the disc is generated. Disc geometry will be perpendicular to the normal.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the disc will have. Higher level means higher quality but also more vertices and primitives.
staticWireFrustum
Fills the mesh data with vertices representing an outline of an camera frustum.
Frustum will be facing -z and be positioned at world origin.
- position
- Starting point for the frustum.
- aspect
- Aspect ratio (width / height).
- FOV
- Horizontal field of view angle.
- near
- Distance to near clipping plane.
- far
- Distance to far clipping plane.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticWireCone
Fills the mesh data with vertices representing a wireframe cone.
- base
- World position of the cone base.
- normal
- Direction of the pointed part of the cone.
- height
- Cone height (distance from base to the top).
- radius
- Cone radius (distance from base center to outer edge).
- scale
- Scale to apply to the x/y axes, allowing you to create elliptical cones.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the cone will have. Higher level means higher quality but also more vertices and primitives.
staticSolidCone
Fills the mesh data with vertices representing a solid cone.
- base
- World position of the cone base.
- normal
- Direction of the pointed part of the cone.
- height
- Cone height (distance from base to the top).
- radius
- Cone radius (distance from base center to outer edge).
- scale
- Scale to apply to the x/y axes, allowing you to create elliptical cones.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the cone will have. Higher level means higher quality but also more vertices and primitives.
staticWireCylinder
Fills the mesh data with vertices representing a wireframe cylinder.
- base
- World position of the cylinder base.
- normal
- Orientation of the cylinder (height gets applied in this direction).
- height
- Cylinder height (distance from base to the top).
- radius
- Cylinder radius (distance from base center to outer edge).
- scale
- Scale to apply to the x/y axes, allowing you to create elliptical cylinders.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the cylinder will have. Higher level means higher quality but also more vertices and primitives.
staticSolidCylinder
Fills the mesh data with vertices representing a solid cylinder.
- base
- World position of the cylinder base.
- normal
- Orientation of the cylinder (height gets applied in this direction).
- height
- Cylinder height (distance from base to the top).
- radius
- Cylinder radius (distance from base center to outer edge).
- scale
- Scale to apply to the x/y axes, allowing you to create elliptical cylinders.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the cylinder will have. Higher level means higher quality but also more vertices and primitives.
staticSolidQuad
Fills the mesh data with vertices representing a quad (4 triangles, two sided).
- area
- Area in which to draw the quad.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticPixelLine
Fills the mesh data with vertices representing a per-pixel line.
- a
- Start point of the line.
- b
- End point of the line.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticAntialiasedLine
Fills the mesh data with vertices representing an anti-aliased line of specific width.
Antialiasing is done using alpha blending.
- a
- Start point of the line.
- b
- End point of the line.
- up
- Up direction to which the line will run perpendicular to.
- width
- Width of the line.
- borderWidth
- Width of the anti-aliased border.
- color
- Color of the line.
- meshData
- Mesh data that will be populated by this method.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticPixelLineList
Fills the mesh data with vertices representing per-pixel lines.
- linePoints
- A list of start and end points for the lines. Must be a multiple of 2.
- meshData
- Mesh data that will be populated.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticAntialiasedLineList
Fills the mesh data with vertices representing anti-aliased lines of specific width.
Antialiasing is done using alpha blending.
- linePoints
- A list of start and end points for the lines. Must be a multiple of 2.
- up
- Up direction to which the line will run perpendicular to.
- width
- Width of the line.
- borderWidth
- Width of the anti-aliased border.
- color
- Color of the line.
- meshData
- Mesh data that will be populated by this method.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticWireAaBox
Fills the provided buffers with position and index data representing an outline of an axis aligned box.
Use getNumElementsWireAABox() to determine the required sizes of the output buffers.
- box
- Box to create geometry for.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes.
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticSolidAaBox
Fills the provided buffers with position and index data representing a solid axis aligned box.
Use getNumElementsAABox() to determine the required sizes of the output buffers.
- box
- Box to create geometry for.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- outNormals
- Pre-allocated output buffer that will store the vertex normal data.
- outUV
- Pre-allocated output buffer that will store the vertex UV data. Set to null if not required.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and normal buffer)
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticSolidSphere
Fills the provided buffers with position and index data representing a sphere.
Use getNumElementsSphere() to determine the required sizes of the output buffers.
- sphere
- Sphere to create geometry for.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- outNormals
- Pre-allocated output buffer that will store the vertex normal data. Can be null if normals aren't needed.
- outUV
- Pre-allocated output buffer that will store the vertex UV data. Set to null if not required.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and normal buffer)
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the sphere will have. Higher level means higher quality but also more vertices and primitives.
staticWireArc
Fills the provided buffers with position and index data representing an outline of an arc.
Use getNumElementWiresArc() to determine the required sizes of the output buffers.
- center
- Center of the arc to generate geometry for.
- radius
- Radius of the arc to generate geometry for.
- normal
- Normal around which the arc is generated. Arc geometry will be perpendicular to the normal.
- startAngle
- Angle at which the arc starts.
- amountAngle
- Angle that the arc spans.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes.
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the arc will have. Higher level means higher quality but also more vertices and primitives.
staticSolidArc
Fills the provided buffers with position and index data representing a solid arc.
Use getNumElementsArc() to determine the required sizes of the output buffers.
- center
- Center of the arc to generate geometry for.
- radius
- Radius of the arc to generate geometry for.
- normal
- Normal around which the arc is generated. Arc geometry will be perpendicular to the normal.
- startAngle
- Angle at which the arc starts.
- amountAngle
- Angle that the arc spans.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- outNormals
- Pre-allocated output buffer that will store the vertex normal data.
- outUV
- Pre-allocated output buffer that will store the vertex UV data. Set to null if not required.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and normal buffer)
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the arc will have. Higher level means higher quality but also more vertices and primitives.
staticWireFrustum
Fills the provided buffers with position and index data representing an outline of a camera frustum.
Use getNumElementsFrustum() to determine the required sizes of the output buffers.
- position
- Starting point for the frustum.
- aspect
- Aspect ratio (width / height).
- FOV
- Horizontal field of view angle.
- near
- Distance to near clipping plane.
- far
- Distance to far clipping plane.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes.
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticSolidCone
Fills the provided buffers with position and index data representing a solid cone.
Use getNumElementsCone() to determine the required sizes of the output buffers.
- base
- World position of the cone base.
- normal
- Direction of the pointed part of the cone.
- height
- Cone height (distance from base to the top).
- radius
- Cone radius (distance from base center to outer edge).
- scale
- Scale to apply to the x/y axes, allowing you to create elliptical cones.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- outNormals
- Pre-allocated output buffer that will store the vertex normal data. Can be null if normals aren't needed.
- outUV
- Pre-allocated output buffer that will store the vertex UV data. Set to null if not required.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and normal buffer)
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the cone will have. Higher level means higher quality but also more vertices and primitives.
staticWireCone
Fills the provided buffers with position and index data representing a wire cone.
Use getNumElementsWireCone() to determine the required sizes of the output buffers.
- base
- World position of the cone base.
- normal
- Direction of the pointed part of the cone.
- height
- Cone height (distance from base to the top).
- radius
- Cone radius (distance from base center to outer edge).
- scale
- Scale to apply to the x/y axes, allowing you to create elliptical cones.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and normal buffer)
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the cone will have. Higher level means higher quality but also more vertices and primitives.
staticSolidCylinder
Fills the provided buffers with position and index data representing a solid cylinder.
Use getNumElementsCylinder() to determine the required sizes of the output buffers.
- base
- World position of the cylinder base.
- normal
- Orientation of the cylinder (height gets applied in this direction).
- height
- Cylinder height (distance from base to the top).
- radius
- Cylinder radius (distance from base center to outer edge).
- scale
- Scale to apply to the x/y axes, allowing you to create elliptical cylinders.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- outNormals
- Pre-allocated output buffer that will store the vertex normal data. Can be null if normals aren't needed.
- outUV
- Pre-allocated output buffer that will store the vertex UV data. Set to null if not required.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and normal buffer)
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the cylinder will have. Higher level means higher quality but also more vertices and primitives.
staticWireCylinder
Fills the provided buffers with position and index data representing a wire cylinder.
Use getNumElementsWireCylinder() to determine the required sizes of the output buffers.
- base
- World position of the cylinder base.
- normal
- Orientation of the cylinder (height gets applied in this direction).
- height
- Cylinder height (distance from base to the top).
- radius
- Cylinder radius (distance from base center to outer edge).
- scale
- Scale to apply to the x/y axes, allowing you to create elliptical cylinders.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and normal buffer)
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
- quality
- Represents the level of tessellation the cylinder will have. Higher level means higher quality but also more vertices and primitives.
staticSolidQuad
Fills the provided buffers with position and index data representing a solid quad.
Use getNumElementsQuad() to determine the required sizes of the output buffers.
- area
- Area covered by the quad.
- outVertices
- Pre-allocated output buffer that will store the vertex position data.
- outNormals
- Pre-allocated output buffer that will store the vertex normal data.
- outUV
- Pre-allocated output buffer that will store the vertex UV data. Set to null if not required.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and normal buffer)
- outIndices
- Pre-allocated output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticGetNumElementsAaBox
Calculates number of vertices and indices required for geometry of a solid axis aligned box.
staticGetNumElementsWireAaBox
Calculates number of vertices and indices required for geometry of a wireframe axis aligned box.
staticGetNumElementsSphere
Calculates number of vertices and indices required for geometry of a solid sphere of the specified quality.
staticGetNumElementsWireSphere
Calculates number of vertices and indices required for geometry of a wire sphere of the specified quality.
staticGetNumElementsWireHemisphere
Calculates number of vertices and indices required for geometry of a wire hemisphere of the specified quality.
staticGetNumElementsArc
Calculates number of vertices and indices required for geometry of a solid arc of the specified quality.
staticGetNumElementsWireArc
Calculates number of vertices and indices required for geometry of a wire arc of the specified quality.
staticGetNumElementsDisc
Calculates number of vertices and indices required for geometry of a solid desc of the specified quality.
staticGetNumElementsWireDisc
Calculates number of vertices and indices required for geometry of a wire disc of the specified quality.
staticGetNumElementsCone
Calculates number of vertices and indices required for geometry of a solid cone of the specified quality.
staticGetNumElementsWireCone
Calculates number of vertices and indices required for geometry of a wireframe cone of the specified quality.
staticGetNumElementsCylinder
Calculates number of vertices and indices required for geometry of a solid cylinder of the specified quality.
staticGetNumElementsWireCylinder
Calculates number of vertices and indices required for geometry of a wireframe cylinder of the specified quality.
staticGetNumElementsFrustum
Calculates number of vertices and indices required for geometry of a frustum.
staticGetNumElementsQuad
Calculates number of vertices and indices required for geometry of a quadrirateral.
Protected
Methods
staticPixelLine
Fills the provided buffers with vertices representing a per-pixel line.
- a
- Start point of the line.
- b
- End point of the line.
- outVertices
- Output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and color buffer)
- outIndices
- Output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticAntialiasedLine
Fills the provided buffers with vertices representing an antialiased line with a custom width.
- a
- Start point of the line.
- b
- End point of the line.
- up
- Up direction to which the line will run perpendicular to.
- width
- Width of the line.
- borderWidth
- Width of the anti-aliased border.
- color
- Color of the line.
- outVertices
- Output buffer that will store the vertex position data.
- outColors
- Output buffer that will store the vertex color data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and color buffer)
- outIndices
- Output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticPixelSolidPolygon
Fills the provided buffers with position data and indices representing an inner area of a polygon (basically a normal non-antialiased polygon).
- points
- Points defining the polygon. First point is assumed to be the start and end point.
- outVertices
- Output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and color buffer)
- outIndices
- Output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticPixelWirePolygon
Fills the provided buffers with vertices representing a pixel-wide polygon border.
- points
- Points defining the polygon. First point is assumed to be the start and end point.
- outVertices
- Output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and color buffer)
- outIndices
- Output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
staticAntialiasedPolygon
Fills the provided buffers with vertices representing an antialiased polygon.
- points
- Points defining the polygon. First point is assumed to be the start and end point.
- up
- Up direction to which the polygon will run perpendicular to.
- borderWidth
- Width of the anti-aliased border.
- color
- Color of the polygon.
- outVertices
- Output buffer that will store the vertex position data.
- outColors
- Output buffer that will store the vertex color data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and color buffer)
- outIndices
- Output buffer that will store the index data. Indices are 32bit.
- indexOffset
- Offset in number of indices from the start of the buffer to start writing at.
Private
Methods
staticCalcCenter
Calculates the center of the provided vertices.
- vertices
- Buffer containing vertices. Vertices must be of three dimensions at least.
- numVertices
- Number of vertices to calculate the center for.
- vertexStride
- Number of bytes between two vertices in the buffer.
Returns: Center point of the vertices.
staticSubdivideTriangleOnSphere
Subdivides the provided triangle so it approximates a curved surface of a sphere.
- center
- Center of the sphere to approximate.
- radius
- Radius of the sphere to approximate.
- numLevels
- Number of times to subdivide the triangle. Higher number means better approximation.
- a
- First corner of the triangle. Must be normalized.
- b
- Second corner of the triangle. Must be normalized.
- c
- Third corner of the triangle. Must be normalized.
- outVertices
- Output buffer that will store the vertex position data.
- outNormals
- Output buffer that will store the vertex normal data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and color buffer)
Returns: Number of vertices generated (3 * (4 ^ numLevels)).
staticGenerateArcVertices
Generates vertices that are part of an arc approximation.
- center
- Determines world position of the arc.
- up
- Determines rotation of the arc. Arc vertices will be perpendicular to this direction.
- radius
- Distance of arc vertices from the center.
- startAngle
- Angle in degrees to start the arc at.
- angleAmount
- Angle in degrees to extend the arc from the start angle.
- scale
- Scale to apply to the x/y axes, allowing you to create elliptical arcs.
- numVertices
- Number of vertices to generate for the arc. Higher number means better arc approximation. Must be 2 or higher.
- outVertices
- Output buffer that will store the vertex position data.
- vertexOffset
- Offset in number of vertices from the start of the buffer to start writing at.
- vertexStride
- Size of a single vertex, in bytes. (Same for both position and color buffer)
staticGenerateTangents
Calculates per-vertex tangents and bitangents based on the provided vertices, uv coordinates and indices.
- positions
- Pointer to an array of vertex positions.
- normals
- Pointer to an array of vertex normals.
- uv
- Pointer to an array of vertex UV coordinates.
- indices
- Set of 32-bit indices containing indexes into vertex array for each triangle.
- numVertices
- Number of vertices in the , and arrays.
- numIndices
- Number of indices in the array. Must be a multiple of three.
- vertexOffset
- Offset in number of vertices from the start of the buffers to start reading/writing.
- indexOffset
- Offset in number of indices from the start of the buffer to start reading from.
- vertexStride
- Number of bytes to advance the , and arrays with each vertex. If set to zero them each array is advanced according to its own size.
- tangents
- Pre-allocated buffer that will contain the calculated tangents & bitangents packed into 4D vector where first three components are the tangent, and 4th is the sign of the bitangent. Must be the same length as the vertex array.