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

Function BoundingSphereFromPoints

trinity/Utilities/BoundingSphere.cpp:264–270  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Create a bounding sphere by two given points --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

262// Create a bounding sphere by two given points
263// --------------------------------------------------------------------------------
264void BoundingSphereFromPoints( Vector4& sphere, const Vector3& point1, const Vector3& point2 )
265{
266 const float radiusEpsilon = 1e-4f;
267
268 Vector3 a = 0.5f * ( point2 - point1 );
269 sphere = Vector4( a + point1, Length( a ) + radiusEpsilon );
270}
271
272// --------------------------------------------------------------------------------
273// Description:

Calls 8

LengthFunction · 0.85
Vector4dClass · 0.85
CrossFunction · 0.85
AsVector4Method · 0.80
Vector3dClass · 0.70
DotFunction · 0.70
Vector4Class · 0.50

Tested by

no test coverage detected