Commit ef65fdda authored by Rico Schüller's avatar Rico Schüller Committed by Alexandre Julliard

d3dx9: Use float functions in D3DXQuaternionExp().

parent 9a281e5d
...@@ -1263,28 +1263,29 @@ D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3D ...@@ -1263,28 +1263,29 @@ D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3D
return pout; return pout;
} }
D3DXQUATERNION* WINAPI D3DXQuaternionExp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) D3DXQUATERNION * WINAPI D3DXQuaternionExp(D3DXQUATERNION *out, const D3DXQUATERNION *q)
{ {
FLOAT norm; FLOAT norm;
TRACE("(%p, %p)\n", pout, pq); TRACE("out %p, q %p\n", out, q);
norm = sqrt(pq->x * pq->x + pq->y * pq->y + pq->z * pq->z); norm = sqrtf(q->x * q->x + q->y * q->y + q->z * q->z);
if (norm ) if (norm)
{ {
pout->x = sin(norm) * pq->x / norm; out->x = sinf(norm) * q->x / norm;
pout->y = sin(norm) * pq->y / norm; out->y = sinf(norm) * q->y / norm;
pout->z = sin(norm) * pq->z / norm; out->z = sinf(norm) * q->z / norm;
pout->w = cos(norm); out->w = cosf(norm);
} }
else else
{ {
pout->x = 0.0f; out->x = 0.0f;
pout->y = 0.0f; out->y = 0.0f;
pout->z = 0.0f; out->z = 0.0f;
pout->w = 1.0f; out->w = 1.0f;
} }
return pout;
return out;
} }
D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment