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::Diagonal

Syntax

float3 OBB::Diagonal() const; [4 lines of code]

Returns a diagonal vector of this OBB.

This vector runs from one corner of the OBB from the opposite corner.

Note
A box has four diagonals. This function returns the direction vector from the -X-Y-Z corner to the +X+Y+Z corner of the OBB, in the global space of this OBB.

Performance

float3 OBB::Diagonal() const

20.526nsecs/call ≈ 48.72M calls/second ≈ 811.97k calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

float3 OBB::HalfDiagonal() const

12.316nsecs/call ≈ 81.2M calls/second ≈ 1.35M calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

Syntax

float3 OBB::HalfDiagonal() const; [4 lines of code]

Returns Diagonal()/2.

Return Value

A direction vector from the center of this OBB to the +X+Y+Z corner of this OBB, in global space.

Performance

12.316nsecs/call ≈ 81.2M calls/second ≈ 1.35M calls/frame (@ 60fps).
This function does not perform dynamic memory allocation.

See Also

Size(), HalfSize().

Leave a Comment

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