Add LightingInstance

Still need to work on PropertyGrid for it
This commit is contained in:
Modnark
2022-10-12 13:47:39 -04:00
parent 8916797e55
commit 0ac516618a
10 changed files with 338 additions and 150 deletions

View File

@@ -48,7 +48,6 @@ class Application { // : public GApp {
int getMode();
void unSetMode();
void toggleSky();
CameraController cameraController;
UserInput* userInput;
PropertyWindow* _propWindow;
@@ -56,7 +55,6 @@ class Application { // : public GApp {
RenderDevice* getRenderDevice();
void selectInstance(Instance* selectedInstance,PropertyWindow* propWindow);
void setMode(int mode);
SkyRef getSky();
void resize3DView(int w, int h);
Tool * tool;
@@ -68,7 +66,6 @@ class Application { // : public GApp {
RenderDevice* renderDevice;
//void initGUI();
HWND _hWndMain;
SkyRef sky;
bool quit;
bool mouseOnScreen;
bool rightButtonHolding;
@@ -85,7 +82,6 @@ class Application { // : public GApp {
GAppSettings _settings;
double lightProjX, lightProjY, lightProjNear, lightProjFar;
IEBrowser* webBrowser;
bool _hideSky;
protected:
Stopwatch m_graphicsWatch;
Stopwatch m_logicWatch;

View File

@@ -9,6 +9,7 @@
#include "ThumbnailGeneratorInstance.h"
#include "XplicitNgine/XplicitNgine.h"
#include "SoundService.h"
#include "LightingInstance.h"
// Libraries
#include "rapidxml/rapidxml.hpp"
@@ -36,6 +37,7 @@ public:
XplicitNgine* getEngine();
ThumbnailGeneratorInstance* getThumbnailGenerator();
SoundService* getSoundService();
LightingInstance* getLighting();
std::string message;
std::string _loadedFileName;
@@ -69,7 +71,7 @@ private:
ThumbnailGeneratorInstance* thumbnailGenerator;
XplicitNgine* xplicitNgine;
SoundService* soundService;
LightingInstance* lightingInstance;
bool running;
};

View File

@@ -0,0 +1,44 @@
#pragma once
#include "Instance.h"
class LightingInstance :
public Instance
{
public:
LightingInstance(void);
~LightingInstance(void);
// Getters
G3D::Color3 getTopAmbient();
G3D::Color3 getBottomAmbient();
G3D::Color3 getSpotLight();
G3D::Color4 getClearColor();
G3D::SkyRef getSky();
G3D::LightingParameters getLightingParameters();
// Setters
void setTopAmbient(G3D::Color3 newValue);
void setBottomAmbient(G3D::Color3 newValue);
void setSpotLight(G3D::Color3 newValue);
void setClearColor(G3D::Color4 clearColor);
// Functions
void drawSky();
void suppressSky(bool doSuppress);
void update();
void drawEffects();
void drawOutlines(Vector3 from, Vector3 to, RenderDevice* rd, Vector3 size, Vector3 pos, CoordinateFrame c);
// Properties
void PropUpdate(LPPROPGRIDITEM &pItem);
std::vector<PROPGRIDITEM> getProperties();
private:
G3D::Color3 topAmbient;
G3D::Color3 bottomAmbient;
G3D::Color3 spotLight;
G3D::Color4 clearColor;
G3D::SkyRef sky;
G3D::LightingParameters lighting;
bool _hideSky;
};