Clean up some dependencies between scene, material, and color
This commit is contained in:
parent
48e35dfc81
commit
c3da70cdd9
4 changed files with 11 additions and 11 deletions
|
@ -46,12 +46,12 @@ private:
|
||||||
// Diffuse parameters.
|
// Diffuse parameters.
|
||||||
DiffuseShaderModel mDiffuseModel;
|
DiffuseShaderModel mDiffuseModel;
|
||||||
Double mDiffuseIntensity;
|
Double mDiffuseIntensity;
|
||||||
Color mDiffuseColor;
|
basics::Color mDiffuseColor;
|
||||||
|
|
||||||
// Specular parameters.
|
// Specular parameters.
|
||||||
SpecularShaderModel mSpecularModel;
|
SpecularShaderModel mSpecularModel;
|
||||||
Double mSpecularIntensity;
|
Double mSpecularIntensity;
|
||||||
Color mSpecularColor;
|
basics::Color mSpecularColor;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace charles */
|
} /* namespace charles */
|
||||||
|
|
|
@ -10,10 +10,8 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "material.h"
|
#include "material.hh"
|
||||||
#include "stats.hh"
|
#include "stats.hh"
|
||||||
#include "texture.h"
|
|
||||||
#include "types.hh"
|
|
||||||
#include "basics/basics.hh"
|
#include "basics/basics.hh"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "scene.hh"
|
#include "scene.hh"
|
||||||
|
|
||||||
#include "basics.h"
|
#include "basics.h"
|
||||||
#include "light.h"
|
#include "light.hh"
|
||||||
#include "log.hh"
|
#include "log.hh"
|
||||||
#include "object.hh"
|
#include "object.hh"
|
||||||
#include "writer.h"
|
#include "writer.h"
|
||||||
|
@ -23,6 +23,7 @@
|
||||||
#include "logModule.hh"
|
#include "logModule.hh"
|
||||||
|
|
||||||
|
|
||||||
|
using charles::basics::Color;
|
||||||
using charles::basics::Ray;
|
using charles::basics::Ray;
|
||||||
using charles::basics::Vector4;
|
using charles::basics::Vector4;
|
||||||
|
|
||||||
|
|
11
src/scene.hh
11
src/scene.hh
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include "camera.hh"
|
#include "camera.hh"
|
||||||
#include "light.hh"
|
#include "light.hh"
|
||||||
|
#include "lightPoint.hh"
|
||||||
#include "object.hh"
|
#include "object.hh"
|
||||||
#include "stats.hh"
|
#include "stats.hh"
|
||||||
#include "basics/basics.hh"
|
#include "basics/basics.hh"
|
||||||
|
@ -42,16 +43,16 @@ struct Scene
|
||||||
|
|
||||||
void Render();
|
void Render();
|
||||||
bool IsRendered() const;
|
bool IsRendered() const;
|
||||||
const Color* GetPixels() const;
|
const basics::Color* GetPixels() const;
|
||||||
|
|
||||||
AmbientLight& GetAmbient();
|
AmbientLight& GetAmbient();
|
||||||
void AddObject(Object::Ptr obj);
|
void AddObject(Object::Ptr obj);
|
||||||
void AddLight(PointLight* light);
|
void AddLight(PointLight* light);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Color TraceRay(const basics::Ray &ray,
|
basics::Color TraceRay(const basics::Ray &ray,
|
||||||
const int depth = 0,
|
const int depth = 0,
|
||||||
const Double weight = 1.0);
|
const Double weight = 1.0);
|
||||||
|
|
||||||
void LogCamera() const;
|
void LogCamera() const;
|
||||||
void LogObjects() const;
|
void LogObjects() const;
|
||||||
|
@ -78,7 +79,7 @@ private:
|
||||||
|
|
||||||
// Rendering output.
|
// Rendering output.
|
||||||
bool mIsRendered;
|
bool mIsRendered;
|
||||||
Color *mPixels;
|
basics::Color *mPixels;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace charles */
|
} /* namespace charles */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue