Reference Source
public interface | source

Entity

Indirect Implemented:

An abstract 3D scene element that can be individually shown, hidden, selected, highlighted, xrayed, culled, picked, clipped and bounded.

Entity provides an abstract interface through which different concrete types of scene element can be accessed and manipulated uniformly.

Entities Representing Models

Entities Representing Objects

Updating Batches of Objects

Scene provides the following methods for updating batches of object-Entities using their Entity#ids:

Member Summary

Public Members
public get abstract

World-space 3D axis-aligned bounding box (AABB) of this Entity.

public set abstract

Sets if this Entity casts shadows.

public get abstract

Gets if this Entity casts shadows.

public set abstract

Sets if this Entity is clippable.

public get abstract

Gets if this Entity is clippable.

public set abstract

Sets if this Entity is included in boundary calculations.

public get abstract

Gets if this Entity is included in boundary calculations.

public set abstract

Sets the Entity's RGB colorize color, multiplies by the Entity's rendered fragment colors.

public get abstract

Gets the Entity's RGB colorize color, multiplies by the Entity's rendered fragment colors.

public set abstract

Sets if this Entity is culled.

public get abstract

Gets if this Entity is culled.

public set abstract

Sets if this Entity's edges are enhanced.

public get abstract

Gets if this Entity's edges are enhanced.

public set abstract

Sets if this Entity is highlighted.

public get abstract

Gets if this Entity is highlighted.

public get abstract

Component ID, unique within the Scene.

public get

Returns true to indicate that this is an Entity.

public get abstract

Returns true if this Entity represents a model.

public get abstract

Returns true if this Entity represents an object.

public get abstract

The approximate number of triangles in this Entity.

public set abstract

Sets the Entity's 3D World-space offset.

Since offsetting Entities comes with memory and rendering overhead on some systems, this feature only works when Viewer is configured with entityOffsetsEnabled: true.

The offset dynamically translates the Entity in World-space, which is useful for creating effects like exploding parts assemblies etc.

Default value is [0,0,0].

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

public get abstract

Gets the Entity's 3D World-space offset.

Default value is [0,0,0].

public set abstract

Sets the Entity's opacity factor, multiplies by the Entity's rendered fragment alphas.

public get abstract

Gets the Entity's opacity factor.

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

public set abstract

Sets the 3D World-space origin for this Entity.

public get abstract

Gets the 3D World-space origin for this Entity.

public get abstract

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

public get

Returns the parent Entity, if any.

public set abstract

Sets if this Entity is pickable.

public get abstract

Gets if this Entity is pickable.

public set abstract

Sets if to this Entity can have shadows cast upon it

public get abstract

Gets if this Entity can have shadows cast upon it

public get abstract

Gets if this Entity can have Scalable Ambient Obscurance (SAO) applied to it.

public set abstract

Sets if this Entity is selected.

public get abstract

Gets if this Entity is selected.

public set abstract

Sets if this Entity is visible.

public get abstract

Gets if this Entity is visible.

public set abstract

Sets if this Entity is xrayed.

public get abstract

Gets if this Entity is xrayed.

Method Summary

Public Methods
public

Destroys this Entity.

public

getEachVertex(callback: *)

Gets the World, View and Canvas-space positions of each vertex in a callback.

Public Members

public get abstract aabb: Float64Array source

World-space 3D axis-aligned bounding box (AABB) of this Entity.

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

public set abstract castsShadow: Boolean source

Sets if this Entity casts shadows.

public get abstract castsShadow: Boolean source

Gets if this Entity casts shadows.

public set abstract clippable: Boolean source

Sets if this Entity is clippable.

Clipping is done by the SectionPlanes in Scene#sectionPlanes.

public get abstract clippable: Boolean source

Gets if this Entity is clippable.

Clipping is done by the SectionPlanes in Scene#sectionPlanes.

public set abstract collidable: Boolean source

Sets if this Entity is included in boundary calculations.

public get abstract collidable: Boolean source

Gets if this Entity is included in boundary calculations.

public set abstract colorize: Number[] source

Sets the Entity's RGB colorize color, multiplies by the Entity's rendered fragment colors.

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

public get abstract colorize: Number[] source

Gets the Entity's RGB colorize color, multiplies by the Entity's rendered fragment colors.

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

public set abstract culled: Boolean source

Sets if this Entity is culled.

Only rendered when Entity#visible is true and Entity#culled is false.

public get abstract culled: Boolean source

Gets if this Entity is culled.

Only rendered when Entity#visible is true and Entity#culled is false.

public set abstract edges: Boolean source

Sets if this Entity's edges are enhanced.

public get abstract edges: Boolean source

Gets if this Entity's edges are enhanced.

public set abstract highlighted: Boolean source

Sets if this Entity is highlighted.

When Entity#isObject and Entity#highlighted are both true the Entity will be registered by Entity#id in Scene#highlightedObjects.

public get abstract highlighted: Boolean source

Gets if this Entity is highlighted.

When Entity#isObject and Entity#highlighted are both true the Entity will be registered by Entity#id in Scene#highlightedObjects.

public get abstract id: Number | String source

Component ID, unique within the Scene.

public get isEntity: Boolean: boolean source

Returns true to indicate that this is an Entity.

Return:

Boolean

public get abstract isModel: Boolean source

Returns true if this Entity represents a model.

When this is true, the Entity will be registered by Entity#id in Scene#models and may also have a corresponding MetaModel.

public get abstract isObject: Boolean source

Returns true if this Entity represents an object.

When this is true, the Entity will be registered by Entity#id in Scene#objects and may also have a corresponding MetaObject.

public get abstract numTriangles: Number source

The approximate number of triangles in this Entity.

public set abstract offset: Number[] source

Sets the Entity's 3D World-space offset.

Since offsetting Entities comes with memory and rendering overhead on some systems, this feature only works when Viewer is configured with entityOffsetsEnabled: true.

The offset dynamically translates the Entity in World-space, which is useful for creating effects like exploding parts assemblies etc.

Default value is [0,0,0].

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

public get abstract offset: Number[] source

Gets the Entity's 3D World-space offset.

Default value is [0,0,0].

public set abstract opacity: Number source

Sets the Entity's opacity factor, multiplies by the Entity's rendered fragment alphas.

This is a factor in range [0..1].

public get abstract opacity: Number source

Gets the Entity's opacity factor.

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

public set abstract origin: Float64Array source

Sets the 3D World-space origin for this Entity.

public get abstract origin: Float64Array source

Gets the 3D World-space origin for this Entity.

public get abstract originalSystemId: String source

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

By default, this has the same value as Entity#id. When we load a model using XKTLoaderPlugin#load, with XKTLoaderPlugin#globalizeObjectIds set true, then that plugin will prefix Entity#id with the model ID, while leaving this property holding the original value of Entity#id. When loading an IFC model, this property will hold the IFC product ID of the corresponding IFC element.

public get parent source

Returns the parent Entity, if any.

public set abstract pickable: Boolean source

Sets if this Entity is pickable.

Picking is done via calls to Scene#pick.

public get abstract pickable: Boolean source

Gets if this Entity is pickable.

Picking is done via calls to Scene#pick.

public set abstract receivesShadow: Boolean source

Sets if to this Entity can have shadows cast upon it

public get abstract receivesShadow: Boolean source

Gets if this Entity can have shadows cast upon it

public get abstract saoEnabled: Boolean source

Gets if this Entity can have Scalable Ambient Obscurance (SAO) applied to it.

SAO is configured by SAO.

public set abstract selected: Boolean source

Sets if this Entity is selected.

When Entity#isObject and Entity#selected are both `true the Entity will be registered by Entity#id in Scene#selectedObjects.

public get abstract selected: Boolean source

Gets if this Entity is selected.

When Entity#isObject and Entity#selected are both `true the Entity will be registered by Entity#id in Scene#selectedObjects.

public set abstract visible: Boolean source

Sets if this Entity is visible.

Only rendered when Entity#visible is true and Entity#culled is false.

When Entity#isObject and Entity#visible are both true the Entity will be registered by Entity#id in Scene#visibleObjects.

public get abstract visible: Boolean source

Gets if this Entity is visible.

Only rendered when Entity#visible is true and Entity#culled is false.

When Entity#isObject and Entity#visible are both true the Entity will be registered by Entity#id in Scene#visibleObjects.

public set abstract xrayed: Boolean source

Sets if this Entity is xrayed.

When Entity#isObject and Entity#xrayed are both `true the Entity will be registered by Entity#id in Scene#xrayedObjects.

public get abstract xrayed: Boolean source

Gets if this Entity is xrayed.

When Entity#isObject and Entity#xrayed are both `true the Entity will be registered by Entity#id in Scene#xrayedObjects.

Public Methods

public destroy() source

Destroys this Entity.

public getEachVertex(callback: *) source

Gets the World, View and Canvas-space positions of each vertex in a callback.

Params:

NameTypeAttributeDescription
callback *