<viz>.starthotspot

This begins monitoring a user-defined hotspot

 

<viz>.starthotspot(
    hotspotID    # hotspot ID
    type    # circle/rectangle, in/out
    centerX    # center X
    centerZ    # center Z
    p1    # radius or width
    p2    # optional depth

)

 

hotspotID

Specifies the integer ID number the hotspot.


type

Specifies the type of hotspot:
CIRCLE_HOTSPOT_IN
CIRCLE_HOTSPOT_OUT
RECTANGLE_HOTSPOT_IN
RECTANGLE_HOTSPOT_OUT


centerX

Specifies the center of the hotspot on the ground surface.


centerZ

Specifies the radius (p1 only) circular hotspot or the width and length (p1 and p2) of the rectangular hotspot.


p1


p2


Remarks

Use this command to establish a hotspot at the specified location with the given integer hotspotID.

Hotspots come in four types: CIRCLE_HOTSPOT_IN, CIRCLE_HOTSPOT_OUT, RECTANGLE_HOTSPOT_IN, and RECTANGLE_HOTSPOT_OUT. A circle hotspot is defined by a center and a radius. When starting a circle hotspot, give the radius as argument p1 (p2 is not used). A rectangle hotspot is defined by a center and a width around that center in the X and Z dimensions (thus the dimensions of the rectangle hotspot are 2*X by 2*Z), given as arguments p1 and p2, respectively. CIRCLE and RECTANGLE hotspots are either IN (triggered upon entering the hotspot) or OUT (triggered when exiting the hotspot).

When a hotspot event is triggered, the callback function is passed the ID of the triggered hotspot, and the (x,y,z) coordinates of the observer head position (so that's one integer and three floating points). After a hotspot has been triggered once, the hotspot is de-activated. This is necessary so that the hotspot does not continue to create events. If desired, you can re-establish the hotspot later (try using a timer event). You can re-use hotspot ID's as often as you like.

NOTE: There is also a viz.deletehotspot(id) to remove a hotspot without having to trigger it first.

Return Value

None

Example

viz.starthotspot(1, RECTANGLE_HOTSPOT_IN, 2, 3, 1, 1)
# Must register handler once for all hotspots
viz.callback(viz.HOTSPOT_EVENT, HandleMyHotspots)

See also

<viz>.callback
<viz>.deletehotspot
<node3d>.starthotspot
Events