Advertisement
Guest User

Untitled

a guest
May 28th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. if(gCamera->fire)
  2. {
  3.  
  4. //MessageBox(NULL,"Fire","",0);
  5. VecStruct vs;
  6. vs.Dir = gCamera->mLookW;
  7. vs.FPos = gCamera->mPosW; //position of camera
  8.  
  9. //vs.Bullet = mp5.mesh;
  10. vs.life = 0.0f;
  11. vs.BulletTime = mTime;
  12. Vs.push_back(vs);
  13. //totalbulletsfired++;
  14. gCamera->fire = false;
  15.  
  16. }
  17.  
  18. gCamera->VecSize = Vs.size();
  19.  
  20. std::list<VecStruct>::iterator i = Vs.begin();
  21. while( i != Vs.end() )
  22. {
  23. i->life += mTime;
  24.  
  25. if(i->life >= 1000.0f)
  26. {
  27. //i = Vs.erase(i);
  28. }
  29. else
  30. {
  31. //D3DXMatrixTranslation(&i->Pos,
  32. // i->Dir.x*(mTime-i->BulletTime)*5.0f,
  33. // i->Dir.y*(mTime-i->BulletTime)*5.0f,
  34. // i->Dir.z*(mTime-i->BulletTime)*5.0f);
  35. // gd3dDevice->SetTransform(D3DTS_WORLD,&i->Pos);
  36. //mp5.mesh->DrawSubset(0);
  37.  
  38.  
  39. }
  40.  
  41. ++i;
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement