File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -419,15 +419,12 @@ int main()
419
419
return 0 .5f *core::length (differentialElementCrossProdcut).x ;
420
420
};
421
421
422
- const auto * mesh_meta = static_cast < const ext::MitsubaLoader::CMitsubaMetadata::CMesh*>( globalMeta->getAssetSpecificMetadata (cpumesh.get () ));
423
- const auto instances = mesh_meta->getInstances ();
424
- for (size_t i= 0u ; i<instances. size (); i++ )
422
+ const auto * mesh_meta = globalMeta->getAssetSpecificMetadata (cpumesh.get ());
423
+ auto auxInstanceDataIt = mesh_meta->m_instanceAuxData . begin ();
424
+ for (const auto & inst : mesh_meta-> m_instances )
425
425
{
426
- const auto & inst = instances.begin ()[i];
427
- for (const auto & inst : instances)
428
- sceneBound.addInternalBox (core::transformBoxEx (cpumesh->getBoundingBox (),inst.worldTform ));
429
- const auto & aux = mesh_meta->m_instanceAuxData ->operator [](i);
430
- if (aux.emitter .type ==ext::MitsubaLoader::CElementEmitter::AREA)
426
+ sceneBound.addInternalBox (core::transformBoxEx (cpumesh->getBoundingBox (),inst.worldTform ));
427
+ if (auxInstanceDataIt->frontEmitter .type ==ext::MitsubaLoader::CElementEmitter::AREA)
431
428
{
432
429
core::vectorSIMDf pos;
433
430
assert (cpumesh->getMeshBuffers ().size ()==1u );
@@ -436,11 +433,12 @@ int main()
436
433
inst.worldTform .pseudoMulWith4x1 (pos);
437
434
438
435
SLight l;
439
- l.intensity = aux. emitter .area .radiance *area*2 .f *core::PI<float >();
436
+ l.intensity = auxInstanceDataIt-> frontEmitter .area .radiance *area*2 .f *core::PI<float >();
440
437
l.position = pos;
441
438
442
439
lights.push_back (l);
443
440
}
441
+ auxInstanceDataIt++;
444
442
}
445
443
}
446
444
You can’t perform that action at this time.
0 commit comments