Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a point in 3D space.

Hierarchy

  • ObservablePoint
    • Point3D

Implements

  • IPoint3DData

Index

Constructors

constructor

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

    Parameters

    • x: number = 0

      The position on the x axis.

    • y: number = 0

      The position on the y axis.

    • z: number = 0

      The position on the z axis.

    • cb: () => void = ...

      The callback when changed.

        • (): void
        • Returns void

    • scope: any = undefined

      The owner of callback.

    Returns Point3D

Properties

_x

_x: number

_y

_y: number

cb

cb: () => any

Type declaration

    • (): any
    • The callback function triggered when x and/or y are changed

      Returns any

scope

scope: any

The owner of the callback

Accessors

array

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

magnitude

  • get magnitude(): number

x

  • get x(): number
  • set x(value: number): void
  • Position on the x axis relative to the local coordinates of the parent.

    Returns number

  • Position on the x axis relative to the local coordinates of the parent.

    Parameters

    • value: number

    Returns void

y

  • get y(): number
  • set y(value: number): void
  • Position on the y axis relative to the local coordinates of the parent.

    Returns number

  • Position on the y axis relative to the local coordinates of the parent.

    Parameters

    • value: number

    Returns void

z

  • get z(): number
  • set z(value: number): void
  • Position on the z axis relative to the local coordinates of the parent.

    Returns number

  • Position on the z axis relative to the local coordinates of the parent.

    Parameters

    • value: number

    Returns void

Methods

clone

  • clone(cb?: () => any, scope?: any): Point3D
  • Parameters

    • cb: () => any = ...
        • (): any
        • The callback function triggered when x and/or y are changed

          Returns any

    • scope: any = ...

    Returns Point3D

copyFrom

copyTo

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

equals

normalize

set

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

    Parameters

    • x: number

      The position on the x axis.

    • y: number = x

      The position on the y axis.

    • z: number = x

      The position on the z axis.

    Returns Point3D

setFrom

  • setFrom(array: ArrayLike<number>): Point3D
  • 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 Point3D

toString

  • toString(): string
  • Returns string

Static add

Static cross

Static distance

Static dot

Static inverse

Static lerp

  • Performs a linear interpolation between two points.

    Parameters

    • a: Point3D

      The first point.

    • b: Point3D

      The second point.

    • t: number

      The interpolation amount, in the range [0-1], between the two inputs.

    • out: Point3D = ...

      The receiving point. If not supplied, a new point will be created.

    Returns Point3D

Static multiply

Static negate

Static scale

  • Scales a point by a scalar number.

    Parameters

    • a: Point3D

      The point to scale.

    • b: number

      The amount to scale the point by.

    • out: Point3D = ...

      The receiving point. If not supplied, a new point will be created.

    Returns Point3D

Static squaredDistance

Static subtract

Static transform

Generated using TypeDoc