PARENTING OBJECTS...HOW?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest

PARENTING OBJECTS...HOW?

Post by Guest »

HOW DO I PARENT OBJECTS TO THE CAMERA AND OTHER STUFF
CZestmyr
Posts: 72
Joined: Sat Feb 12, 2005 7:11 pm
Location: Czech Republic
Contact:

Post by CZestmyr »

When you create a SceneNode, you specify the parent scene node in the constructor as the second parameter.

And there should also be some setParent functions or something like that in The ISceneNode interface. Just take a look into the reference manual, It's useful.
Guest

Post by Guest »

i found this but i dont under stand does anyone have a chunk of code?



virtual ISceneNode * getMS3DJointNode (const c8 *jointName)=0
IAnimatedMeshSceneNode (ISceneNode *parent, ISceneManager *mgr, s32 id, const core::vector3df &position=core::vector3df(0, 0, 0), const core::vector3df &rotation=core::vector3df(0, 0, 0), const core::vector3df &scale=core::vector3df(1.0f, 1.0f, 1.0f))
Constructor.
Jedive
Posts: 146
Joined: Wed Apr 28, 2004 5:51 pm

Post by Jedive »

All the methods which create a node (they are all in the ISceneManager class) have a "parent" parameter which you can use to set the parent of the new node.


If you want to change the parent of a node after creation, you have the ISceneNode::setParent() method.
Guest

Post by Guest »

ok how do you set its position?
Fred

Post by Fred »

Look in the API docs. We're not going to write your code for you.
Guest

Post by Guest »

i know where do i look and im just trying to learn....
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

On Irrlicht's site, theres both Tutorials and a whole API that contains everything you need to know. Not to mention the source code of the engine COMES with Irrlicht.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

creating nodes and elements in Irrlicht is simple you basicly use an add function for each node or element and insert it's paramiters accordingly common param's are parent, ID, and rectangle or 3d position for nodes.

the code you posted is what inherites these paramiters and creates the element or node.
Guest

Post by Guest »

eh its simple, for a node just type
(node)->setParent(parentnode);
if u cant understand that i cant help u
Post Reply