67 n_vertices(_n_vertices),
74 FERMAT_ASSERT(i < n_vertices);
75 return vertex_ids[i * stride];
81 FERMAT_ASSERT(i < n_vertices);
82 return vertex_ids[(n_vertices - i - 1) * stride];
88 FERMAT_ASSERT(i < n_vertices);
89 return vertex_ids[i * stride];
95 FERMAT_ASSERT(i < n_vertices);
96 return vertex_ids[(n_vertices - i - 1) * stride];
110 const float d2 = cugar::max( cugar::square_length(out), 1.0e-8f);
114 return fabsf(cugar::dot(v.normal_s, out) * cugar::dot(v_next.normal_s, out)) / d2;
152 l_vertex_ids(_l_verts),
153 e_vertex_ids(_e_verts),
154 l_vertices(_l_vertices),
155 e_vertices(_e_vertices),
156 n_vertices(_l_vertices + _e_vertices),
163 FERMAT_ASSERT(i < l_vertices + e_vertices);
164 return i < l_vertices ?
165 l_vertex_ids[i * stride] :
166 e_vertex_ids[(l_vertices + e_vertices - i - 1) * stride];
172 FERMAT_ASSERT(i < l_vertices + e_vertices);
173 return i < e_vertices ?
174 e_vertex_ids[i * stride] :
175 l_vertex_ids[(l_vertices + e_vertices - i - 1) * stride];
181 FERMAT_ASSERT(i < l_vertices + e_vertices);
182 return i < l_vertices ?
183 l_vertex_ids[i * stride] :
184 e_vertex_ids[(l_vertices + e_vertices - i - 1) * stride];
190 FERMAT_ASSERT(i < l_vertices + e_vertices);
191 return i < e_vertices ?
192 e_vertex_ids[i * stride] :
193 l_vertex_ids[(l_vertices + e_vertices - i - 1) * stride];
207 const float d2 = cugar::max( cugar::square_length(out), 1.0e-8f);
211 return fabsf(cugar::dot(v.normal_s, out) * cugar::dot(v_next.normal_s, out)) / d2;
235 template <
typename T>
246 PathCache(
const uint32 _n_vertices, T* _verts,
const uint32 _stride) :
248 n_vertices(_n_vertices),
253 const T& v_L(
const uint32 i)
const 255 FERMAT_ASSERT(i < n_vertices);
256 return vertices[i * stride];
260 const T& v_E(
const uint32 i)
const 262 FERMAT_ASSERT(i < n_vertices);
263 return vertices[(n_vertices - i - 1) * stride];
267 T& v_L(
const uint32 i)
269 FERMAT_ASSERT(i < n_vertices);
270 return vertices[i * stride];
274 T& v_E(
const uint32 i)
276 FERMAT_ASSERT(i < n_vertices);
277 return vertices[(n_vertices - i - 1) * stride];
FERMAT_HOST_DEVICE void setup_differential_geometry(const MeshView &mesh, const uint32 tri_id, const float u, const float v, VertexGeometry *geom, float *pdf=0)
Definition: mesh_utils.h:185
FERMAT_HOST_DEVICE cugar::Vector3f interpolate_position(const MeshView &mesh, const uint32 tri_id, const float u, const float v, float *pdf=0)
Definition: mesh_utils.h:323
Definition: renderer_view.h:80