MCPcopy Create free account
hub / github.com/carbonengine/trinity / BoundingSphereFromBox

Function BoundingSphereFromBox

trinity/Utilities/BoundingSphere.cpp:182–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void BoundingSphereFromBox( Vector4& sphere, const Vector3& minBounds, const Vector3& maxBounds, const Matrix* tf )
183{
184 Vector3 min( minBounds );
185 Vector3 max( maxBounds );
186
187 if( tf )
188 {
189 min = TransformCoord( minBounds, *tf );
190 max = TransformCoord( maxBounds, *tf );
191 }
192
193 sphere.GetXYZ() = min + max;
194 min -= max;
195 sphere.w = Length( min );
196 sphere *= 0.5f;
197}
198
199// --------------------------------------------------------------------------------
200// Description:

Callers 10

GetBoundingSphereMethod · 0.85
RebuildMethod · 0.85
EstimatePixelDiameterMethod · 0.85
UpdateWorldBoundsMethod · 0.85
GetBoundingSphereMethod · 0.85
GetLocalBoundingBoxMethod · 0.85
UpdateVisibilityMethod · 0.85
UpdateAsyncronousMethod · 0.85
UpdateSyncronousMethod · 0.85
UpdateAsyncronousMethod · 0.85

Calls 1

LengthFunction · 0.85

Tested by

no test coverage detected