Im really sorry! I get it now. I was thinking of pass pApplet to each object Not the parent as a this!!
Now I see how they are link!
thank you all so much!//=======================================================
Quote:I think you're misunderstanding, they can't directly interact. An object can only "talk to" its parent and its children.
a parent, would be an extends!
But a finger is not a type of hand.
Quote:
hand can talk to finger with it's list of children, and player as it's parent.
how can finger generates an event that calls the parent (Hand) it would have to going world/player/hand witch all must have public methods witch also means other things in the world can call them!
Quote:I think the easiest way to do it is to pass "this" to any leaf as a parameter, so that it knows who its parent is, in the same way taht a branch will have a lsit of leaves.
If I use "this" I can move from the root in any directshon to any object.
>>>>
I suppose I’m thinking that a scene graph is a data system that could do something like Ragdoll physics.
will my CG lecturer was saying that a scenegraph links all the object dynamically.
If you were (not really) to throw the system box out the window it would that a few seconds but then the screen & keyboard would follow it out the window, because they are linked to the to the system box with the scenegraph!
Code:
/*this is more a sudo code*/
class hand
{
finger pinker
hand()
{
pinker = new finger();
}
move()
{
}
}
class finger
{
finger()
{
//...search for fire()
}
fire()//thread
{
if(found)
hand.move();//away!!
}
/* how can finger call hand with out going round the world to get back to the hand*/
}
big thanks agen ^_^