Original Description:
This parent script allows highlighting the model under the cursor by changing its emissive property. It can be used, for example, to create "rollover" effects in a 3D world.
To use it, first create a new instance of cHighlightModels with a 3D member as a parameter:
world3D = member("world3D")
HLInstance = script("cHighlightModels").new(world3D)
Then, add the models that will be affected by the instance (that is which models can be highlighted).
HLInstance.affectModel(world3D.model(1))
HLInstance.affectModel(world3D.model(3)) -- etc.
If necessary, you can also remove a model using this handler:
HLInstance.excludeModel(world3D.model(3))
Finally, to update the models and to do a treatment on the models that is highlighted you can use the update() handler (for the detail of what it does, please have a look at the source code) :
-- This can be added, for example, in an "enterFrame" handler :
highlightedModel = HLInstance.update(the mouseLoc)
put highlightedModel.name && "is selected!"