Calling A Parents Virtual Function

Started by
11 comments, last by matthughson 19 years, 8 months ago
Quote:Original post by matthughson
Yeah, I hear you. The engine follows what rules I do know regarding OOP, but this level editor is kind of being slammed into the picture so sacrafices must be made.

Matt Hughson


If I understand the problem, couldn't you just pass the address of the parent on down to each derived class. So the parent would create a derived class like: new MainCharClass(this);
Then to call the parent just do from the char class,
parent->update();

I'm not sure I even understood what you were asking though, so this might not be what you are looking for.
Nicholas Skapura[email=skapura.2@wright.edu]skapura.2@wright.edu[/email]http://skap.8k.com
Advertisement
I just force the 'pause' state in my level editor. This causes the delta or dt passed to all the update functions to be 0, doing mostly nothing, even though functions that do physics are called. This function isn't called nearly as often as it is in game, since it would amke the editor very unresponsive. It only calls that function when things are moved, to update the transformation matrices.
Quote:Original post by JohnGalt

If I understand the problem, couldn't you just pass the address of the parent on down to each derived class. So the parent would create a derived class like: new MainCharClass(this);
Then to call the parent just do from the char class,
parent->update();

I'm not sure I even understood what you were asking though, so this might not be what you are looking for.


Hmmm... I think you got it. Cash and prizes are en route!

Edit: Cash and prizes may not exist
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]

This topic is closed to new replies.

Advertisement