Why isn't my virtual function working?
<p>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?</p>

<pre><code>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;
};
</code></pre>

<p>and</p>

<pre><code>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&amp; iloc, Vector&amp; itar);
    PointCamera(Vector&amp; iloc, Vector&amp; itar, Vector&amp; idir);

    //Destructor
    ~PointCamera();

    //Modifiers
    void SetDirection(Vector&amp; idir);
    void SetUp(Vector&amp; iup);
    void SetTarget(Vector&amp; itar);
    void SetLocation(Vector&amp; 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();
};
</code></pre>
