I'm working with dev and suddenly something stopped working, I have a file
"Selection.h" that looke like this:
#ifndef SELECTION_H
#define SELECTION_H
#include <vector>
#include <algorithm>
#include "3DMath.h"
#include "Terrain.h"
#include "BSP.h"
using namespace std;
//NOT IMPORTANT PART
struct SPlane{
CVector3 v_Corners[4];
int ID;
//SPlane();
//SPlane(vector<CVector3> c){v_Corners = c;}
//SPlane(vector<CVector3> c, int i){v_Corners = c; ID = i;}
};
struct SBox{
SPlane v_Sides[6];
int ID;
//SBox(vector<SPlane> s, int i){v_Sides = s; ID = i;}
SBox(float x, float y, float z, float w, float d, float h, int i);
void InitBox(float x, float y, float z, float w, float d, float h, int i);
//for debugging only
void DrawBox();
};
//IMPORTANT PART
struct SPickedArea2{
float centerX, centerZ;
float width, depth;
float distance;
CVector3 vLine[2];
BYTE* p_HeightMap;
SPickedArea2(float x, float z, float w, float d, CVector3 line[], BYTE *pH);
void GetDistanceForArea();
bool hit;
friend bool operator<(const SPickedArea2& lhs, const SPickedArea2& rhs)
{
return ( lhs.distance < rhs.distance );
}
};
bool SelectBoxWithRay(SBox& Boxes, CVector3 line[]);
void RenderTriangle(CVector3 v_Triangle[]);
#endif
and a file BSP.h that looks like this:
#ifndef BSP_H
#define BSP_H
#include <gl\gl.h>
#include <vector>
#include "Terrain.h"
#include "CCamera.h"
#include "NeHe.h"
#include "Selection.h"
using namespace std;
//NOT IP
struct BSP{
float height, width, depth;
float centerX, centerY, centerZ;
MinMax limits;
BSP *p_sec1, *p_sec2, *p_sec3, *p_sec4;
bool found_limits;
bool is_leaf;
bool picked;
};
class CBspTree{
public:
CBspTree();
~CBspTree();
int number_of_parts;
void GetHeightMap(BYTE *pH){p_HeightMap = pH;}
void GetBoxes(){map->limits = FindLimits(map);}
void RenderMap();
VERTEX PickedCenter;
void Picking(CVector3 line[]);
private:
BSP* map;
BYTE* p_HeightMap;
bool color;
void InitTree(BSP* node, float x, float y, float h, float w);
void EraseBSP(BSP* node);
void Render(BSP* node);
void PickCenter(BSP* node);
CVector3 v_Line[2];
MinMax FindLimits(BSP* node);
MinMax FindLimitsOfArea(float blX, float blY, float trX, float trY);
//IP
vector<SPickedArea2> Areas;
};
#endif
When I tried to compile I got the error:
43 C:\Dev-Cpp\Examples\height2\BSP.h `SPickedArea2' was not declared in this scope
But I included it? I tried to rebuild and kept on getting this?
Thanks.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky