3.9. Defining your own VRML nodes

At the end it's worth noting that you're not limited to the nodes defined by VRML specifications and implemented in X3DNodes unit. You can freely define your own TVRMLNode descendants. All it takes to make them visible is to register them in NodesManager object. For example, call


from your unit's initialization section. You may also want to add it to the AllowedChildrenNodes list.

This way you can define specific VRML nodes for a specific programs, without the need to modify anything within the base units. I used this technique in the malfunction game to define special-purpose VRML nodes like MalfunctionLevelInfo and MalfunctionNotMovingEnemy.