Move Stats to its own module
Move Stats to its own module and pass it around to the intersection methods to keep track of how many tests and successful intersections there are.
This commit is contained in:
parent
b60e27824b
commit
79c951030d
12 changed files with 166 additions and 62 deletions
18
src/scene.h
18
src/scene.h
|
@ -16,6 +16,7 @@
|
|||
#include "basics.h"
|
||||
#include "camera.h"
|
||||
#include "object.h"
|
||||
#include "stats.hh"
|
||||
|
||||
|
||||
class AmbientLight;
|
||||
|
@ -70,22 +71,7 @@ private:
|
|||
std::list<PointLight *> lights;
|
||||
|
||||
// Rendering stats
|
||||
struct Stats
|
||||
{
|
||||
unsigned long TotalRays() const;
|
||||
|
||||
void PrintRayTable() const;
|
||||
|
||||
/* Ray counts */
|
||||
unsigned long primaryRays;
|
||||
unsigned long shadowRays;
|
||||
unsigned long reflectionRays;
|
||||
unsigned long transmissionRays;
|
||||
|
||||
private:
|
||||
void PrintRayRow(const std::string& title,
|
||||
const unsigned long& value) const;
|
||||
} mStats;
|
||||
charles::Stats mStats;
|
||||
|
||||
// Rendering output.
|
||||
bool _is_rendered;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue