From 400086e19f5c8a1aee0167f959f284c1161d8bfc Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Tue, 31 Aug 2010 03:25:12 +0000 Subject: [PATCH] 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 --- tools/assimp_view/Display.cpp | 8 -------- tools/assimp_view/assimp_view.cpp | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/tools/assimp_view/Display.cpp b/tools/assimp_view/Display.cpp index 808347a2a..098870e68 100644 --- a/tools/assimp_view/Display.cpp +++ b/tools/assimp_view/Display.cpp @@ -1601,14 +1601,6 @@ int CDisplay::HandleInput() D3DXVec3TransformNormal((D3DXVECTOR3*)&g_avLightDirs[0], (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(); } return 1; diff --git a/tools/assimp_view/assimp_view.cpp b/tools/assimp_view/assimp_view.cpp index 71c3cfd2b..d776fa407 100644 --- a/tools/assimp_view/assimp_view.cpp +++ b/tools/assimp_view/assimp_view.cpp @@ -101,7 +101,7 @@ aiMatrix4x4 g_mWorld; aiMatrix4x4 g_mWorldRotate; 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(-0.5f,0.6f,0.2f) };