diff --git a/Bin/DLL/DebugCameraVertex.cso b/Bin/DLL/DebugCameraVertex.cso
deleted file mode 100644
index a7193b0b..00000000
Binary files a/Bin/DLL/DebugCameraVertex.cso and /dev/null differ
diff --git a/Bin/DLL/DebugPixel.cso b/Bin/DLL/DebugPixel.cso
deleted file mode 100644
index 85c09751..00000000
Binary files a/Bin/DLL/DebugPixel.cso and /dev/null differ
diff --git a/Bin/DLL/DebugVertex.cso b/Bin/DLL/DebugVertex.cso
deleted file mode 100644
index 409bf6f3..00000000
Binary files a/Bin/DLL/DebugVertex.cso and /dev/null differ
diff --git a/Bin/DLL/GamePhysics_x86D.dll b/Bin/DLL/GamePhysics_x86D.dll
deleted file mode 100644
index e0cde94c..00000000
Binary files a/Bin/DLL/GamePhysics_x86D.dll and /dev/null differ
diff --git a/Bin/DLL/GamePhysics_x86D.exp b/Bin/DLL/GamePhysics_x86D.exp
deleted file mode 100644
index 8f629462..00000000
Binary files a/Bin/DLL/GamePhysics_x86D.exp and /dev/null differ
diff --git a/Bin/DLL/GamePhysics_x86D.ilk b/Bin/DLL/GamePhysics_x86D.ilk
deleted file mode 100644
index be8bdf09..00000000
Binary files a/Bin/DLL/GamePhysics_x86D.ilk and /dev/null differ
diff --git a/Bin/DLL/GamePhysics_x86D.pdb b/Bin/DLL/GamePhysics_x86D.pdb
deleted file mode 100644
index b303fcd0..00000000
Binary files a/Bin/DLL/GamePhysics_x86D.pdb and /dev/null differ
diff --git a/Bin/DLL/OysterGraphics_x86D.dll b/Bin/DLL/OysterGraphics_x86D.dll
deleted file mode 100644
index 6dce6c5d..00000000
Binary files a/Bin/DLL/OysterGraphics_x86D.dll and /dev/null differ
diff --git a/Bin/DLL/OysterGraphics_x86D.exp b/Bin/DLL/OysterGraphics_x86D.exp
deleted file mode 100644
index 47ea6535..00000000
Binary files a/Bin/DLL/OysterGraphics_x86D.exp and /dev/null differ
diff --git a/Bin/DLL/OysterGraphics_x86D.ilk b/Bin/DLL/OysterGraphics_x86D.ilk
deleted file mode 100644
index 4916683f..00000000
Binary files a/Bin/DLL/OysterGraphics_x86D.ilk and /dev/null differ
diff --git a/Bin/DLL/OysterGraphics_x86D.pdb b/Bin/DLL/OysterGraphics_x86D.pdb
deleted file mode 100644
index baf503ea..00000000
Binary files a/Bin/DLL/OysterGraphics_x86D.pdb and /dev/null differ
diff --git a/Bin/DLL/PixelGatherData.cso b/Bin/DLL/PixelGatherData.cso
deleted file mode 100644
index 1b5ca385..00000000
Binary files a/Bin/DLL/PixelGatherData.cso and /dev/null differ
diff --git a/Bin/DLL/TextureDebug.cso b/Bin/DLL/TextureDebug.cso
deleted file mode 100644
index bce054c2..00000000
Binary files a/Bin/DLL/TextureDebug.cso and /dev/null differ
diff --git a/Bin/DLL/VertexGatherData.cso b/Bin/DLL/VertexGatherData.cso
deleted file mode 100644
index 50f8cf52..00000000
Binary files a/Bin/DLL/VertexGatherData.cso and /dev/null differ
diff --git a/Code/DanBias.sln b/Code/DanBias.sln
index 609eedd3..2e047aee 100644
--- a/Code/DanBias.sln
+++ b/Code/DanBias.sln
@@ -29,6 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GamePhysics", "GamePhysics\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tester", "Tester\Tester.vcxproj", "{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DanBiasGame", "DanBiasGame\DanBiasGame.vcxproj", "{2A1BC987-AF42-4500-802D-89CD32FC1309}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Mixed Platforms = Debug|Mixed Platforms
@@ -175,6 +177,7 @@ Global
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.ActiveCfg = Debug|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|Win32.Build.0 = Debug|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.ActiveCfg = Debug|x64
+ {104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Debug|x64.Build.0 = Debug|x64
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Mixed Platforms.Build.0 = Release|Win32
{104FA3E9-94D9-4E1D-A941-28A03BC8A095}.Release|Win32.ActiveCfg = Release|Win32
@@ -190,6 +193,18 @@ Global
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Win32.ActiveCfg = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|Win32.Build.0 = Release|Win32
{1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|x64.ActiveCfg = Release|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|Win32.Build.0 = Debug|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.ActiveCfg = Debug|x64
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Debug|x64.Build.0 = Debug|x64
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Mixed Platforms.ActiveCfg = Release|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Mixed Platforms.Build.0 = Release|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.ActiveCfg = Release|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|Win32.Build.0 = Release|Win32
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.ActiveCfg = Release|x64
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Code/DanBiasGame/DanBiasGame.vcxproj b/Code/DanBiasGame/DanBiasGame.vcxproj
new file mode 100644
index 00000000..88181e55
--- /dev/null
+++ b/Code/DanBiasGame/DanBiasGame.vcxproj
@@ -0,0 +1,193 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ {2A1BC987-AF42-4500-802D-89CD32FC1309}
+ Win32Proj
+ DanBiasGame
+
+
+
+ Application
+ true
+ v110
+ Unicode
+
+
+ Application
+ true
+ v110
+ Unicode
+
+
+ Application
+ false
+ v110
+ true
+ Unicode
+
+
+ Application
+ false
+ v110
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ $(SolutionDir)..\Bin\Executable\
+ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
+ $(ProjectName)_$(PlatformShortName)D
+ C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+
+
+ true
+ $(SolutionDir)..\Bin\Executable\
+ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
+ $(ProjectName)_$(PlatformShortName)D
+ C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+
+
+ false
+ $(SolutionDir)..\Bin\Executable\
+ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
+ $(ProjectName)_$(PlatformShortName)
+ C:\Program Files %28x86%29\Visual Leak Detector\lib\Win32;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+
+
+ false
+ $(SolutionDir)..\Bin\Executable\
+ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
+ $(ProjectName)_$(PlatformShortName)
+ C:\Program Files %28x86%29\Visual Leak Detector\lib\Win64;$(LibraryPath)$(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;
+
+
+
+
+
+ Level3
+ Disabled
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+ $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+
+
+ Windows
+ true
+ OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies)
+ OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+
+
+
+
+
+
+ Level3
+ Disabled
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+ $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+
+
+ Windows
+ true
+ OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GameLogic_$(PlatformShortName)D.lib;%(AdditionalDependencies)
+ OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+ $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+
+
+ Windows
+ true
+ true
+ true
+ OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies)
+ OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ true
+ $(SolutionDir)GameLogic;$(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;%(AdditionalIncludeDirectories)
+
+
+ Windows
+ true
+ true
+ true
+ OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GameLogic_$(PlatformShortName).lib;%(AdditionalDependencies)
+ OysterGraphics_$(PlatformShortName)D.dll;GameLogic_$(PlatformShortName)D.dll;%(DelayLoadDLLs)
+
+
+
+
+ {b1195bb9-b3a5-47f0-906c-8dea384d1520}
+
+
+ {7e3990d2-3d94-465c-b58d-64a74b3ecf9b}
+
+
+ {f10cbc03-9809-4cba-95d8-327c287b18ee}
+
+
+ {4285bd3f-3c6c-4670-b7af-a29afef5f6a8}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Code/DanBiasGame/DanBiasMaincpp.cpp b/Code/DanBiasGame/DanBiasMaincpp.cpp
new file mode 100644
index 00000000..23c1a119
--- /dev/null
+++ b/Code/DanBiasGame/DanBiasMaincpp.cpp
@@ -0,0 +1,316 @@
+//--------------------------------------------------------------------------------------
+// File: TemplateMain.cpp
+//
+// BTH-D3D-Template
+//
+// Copyright (c) Stefan Petersson 2011. All rights reserved.
+//--------------------------------------------------------------------------------------
+#define NOMINMAX
+#include
+
+#include "DllInterfaces/GFXAPI.h"
+#include "IGame.h"
+
+#include "L_inputClass.h"
+
+// debug window include
+#include
+#include
+#include
+#include
+
+
+
+
+//--------------------------------------------------------------------------------------
+// Global Variables
+//--------------------------------------------------------------------------------------
+HINSTANCE g_hInst = NULL;
+HWND g_hWnd = NULL;
+
+GameLogic::IGame* game;
+InputClass* inputObj;
+
+
+//--------------------------------------------------------------------------------------
+// Forward declarations
+//--------------------------------------------------------------------------------------
+HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow );
+LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
+HRESULT Render(float deltaTime);
+HRESULT Update(float deltaTime);
+HRESULT InitDirect3D();
+HRESULT InitGame();
+HRESULT CleanUp();
+
+
+
+//--------------------------------------------------------------------------------------
+// Entry point to the program. Initializes everything and goes into a message processing
+// loop. Idle time is used to render the scene.
+//--------------------------------------------------------------------------------------
+
+void SetStdOutToNewConsole()
+{
+ // allocate a console for this app
+ AllocConsole();
+
+ // redirect unbuffered STDOUT to the console
+ HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
+ int fileDescriptor = _open_osfhandle((intptr_t)consoleHandle, _O_TEXT);
+ FILE *fp = _fdopen( fileDescriptor, "w" );
+ *stdout = *fp;
+ setvbuf( stdout, NULL, _IONBF, 0 );
+
+ // give the console window a nicer title
+
+ SetConsoleTitle(L"Debug Output");
+
+ // give the console window a bigger buffer size
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+ if ( GetConsoleScreenBufferInfo(consoleHandle, &csbi) )
+ {
+ COORD bufferSize;
+ bufferSize.X = csbi.dwSize.X;
+ bufferSize.Y = 50;
+ SetConsoleScreenBufferSize(consoleHandle, bufferSize);
+ }
+}
+
+int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow )
+{
+ // for dynamic .dll loading
+ // path is relative to the .exe and .dll pos
+ // also change the VC directories - working dir is set to $(SolutionDir)..\Bin\Executable\Tester
+ // to fit with where the .obj files is
+ // linker/ input/ delayed load .dll - specify the .dll that should be loaded
+
+ BOOL success = SetDllDirectory(L"..\\..\\DLL");
+ if (success == 0)
+ {
+ return 0;
+ }
+
+ if( FAILED( InitWindow( hInstance, nCmdShow ) ) )
+ return 0;
+
+ if( FAILED( InitDirect3D() ) )
+ return 0;
+
+ if( FAILED( InitGame() ) )
+ return 0;
+
+ __int64 cntsPerSec = 0;
+ QueryPerformanceFrequency((LARGE_INTEGER*)&cntsPerSec);
+ float secsPerCnt = 1.0f / (float)cntsPerSec;
+
+ __int64 prevTimeStamp = 0;
+ QueryPerformanceCounter((LARGE_INTEGER*)&prevTimeStamp);
+
+ //debug window
+ //SetStdOutToNewConsole();
+
+ // Main message loop
+ MSG msg = {0};
+ while(WM_QUIT != msg.message)
+ {
+ if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE) )
+ {
+ TranslateMessage( &msg );
+ DispatchMessage( &msg );
+ }
+ else
+ {
+ __int64 currTimeStamp = 0;
+ QueryPerformanceCounter((LARGE_INTEGER*)&currTimeStamp);
+ float dt = (currTimeStamp - prevTimeStamp) * secsPerCnt;
+
+ //render
+ Update(dt);
+ Render(dt);
+
+ prevTimeStamp = currTimeStamp;
+ }
+ }
+ CleanUp();
+ return (int) msg.wParam;
+}
+
+//--------------------------------------------------------------------------------------
+// Register class and create window
+//--------------------------------------------------------------------------------------
+HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow )
+{
+ // Register class
+ WNDCLASSEX wcex;
+ wcex.cbSize = sizeof(WNDCLASSEX);
+ wcex.style = CS_HREDRAW | CS_VREDRAW;
+ wcex.lpfnWndProc = WndProc;
+ wcex.cbClsExtra = 0;
+ wcex.cbWndExtra = 0;
+ wcex.hInstance = hInstance;
+ wcex.hIcon = 0;
+ wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
+ wcex.lpszMenuName = NULL;
+ wcex.lpszClassName = L"BTH_D3D_Template";
+ wcex.hIconSm = 0;
+ if( !RegisterClassEx(&wcex) )
+ return E_FAIL;
+
+ // Adjust and create window
+ g_hInst = hInstance;
+ RECT rc = { 0, 0, 1024, 768 };
+ AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE );
+
+ if(!(g_hWnd = CreateWindow(
+ L"BTH_D3D_Template",
+ L"BTH - Direct3D 11.0 Template",
+ WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ rc.right - rc.left,
+ rc.bottom - rc.top,
+ NULL,
+ NULL,
+ hInstance,
+ NULL)))
+ {
+ return E_FAIL;
+ }
+
+ ShowWindow( g_hWnd, nCmdShow );
+
+ return S_OK;
+}
+
+//--------------------------------------------------------------------------------------
+// Create Direct3D with Oyster Graphics
+//--------------------------------------------------------------------------------------
+HRESULT InitDirect3D()
+{
+ if(Oyster::Graphics::API::Init(g_hWnd, false, false, Oyster::Math::Float2( 1024, 768)) != Oyster::Graphics::API::Sucsess)
+ return E_FAIL;
+ return S_OK;
+}
+
+//--------------------------------------------------------------------------------------
+// Init the input and the game
+//-------------------------------------------------------------------------------------
+HRESULT InitGame()
+{
+ inputObj = new InputClass;
+ if(!inputObj->Initialize(g_hInst, g_hWnd, 1024, 768))
+ {
+ MessageBox(0, L"Could not initialize the input object.", L"Error", MB_OK);
+ return false;
+ }
+ game = new GameLogic::IGame();
+ game->Init();
+ game->StartGame();
+
+ return S_OK;
+}
+
+HRESULT Update(float deltaTime)
+{
+ inputObj->Update();
+ GameLogic::keyInput key = GameLogic::keyInput_none;
+
+ if(inputObj->IsKeyPressed(DIK_W))
+ {
+ key = GameLogic::keyInput_W;
+ }
+ else if(inputObj->IsKeyPressed(DIK_A))
+ {
+ key = GameLogic::keyInput_A;
+ }
+ else if(inputObj->IsKeyPressed(DIK_S))
+ {
+ key = GameLogic::keyInput_S;
+ }
+ else if(inputObj->IsKeyPressed(DIK_D))
+ {
+ key = GameLogic::keyInput_D;
+ }
+
+ float pitch = 0;
+ float yaw = 0;
+
+ //if(inputObj->IsMousePressed())
+ //{
+ pitch = inputObj->GetPitch();
+ yaw = inputObj->GetYaw();
+ //}
+
+ game->Update(key, pitch, yaw);
+
+
+ return S_OK;
+}
+
+HRESULT Render(float deltaTime)
+{
+ int isPressed = 0;
+ if(inputObj->IsKeyPressed(DIK_A))
+ {
+ isPressed = 1;
+ //std::cout<<"test";
+ }
+
+ game->Render();
+ wchar_t title[255];
+ swprintf(title, sizeof(title), L"| Pressing A: %d | \n", (int)(isPressed));
+ SetWindowText(g_hWnd, title);
+
+ Oyster::Graphics::API::EndFrame();
+
+ return S_OK;
+}
+
+HRESULT CleanUp()
+{
+
+ if(game)
+ {
+ delete game;
+ game = NULL;
+ }
+ return S_OK;
+}
+//--------------------------------------------------------------------------------------
+// Called every time the application receives a message
+//--------------------------------------------------------------------------------------
+LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
+{
+ PAINTSTRUCT ps;
+ HDC hdc;
+
+ switch (message)
+ {
+ case WM_PAINT:
+ hdc = BeginPaint(hWnd, &ps);
+ EndPaint(hWnd, &ps);
+ break;
+
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ break;
+
+ case WM_KEYDOWN:
+
+ switch(wParam)
+ {
+ case VK_ESCAPE:
+ PostQuitMessage(0);
+ break;
+ }
+ break;
+
+ default:
+ return DefWindowProc(hWnd, message, wParam, lParam);
+ }
+
+ return 0;
+}
+
diff --git a/Code/GameLogic/Camera.cpp b/Code/GameLogic/Camera.cpp
new file mode 100644
index 00000000..a969ced5
--- /dev/null
+++ b/Code/GameLogic/Camera.cpp
@@ -0,0 +1,185 @@
+#include "Camera.h"
+
+Camera::Camera()
+{
+ this->m_position = Oyster::Math::Float3(0, 50, 0);
+ this->mRight = Oyster::Math::Float3(1, 0, 0);
+ this->mUp = Oyster::Math::Float3(0, 1, 0);
+ this->mLook = Oyster::Math::Float3(0, 0, 1);
+}
+
+Camera::~Camera()
+{
+}
+
+void Camera::SetPosition(const Oyster::Math::Float3& v)
+{
+ this->m_position = v;
+}
+
+Oyster::Math::Float3 Camera::GetPosition()const
+{
+ return this->m_position;
+}
+
+Oyster::Math::Float3 Camera::GetRight()const
+{
+ return this->mRight;
+}
+
+Oyster::Math::Float3 Camera::GetUp()const
+{
+ return this->mUp;
+}
+
+Oyster::Math::Float3 Camera::GetLook()const
+{
+ return this->mLook;
+}
+
+float Camera::GetNearZ()const
+{
+ return this->mNearZ;
+}
+
+float Camera::GetFarZ()const
+{
+ return this->mFarZ;
+}
+
+float Camera::GetAspect()const
+{
+ return this->mAspect;
+}
+
+Oyster::Math::Float3 Camera::CrossMatrix(const Oyster::Math::Float3& vector, const Oyster::Math::Float4x4& matrix)
+{
+ Oyster::Math::Float3 vec;
+ vec.x = matrix.m11*vector.x + matrix.m12*vector.y + matrix.m13*vector.z;
+ vec.y = matrix.m21*vector.x + matrix.m22*vector.y + matrix.m23*vector.z;
+ vec.z = matrix.m31*vector.x + matrix.m32*vector.y + matrix.m33*vector.z;
+ return vec;
+}
+
+void Camera::SetLens(float fovY, float aspect, float zn, float zf)
+{
+ this->mFovY = fovY;
+ this->mAspect = aspect;
+ this->mNearZ = zn;
+ this->mFarZ = zf;
+
+ float yScale = tan((Oyster::Math::pi*0.5f) - (mFovY*0.5f));
+ float xScale = yScale/this->mAspect;
+
+ mProj = Oyster::Math::Float4x4(xScale, 0, 0, 0,
+ 0, yScale, 0, 0,
+ 0, 0, zf/(zf-zn), 1,
+ 0, 0, -zn*zf/(zf-zn), 0);
+ mProj.Transpose();
+}
+
+void Camera::LookAt(Oyster::Math::Float3 pos, Oyster::Math::Float3 target, Oyster::Math::Float3 worldUp)
+{
+ Oyster::Math::Float3 L;
+
+ L = target - pos;
+ L.Normalize();
+
+ Oyster::Math::Float3 R;
+ R = worldUp.Cross(L);
+ R.Normalize();
+
+ Oyster::Math::Float3 U;
+ U = L.Cross(R);
+
+ this->m_position = pos;
+ this->mLook = L;
+ this->mRight = R;
+ this->mUp = U;
+}
+
+Oyster::Math::Float4x4 Camera::View()const
+{
+ return this->mView;
+}
+
+Oyster::Math::Float4x4 Camera::Proj()const
+{
+ return this->mProj;
+}
+
+Oyster::Math::Float4x4 Camera::ViewsProj()const
+{
+ Oyster::Math::Float4x4 M;
+ M = mView * mProj;
+ return M;
+}
+
+void Camera::Walk(float dist)
+{
+ this->m_position += dist*this->mLook;
+}
+
+void Camera::Strafe(float dist)
+{
+ this->m_position += dist*this->mRight;
+}
+
+void Camera::Pitch(float angle)
+{
+ float radians = angle * 0.0174532925f;
+
+ Oyster::Math::Float4x4 R;
+
+ Oyster::Math3D::RotationMatrix(radians,-mRight,R);
+ this->mUp = CrossMatrix(this->mUp, R);
+ this->mLook = CrossMatrix(this->mLook, R);
+}
+
+void Camera::Yaw(float angle)
+{
+ float radians = angle * 0.0174532925f;
+
+ Oyster::Math::Float4x4 R;
+
+ Oyster::Math::Float3 up(0,1,0);
+ Oyster::Math3D::RotationMatrix(radians,-up,R);
+
+ this->mRight = CrossMatrix(this->mRight, R);
+ this->mUp = CrossMatrix(mUp, R);
+ this->mLook = CrossMatrix(this->mLook, R);
+}
+
+void Camera::UpdateViewMatrix()
+{
+ mLook.Normalize();
+ mUp = mLook.Cross(mRight);
+ mUp.Normalize();
+ mRight = mUp.Cross(mLook);
+
+ float x = -m_position.Dot(mRight);
+ float y = -m_position.Dot(mUp);
+ float z = -m_position.Dot(mLook);
+
+ mView.m11 = mRight.x;
+ mView.m21 = mRight.y;
+ mView.m31 = mRight.z;
+ mView.m41 = x;
+
+ mView.m12 = mUp.x;
+ mView.m22 = mUp.y;
+ mView.m32 = mUp.z;
+ mView.m42 = y;
+
+ mView.m13 = mLook.x;
+ mView.m23 = mLook.y;
+ mView.m33 = mLook.z;
+ mView.m43 = z;
+
+ mView.m14 = 0.0f;
+ mView.m24 = 0.0f;
+ mView.m34 = 0.0f;
+ mView.m44 = 1.0f;
+
+ mView.Transpose();
+}
\ No newline at end of file
diff --git a/Code/GameLogic/Camera.h b/Code/GameLogic/Camera.h
new file mode 100644
index 00000000..deb9df62
--- /dev/null
+++ b/Code/GameLogic/Camera.h
@@ -0,0 +1,63 @@
+#ifndef CAMERA__H
+#define CAMERA__H
+
+#include "OysterMath.h"
+
+class Camera
+{
+private:
+
+ Oyster::Math::Float3 m_position;
+ Oyster::Math::Float3 mRight;
+ Oyster::Math::Float3 mUp;
+ Oyster::Math::Float3 mLook;
+
+
+
+ float mNearZ;
+ float mFarZ;
+ float mAspect;
+ float mFovY;
+
+ Oyster::Math::Float4x4 mView;
+ Oyster::Math::Float4x4 mProj;
+
+public:
+ Camera();
+ virtual ~Camera();
+
+ void SetPosition(const Oyster::Math::Float3& v);
+
+ Oyster::Math::Float3 GetPosition()const;
+
+ Oyster::Math::Float3 GetRight()const;
+ Oyster::Math::Float3 GetUp()const;
+ Oyster::Math::Float3 GetLook()const;
+
+ float GetNearZ()const;
+ float GetFarZ()const;
+ float GetAspect()const;
+
+ Oyster::Math::Float3 CrossMatrix(const Oyster::Math::Float3& v, const Oyster::Math::Float4x4& m);
+
+ void SetLens(float fovY, float aspect, float zn, float zf);
+
+ void LookAt(Oyster::Math::Float3 pos, Oyster::Math::Float3 target, Oyster::Math::Float3 worldUp);
+
+ void setLook(Oyster::Math::Float3 look) { mLook = look; }
+ void setUp(Oyster::Math::Float3 up) { mUp = up; }
+ void setRight(Oyster::Math::Float3 right) { mRight = right; }
+
+ Oyster::Math::Float4x4 View()const;
+ Oyster::Math::Float4x4 Proj()const;
+ Oyster::Math::Float4x4 ViewsProj()const;
+
+ void Walk(float dist);
+ void Strafe(float dist);
+
+ void Pitch(float angle);
+ void Yaw(float angle);
+
+ void UpdateViewMatrix();
+};
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/CollisionManager.cpp b/Code/GameLogic/CollisionManager.cpp
new file mode 100644
index 00000000..f7868b79
--- /dev/null
+++ b/Code/GameLogic/CollisionManager.cpp
@@ -0,0 +1,50 @@
+#include "CollisionManager.h"
+
+
+
+namespace GameLogic
+{
+
+ namespace CollisionManager
+ {
+
+ void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj)
+ {
+ Player *player = ((Player*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyPlayer));
+ Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj);
+
+ switch (realObj->GetType())
+ {
+ case Object::OBJECT_TYPE_BOX:
+ PlayerVBox(*player,(*(DynamicObject*) realObj));
+ break;
+ case Object::OBJECT_TYPE_PLAYER:
+
+ break;
+ }
+
+ //spela ljud? ta skada? etc etc
+ }
+
+ void PlayerVBox(Player &player, DynamicObject &box)
+ {
+ //spela ljud? ta skada? etc etc
+ }
+
+ void BoxCollision(Oyster::Physics::ICustomBody &rigidBodyBox, Oyster::Physics::ICustomBody &obj)
+ {
+ DynamicObject *box = ((DynamicObject*)GameLogic::RefManager::getInstance()->GetMap(rigidBodyBox));
+ Object *realObj = GameLogic::RefManager::getInstance()->GetMap(obj);
+
+ switch (realObj->GetType())
+ {
+ case Object::OBJECT_TYPE_BOX:
+
+ break;
+ case Object::OBJECT_TYPE_PLAYER:
+ PlayerVBox(*(Player*)realObj,*box);
+ break;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Code/GameLogic/CollisionManager.h b/Code/GameLogic/CollisionManager.h
new file mode 100644
index 00000000..a650f595
--- /dev/null
+++ b/Code/GameLogic/CollisionManager.h
@@ -0,0 +1,27 @@
+#ifndef COLLISIONMANAGER_H
+#define COLLISIONMANAGER_H
+
+#include "Object.h"
+#include "PhysicsAPI.h"
+#include "RefManager.h"
+#include "DynamicObject.h"
+#include "Player.h"
+
+namespace GameLogic
+{
+
+ namespace CollisionManager
+ {
+ //these are the main collision functions
+ void PlayerCollision(Oyster::Physics::ICustomBody &rigidBodyPlayer,Oyster::Physics::ICustomBody &obj);
+ void BoxCollision(Oyster::Physics::ICustomBody &rigidBodyBox, Oyster::Physics::ICustomBody &obj);
+
+ //these are the specific collision case functions
+ void PlayerVBox(Player &player, DynamicObject &box);
+ void BoxVBox(DynamicObject &box1, DynamicObject &box2);
+
+ };
+
+}
+
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/DynamicObject.cpp b/Code/GameLogic/DynamicObject.cpp
new file mode 100644
index 00000000..14e0518d
--- /dev/null
+++ b/Code/GameLogic/DynamicObject.cpp
@@ -0,0 +1,20 @@
+#include "DynamicObject.h"
+
+using namespace GameLogic;
+using namespace Oyster::Physics;
+using namespace Utility::DynamicMemory;
+
+DynamicObject::DynamicObject(void)
+ :Object()
+{
+}
+
+
+DynamicObject::~DynamicObject(void)
+{
+}
+
+void DynamicObject::Update()
+{
+ //update object
+}
\ No newline at end of file
diff --git a/Code/GameLogic/DynamicObject.h b/Code/GameLogic/DynamicObject.h
new file mode 100644
index 00000000..2d6ffdc8
--- /dev/null
+++ b/Code/GameLogic/DynamicObject.h
@@ -0,0 +1,28 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef DYNAMICOBJECT_H
+#define DYNAMICOBJECT_H
+
+#include "Object.h"
+
+namespace GameLogic
+{
+
+
+ class DynamicObject : public Object
+ {
+
+ public:
+ DynamicObject(void);
+ ~DynamicObject(void);
+
+ void Update();
+
+ };
+
+}
+
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/Game.cpp b/Code/GameLogic/Game.cpp
new file mode 100644
index 00000000..b4095130
--- /dev/null
+++ b/Code/GameLogic/Game.cpp
@@ -0,0 +1,68 @@
+#include "Game.h"
+using namespace GameLogic;
+
+Game::Game(void)
+{
+ player = NULL;
+ level = NULL;
+ camera = NULL;
+}
+
+
+Game::~Game(void)
+{
+ //SAFE_DELETE(player);
+ if(player)
+ {
+ delete player;
+ player = NULL;
+ }
+ if(camera)
+ {
+ delete camera;
+ camera = NULL;
+ }
+}
+
+void Game::Init()
+{
+ player = new Player();
+ camera = new Camera();
+}
+void Game::StartGame()
+{
+ Oyster::Math::Float3 dir = Oyster::Math::Float3(0,0,-1);
+ Oyster::Math::Float3 up =Oyster::Math::Float3(0,1,0);
+ Oyster::Math::Float3 pos = Oyster::Math::Float3(0, 0, 100);
+
+ camera->LookAt(pos, dir, up);
+ camera->SetLens(3.14f/2, 1024/768, 1, 1000);
+}
+void Game::Update(keyInput keyPressed, float pitch, float yaw)
+{
+ //player->Update(keyPressed);
+ camera->Yaw(yaw);
+ camera->Pitch(pitch);
+ if(keyPressed == keyInput_A)
+ {
+ camera->Strafe(-0.1);
+ }
+ if(keyPressed == keyInput_D)
+ {
+ camera->Strafe(0.1);
+ }
+ if(keyPressed == keyInput_S)
+ {
+ camera->Walk(-0.1);
+ }
+ if(keyPressed == keyInput_W)
+ {
+ camera->Walk(0.1);
+ }
+ camera->UpdateViewMatrix();
+}
+void Game::Render()
+{
+ Oyster::Graphics::API::NewFrame(camera->View(), camera->Proj());
+ player->Render();
+}
\ No newline at end of file
diff --git a/Code/GameLogic/Game.h b/Code/GameLogic/Game.h
new file mode 100644
index 00000000..0a8a031a
--- /dev/null
+++ b/Code/GameLogic/Game.h
@@ -0,0 +1,28 @@
+#ifndef GAME_H
+#define GAME_H
+
+#include "Level.h"
+#include "Player.h"
+#include "IGame.h"
+#include "Camera.h"
+
+namespace GameLogic
+{
+ class Game
+ {
+ public:
+ Game();
+ ~Game();
+
+ void Init();
+ void StartGame();
+ void Update(keyInput keyPressed, float pitch, float yaw);
+ void Render();
+
+ private:
+ Level* level;
+ Player* player;
+ Camera* camera;
+ };
+}
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/GameLogic.vcxproj b/Code/GameLogic/GameLogic.vcxproj
index 900f0834..236258d2 100644
--- a/Code/GameLogic/GameLogic.vcxproj
+++ b/Code/GameLogic/GameLogic.vcxproj
@@ -24,30 +24,30 @@
- StaticLibrary
+ DynamicLibrary
true
v110
- MultiByte
+ Unicode
- StaticLibrary
+ DynamicLibrary
true
v110
- MultiByte
+ Unicode
- StaticLibrary
+ DynamicLibrary
false
v110
true
- MultiByte
+ Unicode
- StaticLibrary
+ DynamicLibrary
false
v110
true
- MultiByte
+ Unicode
@@ -66,34 +66,41 @@
- $(SolutionDir)..\External\Lib\$(ProjectName)\
+ $(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
+ $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
+ .dll
- $(SolutionDir)..\External\Lib\$(ProjectName)\
+ $(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)
+ $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
- $(SolutionDir)..\External\Lib\$(ProjectName)\
+ $(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)D
+ $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
- $(SolutionDir)..\External\Lib\$(ProjectName)\
+ $(SolutionDir)..\Bin\DLL\
$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\
$(ProjectName)_$(PlatformShortName)
+ $(SolutionDir)..\External\Lib\Input;$(SolutionDir)..\Bin\DLL;$(LibraryPath)
Level3
Disabled
true
- $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
+ OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies)
@@ -101,10 +108,12 @@
Level3
Disabled
true
- $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
+ OysterGraphics_$(PlatformShortName)D.lib;Input_$(PlatformShortName)D.lib;GamePhysics_$(PlatformShortName)D.lib;%(AdditionalDependencies)
@@ -114,12 +123,14 @@
true
true
true
- $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
true
true
+ OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GamePhysics_$(PlatformShortName).lib;%(AdditionalDependencies)
@@ -129,21 +140,34 @@
true
true
true
- $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ $(SolutionDir)Input;$(SolutionDir)OysterGraphics;$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)
+ GAME_DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)
true
true
true
+ OysterGraphics_$(PlatformShortName).lib;Input_$(PlatformShortName).lib;GamePhysics_$(PlatformShortName).lib;%(AdditionalDependencies)
{104fa3e9-94d9-4e1d-a941-28a03bc8a095}
+ false
+ true
+ false
+ false
+ false
+
+
+ {7e3990d2-3d94-465c-b58d-64a74b3ecf9b}
{2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}
+
+ {0ec83e64-230e-48ef-b08c-6ac9651b4f82}
+
{f10cbc03-9809-4cba-95d8-327c287b18ee}
@@ -151,6 +175,35 @@
{4285bd3f-3c6c-4670-b7af-a29afef5f6a8}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Code/GameLogic/GameLogic.vcxproj.filters b/Code/GameLogic/GameLogic.vcxproj.filters
index d7ef6a1a..f2c5e978 100644
--- a/Code/GameLogic/GameLogic.vcxproj.filters
+++ b/Code/GameLogic/GameLogic.vcxproj.filters
@@ -14,4 +14,83 @@
rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
\ No newline at end of file
diff --git a/Code/GameLogic/GameMode.cpp b/Code/GameLogic/GameMode.cpp
new file mode 100644
index 00000000..0eddb7f9
--- /dev/null
+++ b/Code/GameLogic/GameMode.cpp
@@ -0,0 +1,15 @@
+#include "GameMode.h"
+
+using namespace GameLogic;
+
+
+GameMode::GameMode(void)
+{
+
+}
+
+
+GameMode::~GameMode(void)
+{
+
+}
diff --git a/Code/GameLogic/GameMode.h b/Code/GameLogic/GameMode.h
new file mode 100644
index 00000000..42273946
--- /dev/null
+++ b/Code/GameLogic/GameMode.h
@@ -0,0 +1,22 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef GAMEMODE_H
+#define GAMEMODE_H
+
+namespace GameLogic
+{
+
+ class GameMode
+ {
+ public:
+ GameMode(void);
+ ~GameMode(void);
+ private:
+ //variabels that control what game rules the level runs on
+ };
+
+}
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/IGame.cpp b/Code/GameLogic/IGame.cpp
new file mode 100644
index 00000000..dd07c9f8
--- /dev/null
+++ b/Code/GameLogic/IGame.cpp
@@ -0,0 +1,43 @@
+#include "IGame.h"
+#include "Game.h"
+#include
+
+BOOL WINAPI DllMain(
+ _In_ HINSTANCE hinstDLL,
+ _In_ DWORD fdwReason,
+ _In_ LPVOID lpvReserved
+ )
+{
+ return TRUE;
+}
+using namespace GameLogic;
+
+IGame::IGame()
+{
+ gameModule = new Game();
+}
+IGame::~IGame()
+{
+ delete gameModule;
+}
+
+void IGame::Init()
+{
+ gameModule->Init();
+}
+void IGame::StartGame()
+{
+ gameModule->StartGame();
+}
+void IGame::Update(keyInput keyPressed, float pitch, float yaw)
+{
+ gameModule->Update(keyPressed, pitch, yaw);
+}
+void IGame::Render()
+{
+ gameModule->Render();
+}
+Game* IGame::getGameModule()
+{
+ return gameModule;
+}
\ No newline at end of file
diff --git a/Code/GameLogic/IGame.h b/Code/GameLogic/IGame.h
new file mode 100644
index 00000000..41b2e0d5
--- /dev/null
+++ b/Code/GameLogic/IGame.h
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+#ifndef IGAME_H
+#define IGAME_H
+
+#if defined GAME_DLL_EXPORT
+#define GAME_DLL_USAGE __declspec(dllexport)
+#else
+#define GAME_DLL_USAGE __declspec(dllimport)
+#endif
+
+namespace GameLogic
+{
+ class Game;
+
+ enum keyInput
+ {
+ keyInput_W,
+ keyInput_A,
+ keyInput_S,
+ keyInput_D,
+ keyInput_none
+ };
+
+ class GAME_DLL_USAGE IGame
+ {
+ private:
+ Game* gameModule;
+ public:
+ IGame();
+ ~IGame();
+
+
+ void Init();
+ void StartGame();
+ /************************************************************************/
+ /* Get key input to update the player */
+ /************************************************************************/
+ void Update(keyInput keyPressed, float pitch, float yaw);
+ void Render();
+ Game* getGameModule();
+ private:
+ };
+}
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/Level.cpp b/Code/GameLogic/Level.cpp
new file mode 100644
index 00000000..32fbe2d5
--- /dev/null
+++ b/Code/GameLogic/Level.cpp
@@ -0,0 +1,12 @@
+#include "Level.h"
+
+using namespace GameLogic;
+
+Level::Level(void)
+{
+}
+
+
+Level::~Level(void)
+{
+}
diff --git a/Code/GameLogic/Level.h b/Code/GameLogic/Level.h
new file mode 100644
index 00000000..b43f193d
--- /dev/null
+++ b/Code/GameLogic/Level.h
@@ -0,0 +1,37 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef LEVEL_H
+#define LEVEL_H
+
+#include "StaticObject.h"
+#include "DynamicObject.h"
+#include "GameMode.h"
+
+namespace GameLogic
+{
+
+ class Level
+ {
+
+ public:
+ Level(void);
+ ~Level(void);
+
+ private:
+ StaticObject** staticObjects;
+ int nrOfStaticObjects;
+
+ DynamicObject** dynamicObjects;
+ int nrOfDynamicObjects;
+
+ GameMode* gameMode;
+
+
+
+ };
+
+}
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/Object.cpp b/Code/GameLogic/Object.cpp
new file mode 100644
index 00000000..965af90e
--- /dev/null
+++ b/Code/GameLogic/Object.cpp
@@ -0,0 +1,47 @@
+#include "Object.h"
+#include "OysterMath.h"
+#include "DllInterfaces\GFXAPI.h"
+#include "CollisionManager.h"
+
+
+using namespace GameLogic;
+
+using namespace Oyster::Math;
+using namespace Oyster::Graphics::Model;
+
+using namespace Utility::DynamicMemory;
+using namespace Oyster::Physics;
+
+Object::Object(void)
+{
+
+ model = new Model();
+ model = Oyster::Graphics::API::CreateModel(L"bth.obj");
+
+ API::SimpleBodyDescription sbDesc;
+ //sbDesc.centerPosition =
+
+ ICustomBody* temp = rigidBody = API::Instance().CreateRigidBody(sbDesc).Release();
+
+ GameLogic::RefManager::getInstance()->AddMapping(*rigidBody, *this);
+
+}
+
+
+Object::~Object(void)
+{
+
+ Oyster::Graphics::API::DeleteModel(model);
+
+}
+
+void Object::Render()
+{
+ this->rigidBody->GetOrientation(model->WorldMatrix);
+ Oyster::Graphics::API::RenderScene(model, 1);
+}
+
+Object::OBJECT_TYPE Object::GetType()
+{
+ return this->type;
+}
diff --git a/Code/GameLogic/Object.h b/Code/GameLogic/Object.h
new file mode 100644
index 00000000..767edb1f
--- /dev/null
+++ b/Code/GameLogic/Object.h
@@ -0,0 +1,49 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef OBJECT_H
+#define OBJECT_H
+
+#include "PhysicsAPI.h"
+#include "DllInterfaces/GFXAPI.h"
+
+#include "Model/Model.h"
+#include "Utilities.h"
+
+
+
+namespace GameLogic
+{
+ class Object
+ {
+ public:
+
+ enum OBJECT_TYPE
+ {
+ OBJECT_TYPE_PLAYER,
+ OBJECT_TYPE_BOX,
+ };
+ Object(void);
+ virtual ~Object(void);
+
+ void Render();
+
+ OBJECT_TYPE GetType();
+
+ private:
+ OBJECT_TYPE type;
+
+ protected:
+ //either a model pointer or an ID to an arraypos filled with models that are to be rendered
+ //rigidBody
+
+ Oyster::Physics::ICustomBody *rigidBody;
+ Oyster::Graphics::Model::Model *model;
+
+ };
+
+}
+
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/Player.cpp b/Code/GameLogic/Player.cpp
new file mode 100644
index 00000000..93a83506
--- /dev/null
+++ b/Code/GameLogic/Player.cpp
@@ -0,0 +1,55 @@
+#include "Player.h"
+#include "OysterMath.h"
+
+using namespace GameLogic;
+using namespace Oyster::Physics;
+
+Player::Player(void)
+ :Object()
+{
+ life = 100;
+}
+Player::~Player(void)
+{
+ delete this->rigidBody;
+}
+
+void Player::Update(keyInput keyPressed)
+{
+ if(keyPressed != keyInput_none)
+ {
+ Move(keyPressed);
+ }
+}
+
+void Player::Move(keyInput keyPressed)
+{
+ if(keyPressed == keyInput_A)
+ {
+ Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
+ pos.x -= 0.1;
+ rigidBody->SetCenter(pos);
+ }
+ if(keyPressed == keyInput_D)
+ {
+ Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
+ pos.x += 0.1;
+ rigidBody->SetCenter(pos);
+ }
+ if(keyPressed == keyInput_S)
+ {
+ Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
+ pos.y -= 0.1;
+ rigidBody->SetCenter(pos);
+ }
+ if(keyPressed == keyInput_W)
+ {
+ Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
+ pos.y += 0.1;
+ rigidBody->SetCenter(pos);
+ }
+}
+void Player::Shoot()
+{
+
+}
diff --git a/Code/GameLogic/Player.h b/Code/GameLogic/Player.h
new file mode 100644
index 00000000..7c4045e3
--- /dev/null
+++ b/Code/GameLogic/Player.h
@@ -0,0 +1,37 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef PLAYER_H
+#define PLAYER_H
+
+#include "Object.h"
+#include "Weapon.h"
+#include "IGame.h"
+
+
+namespace GameLogic
+{
+ class Player : public Object
+ {
+
+ public:
+ Player(void);
+ ~Player(void);
+
+ /********************************************************
+ * Update the position of the rigid body
+ * This will be done with physics later
+ ********************************************************/
+ void Update(keyInput keyPressed);
+
+ void Move(keyInput keyPressed);
+ void Shoot();
+
+ private:
+ int life;
+ Weapon *weapon;
+ };
+}
+#endif
\ No newline at end of file
diff --git a/Code/GameLogic/RefManager.cpp b/Code/GameLogic/RefManager.cpp
new file mode 100644
index 00000000..a119898c
--- /dev/null
+++ b/Code/GameLogic/RefManager.cpp
@@ -0,0 +1,47 @@
+#include "RefManager.h"
+
+using namespace GameLogic;
+
+typedef std::pair mapData;
+
+RefManager* RefManager::instance = 0;
+
+RefManager::RefManager(void)
+{
+}
+
+
+RefManager::~RefManager(void)
+{
+}
+
+void RefManager::Release()
+{
+ if (instance)
+ {
+ delete instance;
+ instance = NULL;
+ }
+
+}
+
+RefManager* RefManager::getInstance( )
+{
+ if (!instance)
+ {
+ instance = new RefManager();
+ };
+ return instance;
+}
+
+Object* RefManager::GetMap(Oyster::Physics::ICustomBody &body)
+{
+ return mapper[&body];
+}
+
+void RefManager::AddMapping(Oyster::Physics::ICustomBody &body, Object &obj)
+{
+ mapper.insert(mapData(&body,&obj));
+}
+
+
diff --git a/Code/GameLogic/RefManager.h b/Code/GameLogic/RefManager.h
new file mode 100644
index 00000000..b5fd91d2
--- /dev/null
+++ b/Code/GameLogic/RefManager.h
@@ -0,0 +1,37 @@
+//////////////////////////////////////////////////
+//Created by Erik and Linda of the GameLogic team
+//////////////////////////////////////////////////
+
+
+#ifndef REFMANAGER_H
+#define REFMANAGER_H
+
+#include