[Fix] Allanis' AABB errors.
This commit is contained in:
parent
3b9b640984
commit
0cad1e8128
@ -84,11 +84,13 @@
|
|||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\src\Actor\Player.h" />
|
<ClInclude Include="..\..\src\Actor\Player.h" />
|
||||||
|
<ClInclude Include="..\..\src\Collision\AABB.h" />
|
||||||
<ClInclude Include="..\..\src\Global\Constants.h" />
|
<ClInclude Include="..\..\src\Global\Constants.h" />
|
||||||
<ClInclude Include="..\..\src\Global\Globals.h" />
|
<ClInclude Include="..\..\src\Global\Globals.h" />
|
||||||
<ClInclude Include="..\..\src\glx\glext.h" />
|
<ClInclude Include="..\..\src\glx\glext.h" />
|
||||||
<ClInclude Include="..\..\src\glx\wglext.h" />
|
<ClInclude Include="..\..\src\glx\wglext.h" />
|
||||||
<ClInclude Include="..\..\src\IO\Input.h" />
|
<ClInclude Include="..\..\src\IO\Input.h" />
|
||||||
|
<ClInclude Include="..\..\src\Level\Level.h" />
|
||||||
<ClInclude Include="..\..\src\Main\Game.h" />
|
<ClInclude Include="..\..\src\Main\Game.h" />
|
||||||
<ClInclude Include="..\..\src\Main\GLWindow.h" />
|
<ClInclude Include="..\..\src\Main\GLWindow.h" />
|
||||||
<ClInclude Include="..\..\src\Math\FPS.h" />
|
<ClInclude Include="..\..\src\Math\FPS.h" />
|
||||||
@ -118,8 +120,10 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\src\Actor\Player.cpp" />
|
<ClCompile Include="..\..\src\Actor\Player.cpp" />
|
||||||
|
<ClCompile Include="..\..\src\Collision\AABB.cpp" />
|
||||||
<ClCompile Include="..\..\src\Global\Globals.cpp" />
|
<ClCompile Include="..\..\src\Global\Globals.cpp" />
|
||||||
<ClCompile Include="..\..\src\IO\Input.cpp" />
|
<ClCompile Include="..\..\src\IO\Input.cpp" />
|
||||||
|
<ClCompile Include="..\..\src\Level\Level.cpp" />
|
||||||
<ClCompile Include="..\..\src\Main\Game.cpp" />
|
<ClCompile Include="..\..\src\Main\Game.cpp" />
|
||||||
<ClCompile Include="..\..\src\Main\GLWindow.cpp" />
|
<ClCompile Include="..\..\src\Main\GLWindow.cpp" />
|
||||||
<ClCompile Include="..\..\src\Main\main.cpp" />
|
<ClCompile Include="..\..\src\Main\main.cpp" />
|
||||||
|
@ -31,6 +31,12 @@
|
|||||||
<Filter Include="TMXParser">
|
<Filter Include="TMXParser">
|
||||||
<UniqueIdentifier>{5bd696ec-579f-4271-9d4b-0f1fdd8b651c}</UniqueIdentifier>
|
<UniqueIdentifier>{5bd696ec-579f-4271-9d4b-0f1fdd8b651c}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Level">
|
||||||
|
<UniqueIdentifier>{9cc417fe-d5fd-47c3-8442-d545c358b7c2}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Collision">
|
||||||
|
<UniqueIdentifier>{27a35a1b-7725-467a-aeb8-d169c437676e}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\src\Main\GLWindow.h">
|
<ClInclude Include="..\..\src\Main\GLWindow.h">
|
||||||
@ -129,6 +135,12 @@
|
|||||||
<ClInclude Include="..\..\src\System\ResourceManager.h">
|
<ClInclude Include="..\..\src\System\ResourceManager.h">
|
||||||
<Filter>System</Filter>
|
<Filter>System</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\src\Level\Level.h">
|
||||||
|
<Filter>Level</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\src\Collision\AABB.h">
|
||||||
|
<Filter>Collision</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\src\Main\main.cpp">
|
<ClCompile Include="..\..\src\Main\main.cpp">
|
||||||
@ -203,5 +215,11 @@
|
|||||||
<ClCompile Include="..\..\src\TMXParser\TmxObject.cpp">
|
<ClCompile Include="..\..\src\TMXParser\TmxObject.cpp">
|
||||||
<Filter>TMXParser</Filter>
|
<Filter>TMXParser</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\Level\Level.cpp">
|
||||||
|
<Filter>Level</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\Collision\AABB.cpp">
|
||||||
|
<Filter>Collision</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -8,7 +8,7 @@ AABB::AABB(void) {
|
|||||||
// _max represents the top left.
|
// _max represents the top left.
|
||||||
_max = Vec2(0,0);
|
_max = Vec2(0,0);
|
||||||
// _min is the bottom left.
|
// _min is the bottom left.
|
||||||
_min = Vec2D(0,0);
|
_min = Vec2(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
AABB::AABB(Vec2 &min, Vec2 &max) {
|
AABB::AABB(Vec2 &min, Vec2 &max) {
|
||||||
@ -51,11 +51,10 @@ bool AABB::InCollision(AABB* otherAABB) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AABB::CreateAABBFromSprite(const char* filename) {
|
void AABB::CreateAABBFromSprite(const char* filename) {
|
||||||
string tempName;
|
std::string tempName(filename);
|
||||||
tempName = filename;
|
tempName += ".png";
|
||||||
tempName.conatenate(".png");
|
|
||||||
_sprite = new Sprite();
|
_sprite = new Sprite();
|
||||||
_sprite->LoadSprite(" ", tempName);
|
_sprite->LoadSprite(tempName);
|
||||||
|
|
||||||
// I have no methods here, hopefully KonoM will have it
|
// I have no methods here, hopefully KonoM will have it
|
||||||
// implemented real soon...
|
// implemented real soon...
|
||||||
@ -66,7 +65,7 @@ void AABB::CreateAABBFromSprite(const char* filename) {
|
|||||||
bool found = false;
|
bool found = false;
|
||||||
int color = 0;
|
int color = 0;
|
||||||
for(int width = 0; width < _sprite->GetWidth(); width++) {
|
for(int width = 0; width < _sprite->GetWidth(); width++) {
|
||||||
for(int height = 0; height < _sprite->GetHeight; height++) {
|
for(int height = 0; height < _sprite->GetHeight(); height++) {
|
||||||
DWORD offset;
|
DWORD offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ public:
|
|||||||
void SetMin(Vec2 &min) { SetMin(min.x, min.y); }
|
void SetMin(Vec2 &min) { SetMin(min.x, min.y); }
|
||||||
void SetMin(float minX, float minY) { _min.x = minX; _min.y = minY; _staticMin = _min; }
|
void SetMin(float minX, float minY) { _min.x = minX; _min.y = minY; _staticMin = _min; }
|
||||||
|
|
||||||
void SetRelitivePosition(float x, float y);
|
void SetRelativePosition(float x, float y);
|
||||||
void SetPositionOffset(float x, float y);
|
void SetPositionOffset(float x, float y);
|
||||||
bool InCollision(AABB* otherAABB);
|
bool InCollision(AABB* otherAABB);
|
||||||
void CreateAABBFromSprite(const char* filename);
|
void CreateAABBFromSprite(const char* filename);
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "../System/Debug.h"
|
#include "../System/Debug.h"
|
||||||
#include "../Sprite/Sprite.h"
|
#include "../Sprite/Sprite.h"
|
||||||
#include "../Texture/Texture.h"
|
#include "../Texture/Texture.h"
|
||||||
|
#include "../Level/Level.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
|
|
||||||
Game::Game(void) {
|
Game::Game(void) {
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "../Actor/Player.h"
|
#include "../Actor/Player.h"
|
||||||
|
|
||||||
class Sprite;
|
class Sprite;
|
||||||
|
class Level;
|
||||||
|
|
||||||
class Game {
|
class Game {
|
||||||
public:
|
public:
|
||||||
@ -20,4 +21,5 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Player* _player;
|
Player* _player;
|
||||||
|
Level* _level;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user