class HQNode: public ISceneNode
{
public:
position getBrettPosition(void){return pos;}
void setBrettPosition(int newx, int newy){pos.x = newx; pos.y = newy;}
private:
position pos;
};
HQNode* test;
if i want to call test->setBrettPosition(1, 1); it causes an error.
can't i make additions this way to classes of irrlicht?
class HQNode: public ISceneNode
{
public:
HQNode() {};
position getBrettPosition(void){return pos;}
void setBrettPosition(int newx, int newy){pos.x = newx; pos.y = newy;}
private:
position pos;
};
HQNode* test;
-----------------------
in main():
-----------------------
test = new HQNode();
test->setBrettPosition(1, 2);
compiler gives me 2 errors:
- no suitable standard constructor available...
- Instance of abstract class cannot be built because of
following memers:
"void irr::scene::ISceneNode::render(void)": is abstract
...
If you're implementing an interface (or abstract class as it is called in C++) you have to implement all pure virtual methods. These are methods which are not already implemented in the base class (read the interface class and search all methods with =0 in their declaration). You have tim implement them in your own class or otherwise it is still just an interface which cannot be instantiated. That is a good thing becauise otherwise Irrlicht would try to call render() on your node and wouldn't find a suitable method.
The constructor problem is similar. The interface defines a constructor which has to be used and therefore has to be implemented in your code. Read the API for the parameters to add.
yeah, I had the same experience when making my camera. Basicly you have to copy most members from the "sister classes" - I simply copied the members from the Maya cam and modified the parts needed.