Game Development Community

Calling 'Parent' functions

by Daniel Buckmaster · in Torque Game Engine · 08/16/2007 (10:46 am) · 0 replies

When creating a new class inherited from RigidShape, I write the following for its onAdd method:
bool Pickup::onAdd()
{
   if (!Parent::onAdd())
      return false;

   return true;
}
On building, I get this error:
Quote:error C2352: 'RigidShape::onAdd' : illegal call of non-static member function
And it tells me to see the declaration of RigidShape::onAdd.
I've defined typedef RigidShape Parent in pickup.h, I've done everything the same way as RigidShap does to make its parent calls to ShapeBase. Is there something I'm missing?

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!