This component defines scripting support. Script is the
only node defined here, it's like a black box that receives
VRML/X3D events, processes them with some external language,
and sends new VRML/X3D events.
Contents:
For demos and tests of CastleScript,
see the castle_script subdirectory inside our VRML/X3D demo models.
Script (Pascal API: TScriptNode)
We handle special script protocols compiled: (to link scripts with handlers written in compiled language (ObjectPascal)) and castlescript: (simple scripting language specific to our engine).
TODO: no standard scripting language, like ECMAScript,
is implemented now. directOutput field of script node
is ignored (compiled: scripts have always direct access
to whole VRML scene, castlescript: has never access to VRML nodes).
mustEvaluate is also ignored for now. This is non-optimal but
valid behavior. Our current scripting protocols have no "loading"
overhead (we don't initialize any scripting engine, castlescript: and
compiled: scripts are just tightly built-in the engine) so this doesn't
hurt us in practice.