Fix possible data corruption in AssimpView (see http://sourceforge.net/projects/assimp/forums/forum/817654/topic/3831953). Thanks to mick-p to point it out.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@810 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2010-08-31 03:25:12 +00:00
parent 631f3a2ff9
commit 400086e19f
2 changed files with 1 additions and 9 deletions

View File

@ -1601,14 +1601,6 @@ int CDisplay::HandleInput()
D3DXVec3TransformNormal((D3DXVECTOR3*)&g_avLightDirs[0], D3DXVec3TransformNormal((D3DXVECTOR3*)&g_avLightDirs[0],
(D3DXVECTOR3*)&g_avLightDirs[0],(D3DXMATRIX*)&mMat); (D3DXVECTOR3*)&g_avLightDirs[0],(D3DXMATRIX*)&mMat);
// 2 lights to rotate?
if (g_sOptions.b3Lights)
{
D3DXVec3TransformNormal((D3DXVECTOR3*)&g_avLightDirs[1],
(D3DXVECTOR3*)&g_avLightDirs[1],(D3DXMATRIX*)&mMat);
g_avLightDirs[1].Normalize();
}
g_avLightDirs[0].Normalize(); g_avLightDirs[0].Normalize();
} }
return 1; return 1;

View File

@ -101,7 +101,7 @@ aiMatrix4x4 g_mWorld;
aiMatrix4x4 g_mWorldRotate; aiMatrix4x4 g_mWorldRotate;
aiVector3D g_vRotateSpeed = aiVector3D(0.5f,0.5f,0.5f); aiVector3D g_vRotateSpeed = aiVector3D(0.5f,0.5f,0.5f);
// NOTE: The second light direction is no computed from the first // NOTE: The second light direction is now computed from the first
aiVector3D g_avLightDirs[1] = aiVector3D g_avLightDirs[1] =
{ aiVector3D(-0.5f,0.6f,0.2f) }; { aiVector3D(-0.5f,0.6f,0.2f) };