mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
d3dx9: Simplify D3DXComputeBoundingSphere.
This commit is contained in:
parent
0ef523e2bf
commit
10d1253971
1 changed files with 3 additions and 7 deletions
|
@ -1991,7 +1991,7 @@ HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *pfirstposition, DWORD n
|
|||
*/
|
||||
HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pcenter, FLOAT *pradius)
|
||||
{
|
||||
D3DXVECTOR3 temp, temp1;
|
||||
D3DXVECTOR3 temp;
|
||||
FLOAT d;
|
||||
unsigned int i;
|
||||
|
||||
|
@ -2000,16 +2000,12 @@ HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWOR
|
|||
temp.x = 0.0f;
|
||||
temp.y = 0.0f;
|
||||
temp.z = 0.0f;
|
||||
temp1 = temp;
|
||||
*pradius = 0.0f;
|
||||
|
||||
for(i=0; i<numvertices; i++)
|
||||
{
|
||||
D3DXVec3Add(&temp1, &temp, (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i));
|
||||
temp = temp1;
|
||||
}
|
||||
D3DXVec3Add(&temp, &temp, (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i));
|
||||
|
||||
D3DXVec3Scale(pcenter, &temp, 1.0f/((FLOAT)numvertices));
|
||||
D3DXVec3Scale(pcenter, &temp, 1.0f / numvertices);
|
||||
|
||||
for(i=0; i<numvertices; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue