The highlighter tool allows for an object to be highlighted. The main purpose of the highlighter is in collaborative tasks. The following command creates a Highlighter object:
Command |
Description |
highlighter.Highlighter(highlightOnCollision=True, highlightMode=highlighter.MODE_OUTLINE) |
highlightOnCollision: Determines whether or not an object is highlighted when it collides with the highlighter. highlightMode: Can be highlighter.MODE_ARROW, highlighter.MODE_OUTLINE, highlighter.MODE_BOX |
The following methods are available on the Highlighter object:
Method |
Description |
<Highlighter>.getHighlightMode() |
Returns the highlighter mode. |
<Highlighter>.setHighlightMode(highlightMode) |
Sets the highlight mode. highlightMode: Can be highlighter.MODE_ARROW, highlighter.MODE_OUTLINE, highlighter.MODE_BOX |
<Highlighter>.setItems() |
Sets the objects that can be highlighted. items: a list of Vizard nodes. |
<Highlighter>.highlight() |
Sends a ray from the highlighter node (hand, arrow, etc.) to intersect and highlight objects. |
<Highlighter>.getSelection() |
Returns the current object highlighted by the highlighter. Can be None if there is no object. |
<Highlighter>.clear() |
Clears the highlight from the highlighted object. |
<Highlighter>.remove() |
Removes the highlighter. |
<Highlighter>.setUpdateFunction(updateFunction) |
Sets the update function that gets called every frame. The update function calls methods on the tool based on the state of input devices. |
The following event is triggered when the highlighted object changes:
Event |
Description |
highlighter.HIGHLIGHT_EVENT |
This event is generated when the object highlighted by the highlighter is updated. It provides a single event structure e with the following attributes: e.new: The object currently highlighted by the highlighter. Returns None if there is no object. e.old: The object that was previously highlighted by the highlighter. Returns None if there was no object. |