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

Function BoundingSphereUpdate

trinity/Utilities/BoundingSphere.cpp:33–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void BoundingSphereUpdate( const Vector3& pos, Vector4& sphere )
34{
35 // do not update if is inside
36 if( BoundingSphereIsInside( sphere, pos ) )
37 {
38 return;
39 }
40
41 // extend sphere
42 Vector3 delta = pos - (Vector3&)sphere;
43 float deltaLen = Length( delta );
44
45 (Vector3&)sphere += 0.5f * ( 1.f - sphere.w / deltaLen ) * delta;
46 sphere.w = 0.5f * ( sphere.w + deltaLen );
47}
48
49void BoundingSphereUpdate( const Vector4& addSphere, Vector4& resultSphere )
50{

Callers 14

FillVertexBufferMethod · 0.85
GetDynamicBoundsMethod · 0.85
RenderDynamicBoundsMethod · 0.85
GetDynamicBoundsMethod · 0.85
RenderDynamicBoundsMethod · 0.85
GetDynamicBoundsMethod · 0.85
RenderDynamicBoundsMethod · 0.85
RebuildGeometryMethod · 0.85
SubmitChangesMethod · 0.85
GetBoundingSphereMethod · 0.85

Calls 3

BoundingSphereIsInsideFunction · 0.85
LengthFunction · 0.85

Tested by

no test coverage detected