Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Plane::FindInter(const Ray &ray_cp, double &t)
- {
- // Uwaga: parametry A, B, C plaszczyzny to po prostu skladowe jej wektora normalnego
- double tt = (-(ray_cp.Point()[0] * normal[0] + ray_cp.Point()[1] * normal[1] + ray_cp.Point()[2] * normal[2] + d))
- / (normal[0] * ray_cp.Direction()[0] + normal[1] * ray_cp.Direction()[1] + normal[2] * ray_cp.Direction()[2]);;
- if (tt>0.001 && tt < t)
- {
- t = tt;
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment