GL starting commenting
This commit is contained in:
parent
5ab1c39e3a
commit
017efd55e5
|
@ -176,8 +176,10 @@
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClInclude Include="CollisionManager.h" />
|
||||||
<ClInclude Include="DynamicObject.h" />
|
<ClInclude Include="DynamicObject.h" />
|
||||||
<ClInclude Include="Game.h" />
|
<ClInclude Include="Game.h" />
|
||||||
|
<ClInclude Include="GameMode.h" />
|
||||||
<ClInclude Include="IGame.h" />
|
<ClInclude Include="IGame.h" />
|
||||||
<ClInclude Include="Level.h" />
|
<ClInclude Include="Level.h" />
|
||||||
<ClInclude Include="Object.h" />
|
<ClInclude Include="Object.h" />
|
||||||
|
@ -187,8 +189,10 @@
|
||||||
<ClInclude Include="Weapon.h" />
|
<ClInclude Include="Weapon.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClCompile Include="CollisionManager.cpp" />
|
||||||
<ClCompile Include="DynamicObject.cpp" />
|
<ClCompile Include="DynamicObject.cpp" />
|
||||||
<ClCompile Include="Game.cpp" />
|
<ClCompile Include="Game.cpp" />
|
||||||
|
<ClCompile Include="GameMode.cpp" />
|
||||||
<ClCompile Include="IGame.cpp" />
|
<ClCompile Include="IGame.cpp" />
|
||||||
<ClCompile Include="Level.cpp" />
|
<ClCompile Include="Level.cpp" />
|
||||||
<ClCompile Include="Object.cpp" />
|
<ClCompile Include="Object.cpp" />
|
||||||
|
|
|
@ -42,6 +42,12 @@
|
||||||
<ClInclude Include="RefManager.h">
|
<ClInclude Include="RefManager.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="GameMode.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="CollisionManager.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="Game.cpp">
|
<ClCompile Include="Game.cpp">
|
||||||
|
@ -74,5 +80,11 @@
|
||||||
<ClCompile Include="TestGLMain.cpp">
|
<ClCompile Include="TestGLMain.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="GameMode.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="CollisionManager.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -8,16 +8,14 @@ BOOL WINAPI DllMain(
|
||||||
_In_ LPVOID lpvReserved
|
_In_ LPVOID lpvReserved
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
using namespace GameLogic;
|
using namespace GameLogic;
|
||||||
|
|
||||||
IGame::IGame()
|
IGame::IGame()
|
||||||
{
|
{
|
||||||
gameModule = new Game();
|
gameModule = new Game();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IGame::~IGame()
|
IGame::~IGame()
|
||||||
{
|
{
|
||||||
delete gameModule;
|
delete gameModule;
|
||||||
|
|
|
@ -43,7 +43,6 @@ void Object::Render()
|
||||||
{
|
{
|
||||||
this->rigidBody->GetOrientation(model->WorldMatrix);
|
this->rigidBody->GetOrientation(model->WorldMatrix);
|
||||||
Oyster::Graphics::API::RenderScene(model, 1);
|
Oyster::Graphics::API::RenderScene(model, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Object::OBJECT_TYPE Object::GetType()
|
Object::OBJECT_TYPE Object::GetType()
|
||||||
|
|
|
@ -1,54 +1,53 @@
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "OysterMath.h"
|
#include "OysterMath.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace GameLogic;
|
using namespace GameLogic;
|
||||||
using namespace Oyster::Physics;
|
using namespace Oyster::Physics;
|
||||||
using namespace Utility::DynamicMemory;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Player::Player(void)
|
Player::Player(void)
|
||||||
:Object()
|
:Object()
|
||||||
{
|
{
|
||||||
life = 100;
|
life = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Player::~Player(void)
|
Player::~Player(void)
|
||||||
{
|
{
|
||||||
delete this->rigidBody;
|
delete this->rigidBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Update(keyInput keyPressed)
|
void Player::Update(keyInput keyPressed)
|
||||||
{
|
{
|
||||||
if(keyPressed != keyInput_none)
|
if(keyPressed != keyInput_none)
|
||||||
{
|
{
|
||||||
Move();
|
Move(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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Move()
|
void Player::Move(keyInput keyPressed)
|
||||||
{
|
{
|
||||||
//API::Instance().Update();
|
if(keyPressed == keyInput_A)
|
||||||
/*Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
|
{
|
||||||
pos.x += 0.1;
|
Oyster::Math::Float3 pos = this->rigidBody->GetCenter();
|
||||||
rigidBody->SetCenter(pos);*/
|
pos.x -= 0.1;
|
||||||
//API::Instance().SetCenter(rigidBody, pos);
|
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()
|
void Player::Shoot()
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
|
|
||||||
namespace GameLogic
|
namespace GameLogic
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
class Player : public Object
|
class Player : public Object
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -22,18 +20,18 @@ namespace GameLogic
|
||||||
Player(void);
|
Player(void);
|
||||||
~Player(void);
|
~Player(void);
|
||||||
|
|
||||||
|
/********************************************************
|
||||||
|
* Update the position of the rigid body
|
||||||
|
* This will be done with physics later
|
||||||
|
********************************************************/
|
||||||
void Update(keyInput keyPressed);
|
void Update(keyInput keyPressed);
|
||||||
|
|
||||||
void Move();
|
void Move(keyInput keyPressed);
|
||||||
void Shoot();
|
void Shoot();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int life;
|
int life;
|
||||||
Weapon *weapon;
|
Weapon *weapon;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
|
@ -272,8 +272,8 @@ HRESULT Render(float deltaTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
// test view and projection matrix
|
// test view and projection matrix
|
||||||
Oyster::Math::Float3 dir = Oyster::Math::Float3(0,0,-1);
|
Oyster::Math::Float3 dir = Oyster::Math::Float3(0, 0, -1);
|
||||||
Oyster::Math::Float3 up =Oyster::Math::Float3(0,1,0);
|
Oyster::Math::Float3 up = Oyster::Math::Float3(0, 1, 0);
|
||||||
Oyster::Math::Float3 pos = Oyster::Math::Float3(0, 0, 100);
|
Oyster::Math::Float3 pos = Oyster::Math::Float3(0, 0, 100);
|
||||||
|
|
||||||
Oyster::Math::Float4x4 view =Oyster::Math3D::OrientationMatrix_LookAtDirection(dir, up, pos);
|
Oyster::Math::Float4x4 view =Oyster::Math3D::OrientationMatrix_LookAtDirection(dir, up, pos);
|
||||||
|
|
Loading…
Reference in New Issue