Options
All
  • Public
  • Public/Protected
  • All
Menu
desc

An Entity that is a drawable element, with a {@link Geometry} and a Material, that can be connected into a scene graph using Nodes.

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

originalSystemId: string

ID of the corresponding object within the originating system, if any.

abstract
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 Mesh'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 billboard(): string
  • Gets the Node's billboarding behaviour.

    Options are:

    • "none" - (default) - No billboarding.
    • "spherical" - Mesh is billboarded to face the viewpoint, rotating both vertically and horizontally.
    • "cylindrical" - Mesh is billboarded to face the viewpoint, rotating only about its vertically axis. Use this mode for things like trees on a landscape.

    Returns string

  • get castsShadow(): boolean
  • set castsShadow(arg: boolean): void
  • get clippable(): boolean
  • set clippable(arg: boolean): void
  • get collidable(): boolean
  • set collidable(arg: boolean): void
  • get colorize(): number[]
  • set colorize(arg: number[]): void
  • Gets the RGB colorize color for this Mesh.

    Multiplies by rendered fragment colors.

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

    Returns number[]

  • Sets the RGB colorize color for this Mesh.

    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
  • get geometry(): Geometry
  • get highlighted(): boolean
  • set highlighted(arg: boolean): void
  • get isDrawable(): boolean
  • get isEntity(): boolean
  • get isMesh(): boolean
  • get isModel(): boolean
  • get isObject(): boolean
  • get isStateSortable(): boolean
  • Property with final value true to indicate that xeokit should render this Mesh in sorted order, relative to other Meshes.

    The sort order is determined by Mesh.stateSortCompare.

    Sorting is essential for rendering performance, so that xeokit is able to avoid applying runs of the same state changes to the GPU, ie. can collapse them.

    Returns boolean

  • get layer(): number
  • set layer(arg: number): void
  • Gets the Mesh's rendering order relative to other Meshes.

    Default value is 0.

    This can be set on multiple transparent Meshes, to make them render in a specific order for correct alpha blending.

    Returns number

  • Sets the Mesh's rendering order relative to other Meshes.

    Default value is 0.

    This can be set on multiple transparent Meshes, to make them render in a specific order for correct alpha blending.

    Parameters

    • arg: number

    Returns void

  • get matrix(): number[]
  • set matrix(arg: number[]): void
  • Gets the Mesh'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 Mesh'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 numTriangles(): number
  • get offset(): number[]
  • set offset(arg: number[]): void
  • Gets the Mesh's 3D World-space offset.

    Default value is [0,0,0].

    Returns number[]

  • Sets the Mesh's 3D World-space offset.

    The offset dynamically translates the Mesh in World-space.

    Default value is [0, 0, 0].

    Provide a null or undefined value to reset to the default value.

    Parameters

    • arg: number[]

    Returns void

  • get opacity(): number
  • set opacity(arg: number): void
  • Gets the opacity factor for this Mesh.

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

    Returns number

  • Sets the opacity factor for this Mesh.

    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
  • 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
  • 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
  • get rotation(): number[]
  • set rotation(arg: number[]): void
  • Gets the Mesh'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 Mesh'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 Mesh 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 stationary(): boolean
  • Gets if the Node's position is stationary.

    When true, will disable the effect of Camera translations for this Mesh, while still allowing it to rotate. This is useful for skyboxes.

    Returns boolean

  • get transparent(): boolean
  • get visible(): boolean
  • set visible(arg: boolean): void
  • get worldMatrix(): number[]
  • get worldNormalMatrix(): number[]
  • get xrayed(): boolean
  • set xrayed(arg: boolean): void

Methods

  • 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

  • rotate(axis: number[], angle: number): Mesh
  • Rotates the Mesh 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 Mesh

  • rotateOnWorldAxis(axis: number[], angle: number): Mesh
  • Rotates the Mesh 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 Mesh

  • rotateX(angle: number): Mesh
  • rotateY(angle: number): Mesh
  • rotateZ(angle: number): Mesh
  • stateSortCompare(mesh1: Mesh, mesh2: Mesh): number
  • Comparison function used by the renderer to determine the order in which xeokit should render the Mesh, relative to to other Meshes.

    xeokit requires this method because Mesh implements {@link Drawable}.

    Sorting is essential for rendering performance, so that xeokit is able to avoid needlessly applying runs of the same rendering state changes to the GPU, ie. can collapse them.

    Parameters

    Returns number

  • translate(axis: number[], distance: number): Mesh
  • Translates the Mesh 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 Mesh

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

    Parameters

    • distance: number

      Distance to translate along the X-axis.

    Returns Mesh

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

    Parameters

    • distance: number

      Distance to translate along the Y-axis.

    Returns Mesh

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

    Parameters

    • distance: number

      Distance to translate along the Z-axis.

    Returns Mesh

  • 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