[Plib-users] extending leaves etc
Brought to you by:
sjbaker
From: Simon <sim...@ho...> - 2004-05-04 10:31:17
|
Hi, ok I think I'm beginning to get my head around ssg. I've read = through all the documentation several times now. What I want to do is add a few functions and some variables to an object. I've seen a few ways that = might make this possible and I was hoping someone could point me in the right direction. =20 Write a new class that extends an entity Write a new class that extends a leaf node Write a new class that extends a branch node (don't think it's this one) Using function call backs on standard versions of the above that call my = new functions Store my variables in the standard versions using the user data section =20 The docs say: "It is presumed that applications will add new kinds of leaves, = branches, states and textures to customise SSG to their needs." =20 You see this is where I get confused. Leaves sound like the best choice = to add the extra functionality to each node, so I thought I should make a = new class based on ssgLeaf. But then I read up on adding user data. I understand I can pump lots of my own variables into this and that along = with pre/post draw call backs I can also call my own functions on an entity = that uses these variables. The problem I see with extending leaves is that = in my demo program I don't actually specify "create a leaf of this type". I = just create an ssgRoot and add some ssgEntities to it. I'm using ssgLoad3ds = to generate the model data for each entity so I'm not sure if this creates = the leaves internally. =20 Thank you now and I'll say thank you later -Simon =20 =20 =20 |