instance pour le bvh, cf fonctions bounds() et intersect().
More...
|
| | Instance (const BBox &bounds, const Transform &model, BVH &bvh, const int id) |
| BBox | bounds () const |
| Hit | intersect (const Ray &ray, const float htmax) const |
| | Instance (const BBox &bounds, const Transform &model, BVH *bvh, const int id) |
| BBox | bounds () const |
| Hit | intersect (const Ray &ray, const float htmax) const |
| | Instance (const BBox &bounds, const Transform &model, BVH *bvh, const int id) |
| BBox | bounds () const |
| Hit | intersect (const Ray &ray, const float htmax) const |
instance pour le bvh, cf fonctions bounds() et intersect().
Definition at line 302 of file tuto_bvh2.cpp.
◆ Instance() [1/3]
| Instance::Instance |
( |
const BBox & | bounds, |
|
|
const Transform & | model, |
|
|
BVH & | bvh, |
|
|
const int | id ) |
|
inline |
Definition at line 309 of file tuto_bvh2.cpp.
309 :
310 object_transform(
Inverse(model)), world_bounds(transform(bounds, model)),
311 object_bvh(&bvh),
312 instance_id(id)
313 {}
Transform Inverse(const Transform &m)
renvoie l'inverse de la matrice.
◆ Instance() [2/3]
| Instance::Instance |
( |
const BBox & | bounds, |
|
|
const Transform & | model, |
|
|
BVH * | bvh, |
|
|
const int | id ) |
|
inline |
Definition at line 318 of file tuto_bvh2_gltf.cpp.
318 :
319 object_transform(
Inverse(model)), world_bounds(transform(bounds, model)),
320 object_bvh(bvh),
321 instance_id(id)
322 {}
◆ Instance() [3/3]
| Instance::Instance |
( |
const BBox & | bounds, |
|
|
const Transform & | model, |
|
|
BVH * | bvh, |
|
|
const int | id ) |
|
inline |
Definition at line 318 of file tuto_bvh2_gltf_brdf.cpp.
318 :
319 object_transform(
Inverse(model)), world_bounds(transform(bounds, model)),
320 object_bvh(bvh),
321 instance_id(id)
322 {}
◆ bounds() [1/3]
| BBox Instance::bounds |
( |
| ) |
const |
|
inline |
◆ intersect() [1/3]
| Hit Instance::intersect |
( |
const Ray & | ray, |
|
|
const float | htmax ) const |
|
inline |
Definition at line 317 of file tuto_bvh2.cpp.
318 {
319
320 Ray object_ray(object_transform(ray.o), object_transform(ray.d), htmax);
321
322
323 Hit hit= object_bvh->intersect(object_ray, htmax);
324 if(hit)
325
326 hit.instance_id= instance_id;
327
328 return hit;
329 }
◆ transform() [1/3]
Definition at line 332 of file tuto_bvh2.cpp.
333 {
334 BBox bounds= BBox( m(bbox.pmin) );
335
336 for(unsigned i= 1; i < 8; i++)
337 {
338
339 Point p= bbox.pmin;
340 if(i & 1) p.x= bbox.pmax.x;
341 if(i & 2) p.y= bbox.pmax.y;
342 if(i & 4) p.z= bbox.pmax.z;
343
344
345 bounds.insert( m(p) );
346 }
347
348 return bounds;
349 }
◆ bounds() [2/3]
| BBox Instance::bounds |
( |
| ) |
const |
|
inline |
◆ intersect() [2/3]
| Hit Instance::intersect |
( |
const Ray & | ray, |
|
|
const float | htmax ) const |
|
inline |
Definition at line 326 of file tuto_bvh2_gltf.cpp.
327 {
328
329 Ray object_ray(object_transform(ray.o), object_transform(ray.d), htmax);
330
331
332 Hit hit= object_bvh->intersect(object_ray, htmax);
333 if(hit)
334
335 hit.instance_id= instance_id;
336
337 return hit;
338 }
◆ transform() [2/3]
Definition at line 341 of file tuto_bvh2_gltf.cpp.
342 {
343 BBox bounds= BBox( m(bbox.pmin) );
344
345 for(unsigned i= 1; i < 8; i++)
346 {
347
348 Point p= bbox.pmin;
349 if(i & 1) p.x= bbox.pmax.x;
350 if(i & 2) p.y= bbox.pmax.y;
351 if(i & 4) p.z= bbox.pmax.z;
352
353
354 bounds.insert( m(p) );
355 }
356
357 return bounds;
358 }
◆ bounds() [3/3]
| BBox Instance::bounds |
( |
| ) |
const |
|
inline |
◆ intersect() [3/3]
| Hit Instance::intersect |
( |
const Ray & | ray, |
|
|
const float | htmax ) const |
|
inline |
Definition at line 326 of file tuto_bvh2_gltf_brdf.cpp.
327 {
328
329 Ray object_ray(object_transform(ray.o), object_transform(ray.d), htmax);
330
331
332 Hit hit= object_bvh->intersect(object_ray, htmax);
333 if(hit)
334
335 hit.instance_id= instance_id;
336
337 return hit;
338 }
◆ transform() [3/3]
Definition at line 341 of file tuto_bvh2_gltf_brdf.cpp.
342 {
343 BBox bounds= BBox( m(bbox.pmin) );
344
345 for(unsigned i= 1; i < 8; i++)
346 {
347
348 Point p= bbox.pmin;
349 if(i & 1) p.x= bbox.pmax.x;
350 if(i & 2) p.y= bbox.pmax.y;
351 if(i & 4) p.z= bbox.pmax.z;
352
353
354 bounds.insert( m(p) );
355 }
356
357 return bounds;
358 }
◆ object_transform
◆ world_bounds
| BBox Instance::world_bounds |
◆ object_bvh
| BVH * Instance::object_bvh |
◆ instance_id
| int Instance::instance_id |
The documentation for this struct was generated from the following files: