Modelsunderray is driven ' me craz-ay 2004-03-26 - By Thomas Williams
Back Lucas
> > as for removeFromWorld(), realize that this only works for > models that are > > parented to the group("world"). models that are parented to > anything else > > must be first parented to the world before they can be removed. > > This is incorrect. Any model can be removeFromWorld(), removeFromWorld() > is shortwriting for model.parent=void
I am glad to hear this. The reason i thought that only models parented to the world would get removed is because that's what is says in the help file. help file under removeFromWorld states:
"RemoveFromWorld 3D command; for models, lights, cameras or groups whose parent hierarchy terminates in the world object, this command sets their parent to void and removes them from the world. *For objects whose parent hierarchy does not terminate in the world, this command does nothing.* "
> > and then reparented to their original parents after they are > > addToWorld(). > This will also not work. addToWorld() is shortwriting for model.parent = > m3d.group("world") If you first parent your model to its correct > parent, you're already where you want to be. If you thereafter call > addToWorld(), you make your model child of the world again, nullifying > your previous hierarchy setup. > > It looks like the misunderstanding comes from the idea that a model has > a place in the hierarchy, and a 'yes/no' flag regarding wether it is in > the world or not. The 'world' only refers to group("world"). > addToWorld() merely makes your model a child of that. In fact this only > makes sense if your camera.rootNode = m3d.group("world") >
I think i get it. By parenting a model to void, the model and its children are not rendered or included in the raycasting because they are no longer included in the camera.rootNode hierarchy. removeFromWorld is effectively the same thind as model.parent = void.
So this means that by using model.removeFromWorld(), the model AND its children are removed from rendering and raycasting, correct?
thanks for taking time to straighten me out here. admittedly i should not offer suggestions of something i only partially understand. i am still learning ~:/ (thankfully)
Tom
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
|
|