From c42e5d44ee0aa468ec676be2534972b0ba86196b Mon Sep 17 00:00:00 2001 From: Peter Schaefer Date: Tue, 5 Apr 2016 20:56:30 +0200 Subject: [PATCH] merged Lights --- .gitignore | 1 + Weave/Graphix/PointLight.cpp | 55 +++++++++++++++++++ Weave/Graphix/PointLight.h | 20 +++++++ Weave/Weave.vcxproj | 6 +- Weave/Weave.vcxproj.filters | 6 ++ .../Debug/BulletCollision.log | 3 +- 6 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 Weave/Graphix/PointLight.cpp create mode 100644 Weave/Graphix/PointLight.h diff --git a/.gitignore b/.gitignore index 4f15c4c..d596d27 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ build-* *.opendb *.db +*.log *.exe *.pdb diff --git a/Weave/Graphix/PointLight.cpp b/Weave/Graphix/PointLight.cpp new file mode 100644 index 0000000..634f6bb --- /dev/null +++ b/Weave/Graphix/PointLight.cpp @@ -0,0 +1,55 @@ +#include "PointLight.h" +#include "Graphix.h" + + + + +struct CameraDirection +{ + GLenum CubemapFace; + vec3 Target; + vec3 Up; +}; + +CameraDirection gCameraDirections[6] = +{ + {GL_TEXTURE_CUBE_MAP_POSITIVE_X, vec3(1.0f, 0.0f, 0.0f), vec3(0.0f, -1.0f, 0.0f)}, + {GL_TEXTURE_CUBE_MAP_NEGATIVE_X, vec3(-1.0f, 0.0f, 0.0f), vec3(0.0f, -1.0f, 0.0f)}, + {GL_TEXTURE_CUBE_MAP_POSITIVE_Y, vec3(0.0f, 1.0f, 0.0f), vec3(0.0f, 0.0f, -1.0f)}, + {GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, vec3(0.0f, -1.0f, 0.0f), vec3(0.0f, 0.0f, 1.0f)}, + {GL_TEXTURE_CUBE_MAP_POSITIVE_Z, vec3(0.0f, 0.0f, 1.0f), vec3(0.0f, -1.0f, 0.0f)}, + {GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, vec3(0.0f, 0.0f, -1.0f), vec3(0.0f, -1.0f, 0.0f)} +}; + + + + + +PointLight::PointLight(vec3& _position, vec3& _color) : + position(_position), + color(_color), + active(true) +{ + +} + +PointLight::~PointLight() +{ + +} + +void PointLight::changeLight(vec3& _position, vec3& _color) +{ + position = _position; + color = _color; +} + +void PointLight::turnOn() +{ + active = true; +} + +void PointLight::turnOff() +{ + active = false; +} \ No newline at end of file diff --git a/Weave/Graphix/PointLight.h b/Weave/Graphix/PointLight.h new file mode 100644 index 0000000..17355a0 --- /dev/null +++ b/Weave/Graphix/PointLight.h @@ -0,0 +1,20 @@ +#pragma once + +#include "../GLM.h" + +class PointLight +{ +public: + PointLight(vec3& _position, vec3& _color); + + virtual ~PointLight(); + + void changeLight(vec3& _position, vec3& _color); + void turnOn(); + void turnOff(); + +protected: + vec3 position; + vec3 color; + bool active; +}; \ No newline at end of file diff --git a/Weave/Weave.vcxproj b/Weave/Weave.vcxproj index 722b3c6..25db5a9 100644 --- a/Weave/Weave.vcxproj +++ b/Weave/Weave.vcxproj @@ -103,7 +103,8 @@ - + + @@ -132,7 +133,8 @@ - + + diff --git a/Weave/Weave.vcxproj.filters b/Weave/Weave.vcxproj.filters index 09a7867..fe9d56b 100644 --- a/Weave/Weave.vcxproj.filters +++ b/Weave/Weave.vcxproj.filters @@ -87,6 +87,9 @@ Source Files + + Source Files + @@ -170,5 +173,8 @@ Header Files + + Header Files + \ No newline at end of file diff --git a/res/bulletMAKE/src/BulletCollision/BulletCollision.dir/Debug/BulletCollision.log b/res/bulletMAKE/src/BulletCollision/BulletCollision.dir/Debug/BulletCollision.log index 063e1f8..ae265fb 100644 --- a/res/bulletMAKE/src/BulletCollision/BulletCollision.dir/Debug/BulletCollision.log +++ b/res/bulletMAKE/src/BulletCollision/BulletCollision.dir/Debug/BulletCollision.log @@ -1,2 +1 @@ -btBroadphaseProxy.obj : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library - BulletCollision.vcxproj -> C:\Daten\Visual Studio 2015\Projects\CGUE2015_Weave\res\bulletMAKE\lib\Debug\BulletCollision_Debug.lib + BulletCollision.vcxproj -> C:\Daten\Visual Studio 2015\Projects\CGUE2015_Weave\res\bulletMAKE\lib\Debug\BulletCollision_Debug.lib -- 2.47.3