MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / FromBox

Method FromBox

Source/Engine/Core/Math/BoundingSphere.cpp:141–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141void BoundingSphere::FromBox(const BoundingBox& box, BoundingSphere& result)
142{
143 if (box.Minimum.IsNanOrInfinity() || box.Maximum.IsNanOrInfinity())
144 {
145 result = Empty;
146 return;
147 }
148 const Real x = box.Maximum.X - box.Minimum.X;
149 const Real y = box.Maximum.Y - box.Minimum.Y;
150 const Real z = box.Maximum.Z - box.Minimum.Z;
151 result.Center.X = box.Minimum.X + x * 0.5f;
152 result.Center.Y = box.Minimum.Y + y * 0.5f;
153 result.Center.Z = box.Minimum.Z + z * 0.5f;
154 result.Radius = Math::Sqrt(x * x + y * y + z * z) * 0.5f;
155}
156
157void BoundingSphere::Merge(const BoundingSphere& value1, const BoundingSphere& value2, BoundingSphere& result)
158{

Callers 3

OnDrawMethod · 0.45
GetActorEditorSphereMethod · 0.45
SetArcBallViewMethod · 0.45

Calls 2

SqrtFunction · 0.70
IsNanOrInfinityMethod · 0.45

Tested by

no test coverage detected