Here’s a link to the XML scene file that created it.
The script support is added completely independently of the ray tracing code. This is the way it should be and, it turns out, that’s exactly the way it is too.
spDocument->attachComponent("ray", create_raytracer() ); spDocument->attachComponent("scripting", create_scripting() );
The object created by create_scripting() is quite simple and mostly just C++ boilerplate to create a class and respond to Document changes.
(3) There is no three. The ray tracing code itself has no knowledge of whether the Element was created via a script or was part of the initial XML. In MVC terms, the ray tracing code just works since it is properly abstracted from the Model changes.
It was really cool to have the LxEngine architecture surprise me (i.e. the guy designing this and constantly setting unrealistically lofty goals of how I want this all to work) with how seriously easy it was to add a useful feature like scripting.