comparison Vis.cpp @ 1029:c94d6a37d298

Pointing a face with mouse fixed.
author Nomad
date Tue, 21 May 2013 12:10:08 +0200
parents 6afa77761a00
children 306ec23b37df d3f4c6584ada
comparison
equal deleted inserted replaced
1028:fbde7d8fcdb1 1029:c94d6a37d298
326 if ( !pGame->pIndoorCameraD3D->IsCulled(&pIndoor->pFaces[pFaceID]) ) 326 if ( !pGame->pIndoorCameraD3D->IsCulled(&pIndoor->pFaces[pFaceID]) )
327 { 327 {
328 if ( Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &a1, &pIndoor->pFaces[pFaceID], 0xFFFFFFFFu) ) 328 if ( Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &a1, &pIndoor->pFaces[pFaceID], 0xFFFFFFFFu) )
329 { 329 {
330 pGame->pIndoorCameraD3D->ViewTransform(&a1, 1); 330 pGame->pIndoorCameraD3D->ViewTransform(&a1, 1);
331 v9 = _48B561_mess_with_scaling_along_z(/*v8, */a1.vWorldViewPosition.x); 331 v9 = fixpoint_from_float(/*v8, */a1.vWorldViewPosition.x);
332 LOWORD(v9) = 0; 332 LOWORD(v9) = 0;
333 v15 = (void *)((PID(OBJECT_BModel,pFaceID)) + v9); 333 v15 = (void *)((PID(OBJECT_BModel,pFaceID)) + v9);
334 pNumPointers = &list->uNumPointers; 334 pNumPointers = &list->uNumPointers;
335 //v16 = 2; 335 //v16 = 2;
336 //v11 = list->uNumPointers; 336 //v11 = list->uNumPointers;
377 377
378 RenderVertexSoft intersection; 378 RenderVertexSoft intersection;
379 if (Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &intersection, &blv_face, i)) 379 if (Intersect_Ray_Face(pRay, pRay + 1, &fDepth, &intersection, &blv_face, i))
380 { 380 {
381 pGame->pIndoorCameraD3D->ViewTransform(&intersection, 1); 381 pGame->pIndoorCameraD3D->ViewTransform(&intersection, 1);
382 int v13 = _48B561_mess_with_scaling_along_z(/*v12, */intersection.vWorldViewPosition.x); 382 int v13 = fixpoint_from_float(/*v12, */intersection.vWorldViewPosition.x);
383 v13 &= 0xFFFF0000;
383 v13 += PID(OBJECT_BModel, j | (i << 6)); 384 v13 += PID(OBJECT_BModel, j | (i << 6));
384 385
385 list->AddObject(face, VisObjectType_Face, v13); 386 list->AddObject(face, VisObjectType_Face, v13);
386 } 387 }
387 388
968 pRotY = pIndoorCamera->sRotationY + UnprojectX((signed __int64)fMouseX); 969 pRotY = pIndoorCamera->sRotationY + UnprojectX((signed __int64)fMouseX);
969 pStartR.z = pIndoorCamera->pos.z; 970 pStartR.z = pIndoorCamera->pos.z;
970 pStartR.x = pIndoorCamera->pos.x; 971 pStartR.x = pIndoorCamera->pos.x;
971 pStartR.y = pIndoorCamera->pos.y; 972 pStartR.y = pIndoorCamera->pos.y;
972 pRotX = pIndoorCamera->sRotationX + UnprojectY((signed __int64)fMouseY); 973 pRotX = pIndoorCamera->sRotationX + UnprojectY((signed __int64)fMouseY);
973 pDepth = _48B561_mess_with_scaling_along_z(/*(int)&fMouseX, */fPickDepth); 974 pDepth = fixpoint_from_float(fPickDepth);
974 Vec3_int_::Rotate(pDepth, pRotY, pRotX, pStartR, &outx, &outy, &outz); 975 Vec3_int_::Rotate(pDepth, pRotY, pRotX, pStartR, &outx, &outy, &outz);
975 976
976 v11[0].flt_2C = 0.0; 977 v11[0].flt_2C = 0.0;
977 v11[0].vWorldPosition.x = (double)outx; 978 v11[0].vWorldPosition.x = (double)outx;
978 v11[0].vWorldPosition.y = (double)outy; 979 v11[0].vWorldPosition.y = (double)outy;