Back to class index
Sphere[Class Summary]
pos
r
ctor (+4 overloads)
Translate(offset)
Transform(transform) (+3 overloads)
MinimalEnclosingAABB()[const]
MaximalContainedAABB()[const]
SetNegativeInfinity()
Volume()[const]
SurfaceArea()[const]
Diameter()[const]
Centroid()[const]
AnyPointFast()[const]
ExtremePoint(direction)[const] (+1 overload)
ProjectToAxis(...)[const]
IsFinite()[const]
IsDegenerate()[const]
SetDegenerate()
Contains(point)[const] (+11 overloads)
Distance(point)[const] (+9 overloads)
MaxDistance(point)[const]
ClosestPoint(point)[const]
Intersects(...)[const] (+11 overloads)
Enclose(point,epsilon) (+10 overloads)
ExtendRadiusToContain(point,epsilon) (+1 overload)
RandomPointInside(lcg)
RandomPointOnSurface(lcg)
Triangulate(...)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
Equals(rhs,epsilon)[const]
BitEquals(other)[const]
FastEnclosingSphere(...)[static]
OptimalEnclosingSphere(...)[static] (+4 overloads)
FitThroughPoints(a,b)[static] (+2 overloads)
RandomPointInside(lcg,center,radius)[static]
RandomPointOnSurface(lcg,center,radius)[static]
RandomUnitaryFloat3(lcg)[static]
IntersectLine(...)[static]
FromString(str,outEndStr)[static] (+1 overload)

Sphere::Triangulate

Syntax

int Sphere::Triangulate(float4 *outPos, float4 *outNormal, float2 *outUV, int numVertices, bool ccwIsFrontFacing) const; [94 lines of code]

Produces a geosphere-triangulation of this sphere.

Parameters

float4 *outPos [out]An array of size numVertices which will receive a triangle list of vertex positions. Cannot be null.float4 *outNormal [out]An array of size numVertices which will receive vertex normals. If this parameter is null, vertex normals are not generated.float2 *outUV [out]An array of size numVertices which will receive UV coordinates. If this parameter is null, UV coordinates are not generated.intnumVerticesThe size of the input arrays outPos and outNormal. This value should be of form 24*4^n for some n >= 0. (24, 96, 384, 1536, 6144, 24576, ...)

Return Value

The actual number of vertices generated (== the number of elements written to outPos and outNormal).