Options
All
  • Public
  • Public/Protected
  • All
Menu

Class P3dObject

Hierarchy

  • P3dValueCached
    • P3dObject

Index

Accessors

hasMesh

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

    Returns boolean

id

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

    Returns string

ignorePicking

  • get ignorePicking(): boolean
  • set ignorePicking(value: boolean): void
  • 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 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.

    Parameters

    • value: boolean

    Returns void

isVisible

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

    Returns boolean

  • Whether this object is rendered

    Parameters

    • value: boolean

    Returns void

locationX

  • get locationX(): number
  • set locationX(value: number): void
  • Location vector x component

    Returns number

  • Location vector x component

    Parameters

    • value: number

    Returns void

locationY

  • get locationY(): number
  • set locationY(value: number): void
  • Location vector y component

    Returns number

  • Location vector y component

    Parameters

    • value: number

    Returns void

locationZ

  • get locationZ(): number
  • set locationZ(value: number): void
  • Location vector z component

    Returns number

  • Location vector z component

    Parameters

    • value: number

    Returns void

name

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

    Returns string

parent

  • Another object that this object is parented to in the scene hierarchy. null if this is a root level object.

    Returns P3dObject

  • Another object that this object is parented to in the scene hierarchy. null if this is a root level object.

    Parameters

    Returns void

rotationW

  • get rotationW(): number
  • set rotationW(value: number): void
  • Rotation quaternion w component

    Returns number

  • Rotation quaternion w component

    Parameters

    • value: number

    Returns void

rotationX

  • get rotationX(): number
  • set rotationX(value: number): void
  • Rotation quaternion x component

    Returns number

  • Rotation quaternion x component

    Parameters

    • value: number

    Returns void

rotationY

  • get rotationY(): number
  • set rotationY(value: number): void
  • Rotation quaternion y component

    Returns number

  • Rotation quaternion y component

    Parameters

    • value: number

    Returns void

rotationZ

  • get rotationZ(): number
  • set rotationZ(value: number): void
  • Rotation quaternion z component

    Returns number

  • Rotation quaternion z component

    Parameters

    • value: number

    Returns void

scaleX

  • get scaleX(): number
  • set scaleX(value: number): void
  • Scale vector x component

    Returns number

  • Scale vector x component

    Parameters

    • value: number

    Returns void

scaleY

  • get scaleY(): number
  • set scaleY(value: number): void
  • Scale vector y component

    Returns number

  • Scale vector y component

    Parameters

    • value: number

    Returns void

scaleZ

  • get scaleZ(): number
  • set scaleZ(value: number): void
  • Scale vector z component

    Returns number

  • Scale vector z component

    Parameters

    • value: number

    Returns void

Methods

getSceneLocation

  • getSceneLocation(): Promise<{ x: number; y: number; z: number }>
  • 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 }>

getScreenCoordinates

  • getScreenCoordinates(): Promise<{ x: number; y: 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 }>

refresh

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

setLocation

  • setLocation(x: number, y: number, z: number): void
  • A shortcut method to update whole location vector at once

    Parameters

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

    Returns void

setRotation

  • setRotation(x: number, y: number, z: number, w: number): void
  • A shortcut method to update whole rotation quaternion at once

    Parameters

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

    Returns void

setRotationFromEuler

  • setRotationFromEuler(x: number, y: number, z: number): void
  • Set rotation from euler angles (radians)

    Parameters

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

    Returns void

setScale

  • setScale(x: number, y: number, z: number): void
  • A shortcut method to update whole scale vector at once

    Parameters

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

    Returns void

Generated using TypeDoc