SceneNode creation

Oct 28, 2007 at 4:06 AM
In the current QuickStart, SceneNode is instantiated using the SceneManager the node belongs to, this might not be the best approach as you might wish to move a node from one Scene to another. Instead I purpose that SceneNodes have a parameter less constructor and simply get the information needed from the parent node.

    // Somewhere here we created a room
 
    SceneNode chair = new Chair();
    // chair.Parent == null, chair.Root == null
    chair.Position = new Vector3(100,265,2);
    room.Children.Add(chair);
    // chair.Parent == room, chair.Root == world
    // room.Children.Count == 1
 
    // now we create another room and move the chair to it
    SceneNode room2 = new Room();
    world.Children.Add(room2);
    room2.Children.Add(chair);
    // room.Children.Count == 0, room2.Children.Count == 1

Any comments?