Back to class index
OBB[Class Summary]
pos
r
axis
ctor (+1 overload)
SetNegativeInfinity()
SetFrom(aabb) (+6 overloads)
SetFromApproximate(...)
ToPolyhedron()[const]
MinimalEnclosingAABB()[const]
MaximalContainedAABB()[const]
MinimalEnclosingSphere()[const]
MaximalContainedSphere()[const]
Size()[const]
HalfSize()[const]
Diagonal()[const]
HalfDiagonal()[const]
WorldToLocal()[const]
LocalToWorld()[const]
IsFinite()[const]
IsDegenerate()[const]
CenterPoint()[const]
Centroid()[const]
Volume()[const]
SurfaceArea()[const]
PointInside(x,y,z)[const]
Edge(edgeIndex)[const]
CornerPoint(cornerIndex)[const]
PointOnEdge(edgeIndex,u)[const]
FaceCenterPoint(faceIndex)[const]
FacePoint(faceIndex,u,v)[const]
FacePlane(faceIndex)[const]
GetCornerPoints(outPointArray)[const]
GetFacePlanes(outPlaneArray)[const]
RandomPointInside(rng)[const]
RandomPointOnSurface(rng)[const]
RandomPointOnEdge(rng)[const]
RandomCornerPoint(rng)[const]
Translate(offset)
Scale(...) (+1 overload)
Transform(transform) (+3 overloads)
ClosestPoint(point)[const]
Distance(point)[const] (+1 overload)
Contains(point)[const] (+7 overloads)
Intersects(aabb)[const] (+11 overloads)
Enclose(point)
Triangulate(...)[const]
ToEdgeList(outPos)[const]
ExtremePointsAlongDirection(...)[static]
PCAEnclosingOBB(...)[static]
NumVerticesInTriangulation(...)[static]
NumVerticesInEdgeList()[static]

OBB::Triangulate

Syntax

void OBB::Triangulate(int x, int y, int z, float3 *outPos, float3 *outNormal, float2 *outUV) const; [9 lines of code]

Generates an unindexed triangle mesh representation of this OBB.

Parameters

intxThe number of faces to generate along the X axis. This value must be >= 1. intyThe number of faces to generate along the Y axis. This value must be >= 1. intzThe number of faces to generate along the Z axis. This value must be >= 1. float3 *outPos [out]An array of size numVertices which will receive a triangle list of vertex positions. Cannot be null.float3 *outNormal [out]An array of size numVertices which will receive vertex normals. If this parameter is null, vertex normals are not returned.float2 *outUV [out]An array of size numVertices which will receive vertex UV coordinates. If this parameter is null, a UV mapping is not generated. The number of vertices that outPos, outNormal and outUV must be able to contain is (x*y + x*z + y*z)*2*6. If x==y==z==1, then a total of 36 vertices are required. Call NumVerticesInTriangulation to obtain this value.

Performance

36.947nsecs/call ≈ 27.07M calls/second ≈ 451.09k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

See Also

ToPolyhedron(), ToEdgeList(), NumVerticesInTriangulation().

Leave a Comment

Name:
Comments:
Captcha:captcha image Type in the black symbols:
Back to class index