Back to class index
OBB[Class Summary]
pos
r
axis
ctor (+2 overloads)
SetNegativeInfinity()
SetFrom(aabb) (+5 overloads)
ToPolyhedron()[const]
ToPBVolume()[const]
MinimalEnclosingAABB()[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]
AnyPointFast()[const]
Volume()[const]
SurfaceArea()[const]
PointInside(x,y,z)[const]
Edge(edgeIndex)[const]
CornerPoint(cornerIndex)[const]
ExtremePoint(direction)[const] (+1 overload)
ProjectToAxis(...)[const]
UniqueFaceNormals(out)[const]
UniqueEdgeDirections(out)[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(obb,epsilon)[const] (+14 overloads)
Enclose(point)
Triangulate(...)[const]
ToEdgeList(outPos)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
Equals(rhs,epsilon)[const]
BitEquals(other)[const]
NumFaces()[static]
NumEdges()[static]
NumVertices()[static]
ExtremePointsAlongDirection(...)[static]
OptimalEnclosingOBB(...)[static]
NumVerticesInTriangulation(...)[static]
NumVerticesInEdgeList()[static]
FromString(str,outEndStr)[static] (+1 overload)

OBB::SetFrom

Syntax

void OBB::SetFrom(const AABB &aabb); [8 lines of code]
void OBB::SetFrom(const AABB &aabb, const float3x3 &transform); [5 lines of code]
void OBB::SetFrom(const AABB &aabb, const float3x4 &transform); [4 lines of code]
void OBB::SetFrom(const AABB &aabb, const float4x4 &transform); [5 lines of code]
void OBB::SetFrom(const AABB &aabb, const Quat &transform); [4 lines of code]

Sets this OBB from an AABB.

This conversion is exact, and does not loosen the volume.

Note
Converting an OBB back to an AABB is not exact. See the MinimalEnclosingAABB() function for converting to the opposite direction.

Parameters

const AABB &aabbThe axis-aligned bounding box to convert to an OBB. const float3x3 &transformIf a transformation matrix is supplied, this transformation is applied to the AABB before representing it as an oriented bounding box. The basis of this matrix is assumed to be orthogonal, which means no projection or shear is allowed. Additionally, the matrix must contain only uniform scaling.

See Also

classes AABB, float3x3, float3x4, float4x4, Quat, MinimalEnclosingAABB().

Syntax

void OBB::SetFrom(const Sphere &sphere); [8 lines of code]

Sets this OBB to enclose the given sphere.

This function computes the tightest possible OBB (in terms of volume) that contains the given sphere, and stores the result in this structure.

Note
Since an OBB is a box, and Sphere is, well, a sphere, this conversion is not exact, but loosens the set of points in the representation.

See Also

class Sphere, MinimalEnclosingSphere().