Guest User

ray mirror

a guest
Sep 26th, 2020
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. float _h = rensizeh / (distance * cos(f - ca));
  2. float _x = rensizew * reni;
  3. float _y = (rensizeh / 2.f - _h / 2.f) + this->getCamera()->GetOffsetY();
  4.  
  5. d3d9_line(this->g_dev, _x, _y, _x + rensizew, _y, D3DCOLOR_ARGB(255, 255, 255, 255));
  6. d3d9_line(this->g_dev, _x, _y + _h, _x + rensizew, _y + _h, D3DCOLOR_ARGB(255, 255, 255, 255));
  7.  
  8. float d = 0.f;
  9. if ((lineIntersect = this->Ray(t, { t.x + dist * static_cast<float>(cos(PI + f)),
  10.     t.y + dist * static_cast<float>(sin(PI + f)) }, t, d, object)))
  11.     distance += d;
  12.         else
  13.     break;
Advertisement
Add Comment
Please, Sign In to add comment