Inheritance of the OSMScene-class of the Scene Loader

ocrim74

21-01-2007 18:43:03

Hi,

I tried to inherit from the OSMScene-class to create additional functionality for NxOgre-import.

Now I have a working class that is inherited from the OSMScene-class, but this only works if I change the private-section of the OSMScene-class to a protected section. This is because I want to inherit the existing methods so that I have the functionality of the OSMScene-class plus my functionality for NxOgre.

Now the question is, why are the methods declared as private and not protected? I think if I change the original OSMScene-class, it is not a clean way and not correct, seen from the point of view of a clean software architecture.

Can you tell me if I missunderstand something? May be I do not understand the idea of this concept. ;-)

Thanks in advance,

ocrim74

Lioric

23-01-2007 16:43:16

Because the proper method to extend the loader is via the event/post-process system, where in your application you create an event object that will be notified about the loading process and will receive the created objects for you to extend or use as your application needs

In the demo loader application, you can see how this is used

For example if you want to create physics data for your objects, override the "onEntityCreate" method of your event object, and create the physics data for each loaded object as needed