Combining class hierarchies
by Don Harvey · in Torque Game Engine · 01/29/2006 (9:27 am) · 1 replies
I have a question about TGE requirements as it relates to class hierarchies. I have a series of classes that's heavily dependent upon a non-Torque base class. Several of the classes in this hierarchy needs to be derived from my base as well as a TGE class. Here's what I've done with one of these classes:
Torque Item
MyBase /
\ /
\ /
MyItem
My question is - should I derive MyBase from ConsoleObject or SimObject OR is it ok to use an independant base class. I get GPF's after I made this change and I suspect that TGE can't properly instanciate a MyItem unless I register it with the engine. I should also mention MyBase is an abstract class.
If I am required to derive MyBase from a TGE class, do I need to derive all the classes upstream of MyItem virtually (in other words, do I have to have "class MyBase : virtual public SimObject" and change class Item to derive virtually, etc.?)
Torque Item
MyBase /
\ /
\ /
MyItem
My question is - should I derive MyBase from ConsoleObject or SimObject OR is it ok to use an independant base class. I get GPF's after I made this change and I suspect that TGE can't properly instanciate a MyItem unless I register it with the engine. I should also mention MyBase is an abstract class.
If I am required to derive MyBase from a TGE class, do I need to derive all the classes upstream of MyItem virtually (in other words, do I have to have "class MyBase : virtual public SimObject" and change class Item to derive virtually, etc.?)
Torque 3D Owner Stephen Zepp