Options
All
  • Public
  • Public/Protected
  • All
Menu

An Entity that is a scene graph node that can have child Nodes and Meshes.

Hierarchy

Implements

Index

Constructors

Properties

id: string

ID of this Component, unique within the Scene.

Components are mapped by this ID in {@link Scene.components}.

property

id

meta: any

Arbitrary, user-defined metadata on this component.

property

metadata

scene: Scene

The parent Scene that contains this Component.

property

scene

final
viewer: Viewer

The viewer that contains this Scene.

property

viewer

Accessors

  • get aabb(): number[]
  • Gets the Node's World-space 3D axis-aligned bounding box.

    Represented by a six-element Float64Array containing the min/max extents of the axis-aligned volume, ie. [xmin, ymin,zmin,xmax,ymax, zmax].

    Returns number[]

  • get castsShadow(): boolean
  • set castsShadow(arg: boolean): void
  • Gets if this Node casts shadows.

    Child Nodes and Meshes may have different values for this property.

    Returns boolean

  • Sets if this Node and all child Nodes and Meshes cast shadows.

    Parameters

    • arg: boolean

    Returns void

  • get clippable(): boolean
  • set clippable(arg: boolean): void
  • Gets if this Node is clippable.

    Clipping is done by the SectionPlanes in {@link Scene.clips}.

    Child Nodes and Meshes may have different values for this property.

    Returns boolean

  • Sets if this Node and all child Nodes and Meshes are clippable.

    Clipping is done by the SectionPlanes in {@link Scene.clips}.

    Parameters

    • arg: boolean

    Returns void

  • get collidable(): boolean
  • set collidable(arg: boolean): void
  • Gets if this Node is included in boundary calculations.

    Child Nodes and Meshes may have different values for this property.

    Returns boolean

  • Sets if this Node and all child Nodes and Meshes are included in boundary calculations.

    Parameters

    • arg: boolean

    Returns void

  • get colorize(): number[]
  • set colorize(arg: number[]): void
  • Gets the RGB colorize color for this Node.

    Each element of the color is in range [0..1].

    Child Nodes and Meshes may have different values for this property.

    Returns number[]

  • Sets the RGB colorize color for this Node and all child Nodes and Meshes}.

    Multiplies by rendered fragment colors.

    Each element of the color is in range [0..1].

    Parameters

    • arg: number[]

    Returns void

  • get culled(): boolean
  • set culled(arg: boolean): void
  • get edges(): boolean
  • set edges(arg: boolean): void
  • Gets if this Node's edges are enhanced.

    Child Nodes and Meshes may have different values for this property.

    Returns boolean

  • Sets if this Node and all child Nodes and Meshes are edge-enhanced.

    Parameters

    • arg: boolean

    Returns void

  • get highlighted(): boolean
  • set highlighted(arg: boolean): void
  • get isEntity(): boolean
  • get isModel(): boolean
  • get isNode(): boolean
  • get isObject(): boolean
  • get matrix(): number[]
  • set matrix(arg: number[]): void
  • Gets the Node's local modeling transform matrix.

    Default value is [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1].

    Returns number[]

  • Sets the Node's local modeling transform matrix.

    Default value is [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1].

    Parameters

    • arg: number[]

    Returns void

  • get numChildren(): number
  • get numTriangles(): number
  • get offset(): number[]
  • set offset(arg: number[]): void
  • Gets the Node's 3D World-space offset.

    Default value is [0, 0, 0].

    Child Nodes and Meshes may have different values for this property.

    Returns number[]

  • Sets the 3D World-space offset for this Node and all child Nodes and Meshes}.

    The offset dynamically translates those components in World-space.

    Default value is [0, 0, 0].

    Note that child Nodes and Meshes may subsequently be given different values for this property.

    Parameters

    • arg: number[]

    Returns void

  • get opacity(): number
  • set opacity(arg: number): void
  • Gets this Node's opacity factor.

    This is a factor in range [0..1] which multiplies by the rendered fragment alphas.

    Child Nodes and Meshes may have different values for this property.

    Returns number

  • Sets the opacity factor for this Node and all child Nodes and Meshes.

    This is a factor in range [0..1] which multiplies by the rendered fragment alphas.

    Parameters

    • arg: number

    Returns void

  • get origin(): Float64Array
  • set origin(arg: Float64Array): void
  • get originalSystemId(): string
  • ID of the corresponding object within the originating system, if any.

    Returns string

  • The Component that owns the lifecycle of this Component, if any.

    When that component is destroyed, this component will be automatically destroyed also.

    Will be null if this Component has no owner.

    property

    owner

    Returns Component

  • get parent(): Node
  • set parent(arg: Node): void
  • get pickable(): boolean
  • set pickable(arg: boolean): void
  • get position(): number[]
  • set position(arg: number[]): void
  • get quaternion(): number[]
  • set quaternion(arg: number[]): void
  • get receivesShadow(): boolean
  • set receivesShadow(arg: boolean): void
  • Whether or not to this Node can have shadows cast upon it.

    Child Nodes and Meshes may have different values for this property.

    Returns boolean

  • Sets if this Node and all child Nodes and Meshes can have shadows cast upon them.

    Parameters

    • arg: boolean

    Returns void

  • get rotation(): number[]
  • set rotation(arg: number[]): void
  • Gets the Node's local rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.

    Default value is [0,0,0].

    Returns number[]

  • Sets the Node's local rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.

    Default value is [0,0,0].

    Parameters

    • arg: number[]

    Returns void

  • get rtcCenter(): Float64Array
  • set rtcCenter(arg: Float64Array): void
  • get saoEnabled(): boolean
  • Gets if this Node can have Scalable Ambient Obscurance (SAO) applied to it.

    SAO is configured by {@link SAO}.

    abstract

    Returns boolean

  • get scale(): number[]
  • set scale(arg: number[]): void
  • get selected(): boolean
  • set selected(arg: boolean): void
  • get visible(): boolean
  • set visible(arg: boolean): void
  • get worldMatrix(): number[]
  • get xrayed(): boolean
  • set xrayed(arg: boolean): void

Methods

  • Adds a child Node or Mesh.

    The child must be a Node or Mesh in the same Scene.

    If the child already has a parent, will be removed from that parent first.

    Does nothing if already a child.

    Parameters

    • child: string | Mesh | Node

      Instance or ID of the child to add.

    • Optional inheritStates: any

    Returns Mesh | Node

    The child.

  • clear(): void
  • destroy(): void
  • error(message: string): void
  • Logs an error for this component to the JavaScript console.

    The console message will have this format: [ERROR] [<component type> =<component id>: <message>

    Also fires the message as an "error" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

  • fire(event: string, value: any, forget?: boolean): void
  • Fires an event on this component.

    Notifies existing subscribers to the event, optionally retains the event to give to any subsequent notifications on the event as they are made.

    Parameters

    • event: string

      The event type name

    • value: any

      The event parameters

    • Optional forget: boolean

    Returns void

  • hasSubs(event: string): boolean
  • Returns true if there are any subscribers to the given event on this component.

    Parameters

    • event: string

      The event

    Returns boolean

    True if there are any subscribers to the given event on this component.

  • isType(type: any): boolean
  • log(message: string): void
  • Logs a console debugging message for this component.

    The console message will have this format: [LOG] [<component type> <component id>: <message>

    Also fires the message as a "log" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

  • off(subId: string): void
  • on(event: string, callback: Function, scope?: any): string
  • Subscribes to an event on this component.

    The callback is be called with this component as scope.

    Parameters

    • event: string

      The event

    • callback: Function

      Called fired on the event

    • Optional scope: any

    Returns string

    Handle to the subscription, which may be used to unsubscribe with .off.

  • once(event: string, callback: Function, scope?: any): void
  • Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd.

    This is equivalent to calling Component.on, and then calling Component.off inside the callback function.

    Parameters

    • event: string

      Data event to listen to

    • callback: Function

      Called when fresh data is available at the event

    • Optional scope: any

    Returns void

  • removeChildren(): void
  • rotate(axis: number[], angle: number): Node
  • Rotates the Node about the given local axis by the given increment.

    Parameters

    • axis: number[]

      Local axis about which to rotate.

    • angle: number

      Angle increment in degrees.

    Returns Node

  • rotateOnWorldAxis(axis: number[], angle: number): Node
  • Rotates the Node about the given World-space axis by the given increment.

    Parameters

    • axis: number[]

      Local axis about which to rotate.

    • angle: number

      Angle increment in degrees.

    Returns Node

  • rotateX(angle: number): Node
  • rotateY(angle: number): Node
  • rotateZ(angle: number): Node
  • translate(axis: number[], distance: number): Node
  • Translates the Node along local space vector by the given increment.

    Parameters

    • axis: number[]

      Normalized local space 3D vector along which to translate.

    • distance: number

      Distance to translate along the vector.

    Returns Node

  • translateX(distance: number): Node
  • Translates the Node along the local X-axis by the given increment.

    Parameters

    • distance: number

      Distance to translate along the X-axis.

    Returns Node

  • translateY(distance: number): Node
  • Translates the Node along the local Y-axis by the given increment.

    Parameters

    • distance: number

      Distance to translate along the Y-axis.

    Returns Node

  • translateZ(distance: number): Node
  • Translates the Node along the local Z-axis by the given increment.

    Parameters

    • distance: number

      Distance to translate along the Z-axis.

    Returns Node

  • warn(message: string): void
  • Logs a warning for this component to the JavaScript console.

    The console message will have this format: [WARN] [<component type> =<component id>: <message>

    Also fires the message as a "warn" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

Generated using TypeDoc