Hierarchy

  • P3dValueCached
    • P3dObject

Accessors

  • get hasMesh(): boolean
  • Whether this object has a mesh attached to it

    Returns boolean

  • get id(): string
  • Unique string identifier for the object

    Returns string

  • get ignorePicking(): boolean
  • Set true to make this object invisible to mouse click and hover picking events.

    This can be useful if you use this object as a marker that you move to mouse coordinates, but don't want the object itself to affect future mouse events.

    Returns boolean

  • set ignorePicking(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isVisible(): boolean
  • Whether this object is rendered

    Returns boolean

  • set isVisible(value): void
  • Parameters

    • value: boolean

    Returns void

  • get locationX(): number
  • Location vector x component

    Returns number

  • set locationX(value): void
  • Parameters

    • value: number

    Returns void

  • get locationY(): number
  • Location vector y component

    Returns number

  • set locationY(value): void
  • Parameters

    • value: number

    Returns void

  • get locationZ(): number
  • Location vector z component

    Returns number

  • set locationZ(value): void
  • Parameters

    • value: number

    Returns void

  • get name(): string
  • Name of this object

    Returns string

  • get parent(): P3dObject
  • Another object that this object is parented to in the scene hierarchy. null if this is a root level object.

    Returns P3dObject

  • set parent(parent): void
  • Parameters

    Returns void

  • get rotationW(): number
  • Rotation quaternion w component

    Returns number

  • set rotationW(value): void
  • Parameters

    • value: number

    Returns void

  • get rotationX(): number
  • Rotation quaternion x component

    Returns number

  • set rotationX(value): void
  • Parameters

    • value: number

    Returns void

  • get rotationY(): number
  • Rotation quaternion y component

    Returns number

  • set rotationY(value): void
  • Parameters

    • value: number

    Returns void

  • get rotationZ(): number
  • Rotation quaternion z component

    Returns number

  • set rotationZ(value): void
  • Parameters

    • value: number

    Returns void

  • get scaleX(): number
  • Scale vector x component

    Returns number

  • set scaleX(value): void
  • Parameters

    • value: number

    Returns void

  • get scaleY(): number
  • Scale vector y component

    Returns number

  • set scaleY(value): void
  • Parameters

    • value: number

    Returns void

  • get scaleZ(): number
  • Scale vector z component

    Returns number

  • set scaleZ(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Get object location in scene coordinate space (includes parent transformations)

    object.getSceneLocation().then((resp) => {
    console.log('Object is at', resp.x, resp.y, resp.z);
    });

    Returns Promise<{
        x: number;
        y: number;
        z: number;
    }>

  • Get object position in screen space x and y coordinates

    object.getScreenCoordinates().then((resp) => {
    console.log('Object is at', resp.x, resp.y, 'pixels');
    });

    Returns Promise<{
        x: number;
        y: number;
        z: number;
    }>

  • Refresh object values to their current states in the embed. This might be needed if object is animated and you want to read its properties as it moves around.

    (Normally values are updated only after calling listAnimations())

    Using via then() callback:

    object.refresh().then(() => {
    // Log current location
    console.log(object.locationY);
    });

    Or in async function:

    await object.refresh();
    // Log current location
    console.log(object.locationY);

    Returns Promise<P3dObject>

  • A shortcut method to update whole location vector at once

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

  • A shortcut method to update whole rotation quaternion at once

    Parameters

    • x: number
    • y: number
    • z: number
    • w: number

    Returns void

  • Set rotation from euler angles (radians)

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

  • A shortcut method to update whole scale vector at once

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void