93 std::array<V, 3> inp, out;
94 for (
int i=0; i<fr->size; i++)
100 if (inv) {ut.invmatVec4(ctp.transf, inp, out);}
101 else {ut.matVec4(ctp.transf, inp, out);}
111 if (inv) {ut.invmatVec4(ctp.transf, inp, out, vec);}
112 else {ut.matVec4(ctp.transf, inp, out, vec);}
139 T ctp, U *fr_in, U *fr_out, V t0)
148 V (*refl_func_ptr)(V, V, V, V, V, V, V, V, V, V);
149 std::array<V, 3> (*refl_norm_ptr)(V, V, V, int, V, V, V);
163 else if (ctp.type == 2)
169 else if (ctp.type == 3)
175 std::array<V, 3> direct;
176 std::array<V, 3> out;
178 for (
int i=start; i<stop; i++)
183 V check = fabs(t1 - _t);
184 std::array<V, 3> norms;
194 direct = {dx, dy, dz};
196 while (check > epsilon)
198 t1 = refl_func_ptr(_t, x, y, z, dx, dy, dz, ctp.coeffs[0], ctp.coeffs[1], ctp.coeffs[2]);
200 check = fabs(t1 - _t);
205 if ((
abs(round(dx)) == 0 &&
abs(round(dy)) == 0 &&
abs(round(dz)) == 0) || std::isnan(_t))
218 fr_out->x[i] = x + _t*dx;
219 fr_out->y[i] = y + _t*dy;
220 fr_out->z[i] = z + _t*dz;
222 norms = refl_norm_ptr(fr_out->x[i], fr_out->y[i], fr_out->z[i], flip, ctp.coeffs[0], ctp.coeffs[1], ctp.coeffs[2]);
223 check = (dx*norms[0] + dy*norms[1] + dz*norms[2]);
225 ut.snell(direct, norms, out);
227 fr_out->dx[i] = out[0];
228 fr_out->dy[i] = out[1];
229 fr_out->dz[i] = out[2];
__device__ __inline__ void transfRays(float *x, float *y, float *z, float *dx, float *dy, float *dz, int i, bool inv=false)
Definition KernelsRTf.cu:209
void propagateRaysToTarget(int start, int stop, T ctp, U *fr_in, U *fr_out, V t0)
Definition RayTrace.h:138