I have an abstract class called camera which PointCamera uses as its super class. For some reason one of the virtual functions throw an error in the debugger and tells me that it is trying to execute 0x00000000. This only happens if the function in question is the last one declared in the abstract class. If I switch the declaration order, then the new last function won't work for the same reason. Why is this happening?
class Camera
{
public:
//Default constructor
Camera();
//Assignment operator
virtual Camera* clone() = 0;
//Get a ray
virtual void KeyCamera() = 0;
virtual void GetRay(float x, float y, Ray* out) = 0;
};
and
class PointCamera: Camera
{
private:
//Camera location, target, and direction
Vector loc, dir, tar, up;
//Orthonormal vectors
Vector u, v, w;
//Virtual plane size
float plane_width, plane_height;
int width, height;
//Distance from the camera point to the virtual plane
float lens_distance;
//Pixel size
float pixelSizex, pixelSizey;
public:
//Default constructor
PointCamera();
//Constructors
PointCamera(Vector& iloc, Vector& itar);
PointCamera(Vector& iloc, Vector& itar, Vector& idir);
//Destructor
~PointCamera();
//Modifiers
void SetDirection(Vector& idir);
void SetUp(Vector& iup);
void SetTarget(Vector& itar);
void SetLocation(Vector& iloc);
void SetPlane(int iheight, int iwidth, float iplane_width = -1.0f, float iplane_height = -1.0f);
void SetLensDistance(float ilens_distance);
//Implememented method
virtual void GetRay(float x, float y, Ray* out);
virtual void SetupRay(Ray* out);
//Compute orthonormal vectors
virtual void KeyCamera();
};