Hi,

You can always call makeCoredNode<Group> instead, and use the CPEdit/CPEditAll-macros:

// on init
NodePtr root = makeCoredNode<Group>();
mgr->setRoot(root);

// on load
NodePtr node = SceneFileHandler ... ;
CPEdit(root, Node::ChildrenFieldMask); // or just CPEditAll(root)
root->addChild(node);

Anything that you read in needs to be linked into the scene, either by calling mgr->setRoot() or root->addChild(), as you do here.

/Marcus

zhujiejie wrote:
Hi,

 I am trying to update the root node. I have create the root NodePtr like:
    NodePtr root = Node::create();
 and set SimpleSceneManager:
    mgr->setRoot(root);
 and then I run my application, there is nothing showed. That is correct.
 Click a button, call things like this:
root = SceneFileHandler::the().read("data/terrin.wrl"); Nothing changed.
 I have to add an extra function to assign the core:
NodePtr node = SceneFileHandler::the().read("data/terrin.wrl"); beginEditCP(_root);
        _root->setCore(Group::create());
        _root->addChild(node);
      endEditCP(_root);
 That works.
 Is it possible to simplify this operation?
 Thanks a lot.
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Jiejie Zhu
[EMAIL PROTECTED]
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2005-05-10


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users





-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&opÿick
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to