INTRODUCTION TO MOVABLE NODES
Creating objects and isolating them from each other can be a lengthy process. WTK R6 recognized the need to simplify the process so the movable node was created for this purpose. A movable node is a combination or package of three different nodes a separator node or transform separator node, a transform node, and a content node.
Creating Movables
The following is a list of the movable creation functions and the type of content node they create
Function | Type of Content Node | Type of Separator Node |
WTmovgeometrynode_new | Geometry | Separator |
WTmovlightnode_newpoint | Point Light | Transform Separator |
WTmovlightnode_newdirected | Directed Light | Transform Separator |
WTmovlightnode_newspot | Spot Light | Transform Separator |
WTmovsepnode_new | Separator | Separator |
WTmovswitchnode_new | Switch | Separator |
WTmovlodnode_new | LOD | Separator |
WTmovnode_load | Depends upon the file read | Depends on the file read |
WTmovgeometrynode_new
Creates a new movable node with a separator and geometry as its content and adds it as the last child of the parent specified.
SYNTAX:
WTmovgeometrynode_new(WTnode *parent, WTgeometry *geom);
ARGUMENTS:
parent -- The parent node
geom -- The geometry to use in the content node
RETURN TYPE:
A pointer to a type WTnode that contains the movable information.
Instancing a movable node
In order to make an instance of a movable node there is a function provided WTmovnode_instance. You may have multiple instances of movable nodes in a scene graph. Since a movable node contains a transform node it would not be possible to have instances of a movable node where each instance has its own position and orientation information unless a special function were created to handle this case. If multiple instances of a movable node are desired then this function will all the user to create multiple instances and yet do it in an as efficient a manner as possible because all of the information stored in the movable (except for the transform ) is shared by every instance of the movable. In other words all information is shared but the transform but each instance has its own transform node.
WTmovnode_instance
This function creates an instance of a movable node and inserts it as the last child of the parent specified.
SYNTAX:
WTnode *WTmovnode_instance(WTnode *parent, WTnode *movable);
ARGUMENTS:
parent -- The parent node. If this argument is NULL then the node is created as an orphan that can be inserted later.
movable -- The movable node to create an instance of.
RETURN TYPE:
The new movable node. NULL if the movable argument is a regular node or an instance is not created
Assignment 7
project definition: