@twinfinity/core
    Preparing search index...

    Class DynamicPolygonPointAbstract

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

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _id: number = ...
    _isVirtual: boolean
    _localX: number = 0
    _localY: number = 0
    _localZ: number = 0
    _recalculateLocalCoords: boolean = false
    _recalculateWorldCoords: boolean = false
    _worldX: number
    _worldY: number
    _worldZ: number
    isEnabled: boolean = true

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

    plane: Plane

    Plane that this point lies on.

    _tmp: {
        counter: number;
        identityMatrix: Matrix;
        rayA: Ray;
        vector3A: Vector3;
        vector3B: Vector3;
    } = ...

    Accessors

    • get localX(): number

      X coordinate of point in local space.

      Returns number

    • get localY(): number

      Y coordinate of point in local space.

      Returns number

    • get localZ(): number

      Z coordinate of point in local space.

      Returns number

    • get x(): number

      X coordinate of point in world space.

      Returns number

    • set x(val: number): void

      Set the X coordinate of point in world space.

      Parameters

      • val: number

      Returns void

    • get y(): number

      Y coordinate of point in world space.

      Returns number

    • set y(val: number): void

      Set the Y coordinate of point in world space.

      Parameters

      • val: number

      Returns void

    • get z(): number

      Z coordinate of point in world space.

      Returns number

    • set z(val: number): void

      Set the Z coordinate of point in world space.

      Parameters

      • val: number

      Returns void

    Methods

    • 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

      a DynamicPolygonPointMoveResult.

    • 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.

    • 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

    • 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.

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

      Parameters

      Returns boolean

      true if point is not virtual, otherwise false.