Code:
class Primitive
{
public:
Primitive(std::string n = "DefaultName");
//~Primitive();
void setName(std::string n);
virtual std::string getName();
void setMaterial(Material m);
virtual Material* getMaterial();
virtual Vector3D getPos() = 0;
virtual result intersectionTest(Ray r) = 0;
private:
//type
std::string name;
Material material;
};
// The subclass for a sphere
class Sphere : public Primitive
{
public:
Sphere(Vector3D pos, float r);
float getRadius();
float getRadiusSqr();
void setPos(Vector3D pos);
Vector3D getPos();
result intersectionTest(Ray r);
private:
float radius;
Vector3D position;
};
class Triangle : public Primitive
{
public:
Triangle(Vector3D _v1, Vector3D _v2, Vector3D _v3);
result intersectionTest(Ray r);
Vector3D getPos();
private:
// The three vertexes
Vector3D v1;
Vector3D v2;
Vector3D v3;
};
// mesh class
class Mesh : public Primitive
{
public:
Mesh(std::string fName);
result intersectionTest(Ray r);
Vector3D getPos();
// loadFromFile();
// bounding box
// getNormalX(int triangle)
private:
// triangleList class Triangle?
// No of triangles
};
thats what I have in the file and as you see its here Triangle is declared. What do you mean about the namespace thing?
Thanks