| 31 | } |
| 32 | |
| 33 | void 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 | |
| 49 | void BoundingSphereUpdate( const Vector4& addSphere, Vector4& resultSphere ) |
| 50 | { |
no test coverage detected