Skip to main content

abstractDynamicPolygonPoint

Represents a point in a DynamicPolygon. Inherit from this class if additional functionality is required.

Hierarchy

Index

Constructors

publicconstructor

Properties

publicisEnabled

isEnabled: boolean = true

When true then onPointTrackableScreen will trigger for this instance. Otherwise it will not

publicreadonlyplane

plane: Plane

Plane that this point lies on.

Accessors

publicisDeletable

publiclocalX

  • get localX(): number
  • X coordinate of point in local space.


    Returns number

publiclocalY

  • get localY(): number
  • Y coordinate of point in local space.


    Returns number

publiclocalZ

  • get localZ(): number
  • Z coordinate of point in local space.


    Returns number

publicx

  • get x(): number
  • set x(val: number): void
  • X coordinate of point in world space.


    Returns number

  • Set the X coordinate of point in world space.


    Parameters

    • val: number

    Returns void

publicy

  • get y(): number
  • set y(val: number): void
  • Y coordinate of point in world space.


    Returns number

  • Set the Y coordinate of point in world space.


    Parameters

    • val: number

    Returns void

publicz

  • get z(): number
  • set z(val: number): void
  • Z coordinate of point in world space.


    Returns number

  • Set the Z coordinate of point in world space.


    Parameters

    • val: number

    Returns void

Methods

publicapply

  • apply(): void
  • Same as calling apply.


    Returns void

publicdelete

publicmove

  • Attempt to move a point to a new location on Plane. To find the location, a ray is shot from camera through canvasCoordinate and then an intersection test is performed. If the ray intersects Plane, the point is moved to the coordinates of the intersection. Otherwise nothing happens. It is also not possible to move a point if it results in a complex polygon. The point is assigned the same x,y,z values as the coordinate where the ray intersects the plane.


    Parameters

    Returns DynamicPolygonPointMoveResult

publicpoints

  • Enables iteration of all points in the polygon.


    Parameters

    • optionalpredicate: (p: DynamicPolygonPoint) => boolean

      Optional predicate. If specified only points where the predicate returns true will be returned.

    • backwards: boolean = false

      If true then polygon point are visited in backwards direction. Default is false.

    Returns Generator<DynamicPolygonPoint, void, unknown>

    generator.

publicsetLocals

  • setLocals(x: number, y: number, z: number): void
  • Set coordinates in local space.


    Parameters

    • x: number

      X coordinate in local space.

    • y: number

      Y coordinate in local space.

    • z: number

      Z coordinate in local space.

    Returns void

publicvirtual

  • virtual(v?: boolean): boolean
  • This method has two purposes.

    1. Check if this point is virtual or not (if v is undefined). This is very useful in a UI where a different visualization for a ‘virtual drag point’ and a ‘real drag point’ may be required..
    2. Convert this point to/from virtual by specifying v.

    Parameters

    • optionalv: boolean

      Optional. If not specified function only returns current state. If specified then point is converted to either a virtual point (v = true) or a non virtual point (v = false).

    Returns boolean

    If v was not specified then true if point is virtual, otherwise false. If v was specified it returns true if point was successfully converted. Otherwise false. A point cannot be converted from non virtual to virtual if there are 3 or less non virtual points in the polygon.

publicstaticIsNotVirtual

  • Predicate to check if a point is virtual or not.


    Parameters

    Returns boolean

    true if point is not virtual, otherwise false.