|
4.5 Prototype Scoping RulesPrototype names must be unique: defining a prototype with the same name as another prototype or a built-in node type is an error. A .proto file can contain only one prototype definition. A prototype can be defined in terms of other prototypes. However, a prototype may not be instantiated inside its own definition (i.e., recursive prototypes are illegal). An IS statement refers to a field in the interface of the same prototype, in the same file. A .proto file establishes a DEF/USE name scope separate from the rest of the scene tree and separate from any other prototype definition. Nodes given a name by a DEF construct inside the prototype may not be referenced in a USE construct outside of the prototype's scope. Nodes given a name by a DEF construct outside the prototype scope may not be referenced in a USE construct inside the prototype scope. ![]() ^ page top ^ |
| E-mail to webmaster | Last updated: | Copyright © 2008 Cyberbotics Ltd. |