Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ObservablePoint3D<T>

Represents a point in 3D space.

Type parameters

  • T

Hierarchy

  • ObservablePoint
    • ObservablePoint3D

Implements

  • IPoint

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new ObservablePoint3D(cb: () => void, scope: any, x?: number, y?: number, z?: number): ObservablePoint3D
  • Creates a new observable point.

    Parameters

    • cb: () => void

      The callback when changed.

        • (): void
        • Returns void

    • scope: any

      The owner of callback.

    • Default value x: number = 0

      The position on the x axis.

    • Default value y: number = 0

      The position on the y axis.

    • Default value z: number = 0

      The position on the z axis.

    Returns ObservablePoint3D

Properties

Private _array

_array: Float32Array = new Float32Array(3)

_x

_x: number

_y

_y: number

cb

cb: (this: T) => any

Type declaration

    • (this: T): any
    • Parameters

      • this: T

      Returns any

scope

scope: any

Accessors

array

  • get array(): Float32Array
  • set array(value: Float32Array): void

x

  • get x(): number
  • set x(value: number): void

y

  • get y(): number
  • set y(value: number): void

z

  • get z(): number
  • set z(value: number): void

Methods

clone

copyFrom

copyTo

  • copyTo<T>(p: T): T

equals

set

  • set(x: number, y?: number, z?: number): this
  • Sets the point to a new x, y and z position.

    Parameters

    • x: number

      The position on the x axis.

    • Default value y: number = x

      The position on the y axis.

    • Default value z: number = x

      The position on the z axis.

    Returns this

setFrom

  • setFrom(array: ArrayLike<number>): this
  • Sets the point to a new x, y and z position.

    Parameters

    • array: ArrayLike<number>

      The array containing x, y and z, expected length is 3.

    Returns this

toString

  • toString(): string

Generated using TypeDoc