Spot#

Spot represents a laser or infra-red pointer spot, such as those used for laser target marking or NVG-visible IR pointers. Spot is a final class – it does not extend or get extended by any other class.

class Spot#

Static functions#

static createLaser(source, localRef, point, code)#

Creates a laser spot originating from source, aimed at point.

Parameters:
  • source (Object) – The object the laser spot originates from.

  • localRef (table) – Optional local offset from the source’s position.

  • point (table) – The point the laser is aimed at.

  • code (number) – Laser code (see Spot.setCode()).

Returns:

The newly created laser spot.

Return type:

Spot

static createInfraRed(source, localRef, point)#

Creates an infra-red pointer spot originating from source, aimed at point.

Parameters:
  • source (Object) – The object the IR spot originates from.

  • localRef (table) – Optional local offset from the source’s position.

  • point (table) – The point the IR pointer is aimed at.

Returns:

The newly created IR spot.

Return type:

Spot

Member functions#

destroy()#

Removes the spot from the simulation.

getCategory()#

Returns the spot’s category (see Spot.Category).

Returns:

Spot category.

Return type:

number

getPoint()#

Returns the point the spot is currently aimed at.

Returns:

Aim point.

Return type:

table

setPoint(point)#

Updates the point the spot is aimed at.

Parameters:

point (table) – New aim point.

getCode()#

For laser spots, returns the current laser code.

Returns:

Laser code.

Return type:

number

setCode(code)#

For laser spots, sets the laser code (used by laser-guided weapons to match a specific designator).

Parameters:

code (number) – New laser code.

Enumerators#

Spot.Category identifies the type of spot:

Value

Meaning

Spot.Category.INFRA_RED

Infra-red pointer spot.

Spot.Category.LASER

Laser spot.