API Docs for:

Model

A Model is a Group of Components.

Model is an abstract base class that's subclassed by (at least):

  • GLTFModel, which loads its components from glTF files.
  • OBJModel, which loads its components from .OBJ and .MTL files.
  • STLModel, which loads its components from .STL files.
  • SceneJSModel, which loads its components from SceneJS scene definitions.
  • BuildableModel, which provides a fluent API for building its components.

Constructor

Model

(
  • [owner]
  • [cfg]
)

Parameters:

  • [owner] Component optional

    Owner component. When destroyed, the owner will destroy this component as well. Creates this component within the default Scene when omitted.

  • [cfg] optional

    Configs

    • [id] String optional

      Optional ID, unique among all components in the parent scene, generated automatically when omitted.

    • [meta] String:Object optional

      Optional map of user-defined metadata.

    • [entityType] String optional

      Optional entity classification when using within a semantic data model. See the Object documentation for usage.

    • [parent] Object optional

      The parent.

    • [position=[0,0,0] Float32Array optional

      Local 3D position.

    • [scale=[1,1,1] Float32Array optional

      Local scale.

    • [rotation=[0,0,0] Float32Array optional

      Local rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.

    • [matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] Float32Array optional

      Local modelling transform matrix. Overrides the position, scale and rotation parameters.

    • [visible=true] Boolean optional

      Indicates if visible.

    • [culled=false] Boolean optional

      Indicates if culled from view.

    • [pickable=true] Boolean optional

      Indicates if pickable.

    • [clippable=true] Boolean optional

      Indicates if clippable.

    • [collidable=true] Boolean optional

      Indicates if included in boundary calculations.

    • [castShadow=true] Boolean optional

      Indicates if casting shadows.

    • [receiveShadow=true] Boolean optional

      Indicates if receiving shadows.

    • [outlined=false] Boolean optional

      Indicates if outline is rendered.

    • [ghosted=false] Boolean optional

      Indicates if rendered as ghosted.

    • [highlighted=false] Boolean optional

      Indicates if rendered as highlighted.

    • [selected=false] Boolean optional

      Indicates if rendered as selected.

    • [edges=false] Boolean optional

      Indicates if edges are emphasized.

    • [aabbVisible=false] Boolean optional

      Indicates if axis-aligned World-space bounding box is visible.

    • [obbVisible=false] Boolean optional

      Indicates if oriented World-space bounding box is visible.

    • [colorize=[1.0,1.0,1.0] Float32Array optional

      RGB colorize color, multiplies by the rendered fragment colors.

    • [opacity=1.0] Number optional

      Opacity factor, multiplies by the rendered fragment alpha.

Index

Methods

Events

Methods

addMat4

() static

Adds the given 4x4 matrices together.

addMat4Scalar

() static

Adds the given scalar to each element of the given 4x4 matrix.

addScalarMat4

() static

Adds the given scalar to each element of the given 4x4 matrix.

addVec3

(
  • u
  • v
  • [dest]
)
Array(Number) static

Adds one three-element vector to another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

addVec4

(
  • u
  • v
  • [dest]
)
Array(Number) static

Adds one four-element vector to another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

addVec4Scalar

(
  • v
  • s
  • [dest]
)
Array(Number) static

Adds a scalar value to each element of a three-element vector.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

addVec4Scalar

(
  • v
  • s
  • [dest]
)
Array(Number) static

Adds a scalar value to each element of a four-element vector.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

angleVec3

(
  • v
  • w
)
Number

Gets the angle between two vectors

Parameters:

Returns:

Number:

canvasPosToLocalRay

(
  • camera
  • mesh
  • canvasPos
  • localRayOrigin
  • localRayDir
)
static

Transforms a Canvas-space position to a Mesh's Local-space coordinate system, in the context of a Camera.

Parameters:

  • camera Camera

    The Camera.

  • mesh Mesh

    The Mesh.

  • canvasPos Float32Array

    The Canvas-space position.

  • localRayOrigin Float32Array

    The Local-space ray origin.

  • localRayDir Float32Array

    The Local-space ray direction.

canvasPosToWorldRay

(
  • camera
  • canvasPos
  • worldRayOrigin
  • worldRayDir
)
static

Transforms a Canvas-space position into a World-space ray, in the context of a Camera.

Parameters:

  • camera Camera

    The Camera.

  • canvasPos Float32Array

    The Canvas-space position.

  • worldRayOrigin Float32Array

    The World-space ray origin.

  • worldRayDir Float32Array

    The World-space ray direction.

clear

()

Destroys all Components in this Model.

create

(
  • [cfg]
)

Convenience method for creating a Component within this Component's Scene.

The method is given a component configuration, like so:

var material = myComponent.create({
     type: "xeogl.PhongMaterial",
     diffuse: [1,0,0],
     specular: [1,1,0]
}, "myMaterial");

Parameters:

  • [cfg] optional

    Configuration for the component instance.

Returns:

:

createUUID

() static

Returns a new UUID.

Returns:

string The new UUID

cross3Vec3

(
  • u
  • v
)
static

Returns the cross product of two three-element vectors.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

Returns:

The cross product

cross3Vec4

(
  • u
  • v
)
static

Returns the cross product of two four-element vectors.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

Returns:

The cross product

destroy

()

Destroys this component.

Fires a destroyed event on this Component.

Automatically disassociates this component from other components, causing them to fall back on any defaults that this component overrode on them.

TODO: describe effect with respect to #create

determinantMat4

() static

Returns the determinant of the given 4x4 matrix.

diagonalMat4c

() static

Returns a 4x4 matrix with diagonal elements set to the given vector.

diagonalMat4s

() static

Returns a 4x4 matrix with diagonal elements set to the given scalar.

divScalarVec3

(
  • v
  • s
  • dest
)
static

Divides a scalar by a three-element vector, returning a new vector.

Parameters:

Returns:

[] dest if specified, v otherwise

divScalarVec4

(
  • s
  • v
  • dest
)
static

Divides a scalar by a four-element vector, returning a new vector.

Parameters:

Returns:

[] dest if specified, v otherwise

divVec3

(
  • u
  • v
  • [dest]
)
Array(Number) static

Divides one three-element vector by another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

divVec3Scalar

(
  • v
  • s
  • dest
)
static

Divides a three-element vector by a scalar.

Parameters:

Returns:

[] dest if specified, v otherwise

divVec4

(
  • u
  • v
  • [dest]
)
Array(Number) static

Divides one four-element vector by another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

divVec4Scalar

(
  • v
  • s
  • dest
)
static

Divides a four-element vector by a scalar.

Parameters:

Returns:

[] dest if specified, v otherwise

dotVec3

(
  • u
  • v
)
static

Returns the dot product of two three-element vectors.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

Returns:

The dot product

dotVec4

(
  • u
  • v
)
static

Returns the dot product of two four-element vectors.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

Returns:

The dot product

dotVec4

(
  • u
  • v
)
static

Returns the dot product of two two-element vectors.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

Returns:

The dot product

dupMat4

() static

Duplicates a 4x4 identity matrix.

error

(
  • message
)

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

fire

(
  • event
  • value
  • [forget=false]
)

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 Object

    The event parameters

  • [forget=false] Boolean optional

    When true, does not retain for subsequent subscribers

flatten

(
  • a
)
static

Flattens a two-dimensional array into a one-dimensional array.

Parameters:

  • a Array of Arrays

    A 2D array

Returns:

Flattened 1D array

fmod

(
  • a
  • b
)
static

Floating-point modulus

Parameters:

  • a Number
  • b Number

Returns:

:

frustumMat4v

() static

Returns a 4x4 perspective projection matrix.

frustumMat4v

() static

Returns a 4x4 perspective projection matrix.

hasSubs

(
  • event
)
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.

identityMat3

() static

Returns a 3x3 identity matrix.

identityMat4

() static

Returns a 4x4 identity matrix.

inverseMat4

() static

Returns the inverse of the given 4x4 matrix.

isIdentityMat4

() static

Tests if the given 4x4 matrix is the identity matrix.

isType

(
  • type
)
Boolean

Tests if this component is of the given type, or is a subclass of the given type.

The type may be given as either a string or a component constructor.

This method works by walking up the inheritance type chain, which this component provides in property Component/superTypes:property, returning true as soon as one of the type strings in the chain matches the given type, of false if none match.

Examples:

var myRotate = new xeogl.Rotate({ ... });

myRotate.isType(xeogl.Component); // Returns true for all xeogl components
myRotate.isType("xeogl.Component"); // Returns true for all xeogl components
myRotate.isType(xeogl.Rotate); // Returns true
myRotate.isType(xeogl.Transform); // Returns true
myRotate.isType("xeogl.Transform"); // Returns true
myRotate.isType(xeogl.Mesh); // Returns false, because xeogl.Rotate does not (even indirectly) extend xeogl.Mesh

Parameters:

  • type String | Function

    Component type to compare with, eg "xeogl.PhongMaterial", or a xeogl component constructor.

Returns:

Boolean:

True if this component is of given type or is subclass of the given type.

lenVec2

(
  • v
)
static

Returns the length of a two-element vector.

Parameters:

  • v Array(Number)

    The vector

Returns:

The length

lenVec3

(
  • v
)
static

Returns the length of a three-element vector.

Parameters:

  • v Array(Number)

    The vector

Returns:

The length

lenVec4

(
  • v
)
static

Returns the length of a four-element vector.

Parameters:

  • v Array(Number)

    The vector

Returns:

The length

lerpVec3

() static

Linearly interpolates between two 3D vectors.

log

(
  • message
)

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

lookAtMat4c

() static

Returns a 4x4 'lookat' viewing transform matrix.

lookAtMat4v

(
  • pos
  • target
  • up
  • dest
)
Mat4

Returns a 4x4 'lookat' viewing transform matrix.

Parameters:

  • pos Object

    vec3 position of the viewer

  • target Object

    vec3 point the viewer is looking at

  • up Object

    vec3 pointing "up"

  • dest Object

    mat4 Optional, mat4 matrix will be written into

Returns:

Mat4:

dest if specified, a new mat4 otherwise

m4s

() static

Returns a 4x4 matrix with each element set to the given scalar value.

mat3

(
  • [values]
)
Float32Array static

Returns a new, uninitialized 3x3 matrix.

Parameters:

  • [values] Object optional

    Initial values.

Returns:

Float32Array:

mat3ToMat4

(
  • mat3
  • mat4
)
Float32Array static

Converts a 3x3 matrix to 4x4

Parameters:

Returns:

Float32Array:

mat4

(
  • [values]
)
Float32Array static

Returns a new, uninitialized 4x4 matrix.

Parameters:

  • [values] Object optional

    Initial values.

Returns:

Float32Array:

mat4To3

() static

Extracts a 3x3 matrix from a 4x4 matrix.

mat4ToMat3

(
  • mat4
  • mat3
)
Float32Array static

Converts a 4x4 matrix to 3x3

Parameters:

Returns:

Float32Array:

mulMat4

() static

Multiplies the two given 3x3 matrices by each other.

mulMat4

() static

Multiplies the two given 4x4 matrix by each other.

mulMat4Scalar

() static

Multiplies each element of the given 4x4 matrix by the given scalar.

mulMat4v4

() static

Multiplies the given 4x4 matrix by the given four-element vector.

mulVec2Scalar

(
  • v
  • s
  • [dest]
)
Array(Number) static

Multiplies each element of a two-element vector by a scalar.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

mulVec3

(
  • u
  • v
  • [dest]
)
Array(Number) static

Multiplies one three-element vector by another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

mulVec34calar

(
  • v
  • s
  • [dest]
)
Array(Number) static

Multiplies each element of a four-element vector by a scalar.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

mulVec3Scalar

(
  • v
  • s
  • [dest]
)
Array(Number) static

Multiplies each element of a three-element vector by a scalar.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

negateMat4

() static

Negates the given 4x4 matrix.

negateVec4

(
  • v
  • [dest]
)
Array(Number) static

Negates a four-element vector.

Parameters:

  • v Array(Number)

    Vector to negate

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

normalizeVec2

() static

Normalizes a two-element vector

normalizeVec4

(
  • v
  • dest
)
static

Normalizes a four-element vector

Parameters:

Returns:

[] dest if specified, v otherwise

normalizeVec4

() static

Normalizes a three-element vector

off

(
  • subId
)

Cancels an event subscription that was previously made with Component#on() or Component#once().

Parameters:

  • subId String

    Publication subId

on

(
  • event
  • callback
  • [scope=this]
)
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

  • [scope=this] Object optional

    Scope for the callback

Returns:

String:

Handle to the subscription, which may be used to unsubscribe with {@link #off}.

once

(
  • event
  • callback
  • [scope=this]
)

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(data)

    Called when fresh data is available at the event

  • [scope=this] Object optional

    Scope for the callback

orthoMat4c

() static

Returns a 4x4 orthographic projection matrix.

perspectiveMat4v

() static

Returns a 4x4 perspective projection matrix.

projectVec4

(
  • p
  • q
)
Float32Array static

Transforms a four-element vector by a 4x4 projection matrix.

Parameters:

  • p Float32Array

    3D View-space coordinate

  • q Float32Array

    2D Projected coordinate

Returns:

Float32Array:

2D Projected coordinate

rcpVec3

(
  • v
  • dest
)
static

Parameters:

Returns:

[] dest if specified, v otherwise

removeChild

(
  • object
)

Removes the given child.

Parameters:

  • object Object

    Child to remove.

removeChildren

()

Removes all children.

rotate

(
  • angle
)

Rotates about the given local axis by the given increment.

Parameters:

  • angle Number

    Angle increment in degrees.

rotateVec3X

(
  • a
  • b
  • c
  • dest
)
Float32Array static

Rotate a 3D vector around the x-axis

Parameters:

  • a Float32Array

    The vec3 point to rotate

  • b Float32Array

    The origin of the rotation

  • c Number

    The angle of rotation

  • dest Float32Array

    The receiving vec3

Returns:

Float32Array:

dest

rotateVec3Y

(
  • a
  • b
  • c
  • dest
)
Float32Array static

Rotate a 3D vector around the y-axis

Parameters:

  • a Float32Array

    The vec3 point to rotate

  • b Float32Array

    The origin of the rotation

  • c Number

    The angle of rotation

  • dest Float32Array

    The receiving vec3

Returns:

Float32Array:

dest

rotateVec3Z

(
  • a
  • b
  • c
  • dest
)
Float32Array static

Rotate a 3D vector around the z-axis

Parameters:

  • a Float32Array

    The vec3 point to rotate

  • b Float32Array

    The origin of the rotation

  • c Number

    The angle of rotation

  • dest Float32Array

    The receiving vec3

Returns:

Float32Array:

dest

rotateX

(
  • angle
)

Rotates about the local X-axis by the given increment.

Parameters:

  • angle Number

    Angle increment in degrees.

rotateY

(
  • angle
)

Rotates about the local Y-axis by the given increment.

Parameters:

  • angle Number

    Angle increment in degrees.

rotateZ

(
  • angle
)

Rotates about the local Z-axis by the given increment.

Parameters:

  • angle Number

    Angle increment in degrees.

rotationMat4c

() static

Returns 4x4 rotation matrix.

rotationMat4v

() static

Returns 4x4 rotation matrix.

scaleMat4c

(
  • xyz
  • m
)

Efficiently post-concatenates a scaling to the given matrix.

Parameters:

scaleMat4c

(
  • x
  • y
  • z
  • m
)

Efficiently post-concatenates a scaling to the given matrix.

Parameters:

scalingMat3v

() static

Returns 3x3 scale matrix.

scalingMat4c

() static

Returns 4x4 scale matrix.

scalingMat4s

() static

Returns 4x4 scale matrix.

scalingMat4v

() static

Returns 4x4 scale matrix.

setMat4ToOnes

() static

Returns a 4x4 matrix with each element set to 1.0.

setMat4ToOnes

() static

Returns a 4x4 matrix with each element set to 1.0.

setMat4ToZeroes

() static

Returns a 4x4 matrix with each element set to zero.

subMat4

() static

Subtracts the second 4x4 matrix from the first.

subMat4Scalar

() static

Subtracts the given scalar from each element of the given 4x4 matrix.

subScalarMat4

() static

Subtracts the given scalar from each element of the given 4x4 matrix.

subScalarVec4

(
  • v
  • s
  • [dest]
)
Array(Number) static

Sets each element of a 4-element vector to a scalar value minus the value of that element.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

subVec2

(
  • u
  • v
  • [dest]
)
Array(Number) static

Subtracts one two-element vector from another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Vector to subtract

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

subVec3

(
  • u
  • v
  • [dest]
)
Array(Number) static

Subtracts one three-element vector from another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Vector to subtract

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

subVec4

(
  • u
  • v
  • [dest]
)
Array(Number) static

Subtracts one four-element vector from another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Vector to subtract

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

subVec4Scalar

(
  • v
  • s
  • [dest]
)
Array(Number) static

Subtracts a scalar value from each element of a four-element vector.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

traceMat4

() static

Returns the trace of the given 4x4 matrix.

transformPoint3

() static

Transforms a three-element position by a 4x4 matrix.

transformPoint3

() static

Transforms a homogeneous coordinate by a 4x4 matrix.

transformPoints3

() static

Transforms an array of three-element positions by a 4x4 matrix.

transformPositions3

() static

Transforms an array of positions by a 4x4 matrix.

transformPositions4

() static

Transforms an array of positions by a 4x4 matrix.

transformVec3

() static

Transforms a three-element vector by a 4x4 matrix.

transformVec4

() static

Transforms a four-element vector by a 4x4 matrix.

translate

(
  • axis
  • distance
)

Translates along local space vector by the given increment.

Parameters:

  • axis Float32Array

    Normalized local space 3D vector along which to translate.

  • distance Number

    Distance to translate along the vector.

translateX

(
  • distance
)

Translates along the local X-axis by the given increment.

Parameters:

  • distance Number

    Distance to translate along the X-axis.

translationMat3

() static

Returns 3x3 translation matrix.

translationMat4

() static

Returns 4x4 translation matrix.

translationMat4c

() static

Returns 4x4 translation matrix.

translationMat4s

() static

Returns 4x4 translation matrix.

transposeMat3

() static

Transposes the given 3x3 matrix.

transposeMat4

() static

Transposes the given 4x4 matrix.

unprojectVec3

(
  • p
  • viewMat
)
Float32Array static

Unprojects a three-element vector.

Parameters:

  • p Float32Array

    3D Projected coordinate

  • viewMat Float32Array

    View matrix

Returns:

Float32Array:

projMat Projection matrix

vec2

(
  • [values]
)
Float32Array static

Returns a new, uninitialized two-element vector.

Parameters:

  • [values] Object optional

    Initial values.

Returns:

Float32Array:

vec3

(
  • [values]
)
Float32Array static

Returns a new, uninitialized three-element vector.

Parameters:

  • [values] Object optional

    Initial values.

Returns:

Float32Array:

vec4

(
  • [values]
)
Float32Array static

Returns a new, uninitialized four-element vector.

Parameters:

  • [values] Object optional

    Initial values.

Returns:

Float32Array:

warn

(
  • message
)

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

worldRayToLocalRay

(
  • mesh
  • worldRayOrigin
  • worldRayDir
  • localRayOrigin
  • localRayDir
)
static

Transforms a ray from World-space to a Mesh's Local-space coordinate system.

Parameters:

  • mesh Mesh

    The Mesh.

  • worldRayOrigin Float32Array

    The World-space ray origin.

  • worldRayDir Float32Array

    The World-space ray direction.

  • localRayOrigin Float32Array

    The Local-space ray origin.

  • localRayDir Float32Array

    The Local-space ray direction.

Properties

aabb

Float32Array final

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

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

aabbVisible

Boolean

Indicates if the 3D World-space axis-aligned bounding box (AABB) is visible.

Default: false

castShadow

Boolean

Indicates if casting shadows.

Default: true

center

Float32Array final

World-space 3D center.

childIDs

Array final

IDs of child Objects.

childMap

final

Child Objects mapped to their IDs.

children

Array final

Array of child Objects.

clippable

Boolean

Indicates if clippable.

Clipping is done by the Scene's Clips component.

Default: true

collidable

Boolean

Indicates if included in boundary calculations.

Default: true

colorize

Float32Array

RGB colorize color, multiplies by the rendered fragment color.

Default: [1.0, 1.0, 1.0]

components

String:Component

All contained Components, mapped to their IDs.

culled

Boolean

Indicates if culled from view.

Only rendered when visible is true and culled is false.

Default: false

DEGTORAD

Number

The number of radiians in a degree (0.0174532925).

destroyed

Boolean

True as soon as this Component has been destroyed

edges

Boolean

Indicates if edges are emphasized.

Default: false

entities

String:Object final

Objects in this Model that have entity types, mapped to their IDs.

Each Object is registered in this map when its entityType is set to value.

entityIds

Array of String final

Convenience array of IDs in entities.

entityType

String final

Optional entity classification when using within a semantic data model.

See the Object documentation on "Applying a semantic data model" for usage.

Default: null

entityTypeIds

Array of String final

Convenience array of entity type IDs in entityTypes.

entityTypeIds

Array of String final

Convenience array of entity type IDs in entityTypes.

entityTypes

String:{String:xeogl.Component} final

For each entity type, a map of IDs to Objects of that entity type.

Each Object is registered in this map when its entityType is assigned a value.

ghosted

Boolean

Indicates if ghosted.

Each ghosted Object is registered in its Scene's ghostedEntities map while its entityType is set to a value.

Default: false

guid

String final

Globally unique identifier.

This is unique not only within the Scene, but throughout the entire universe.

Only defined when given to the constructor.

guidObjects

String:Object final

Objects in this Model that have GUIDs, mapped to their GUIDs.

Each Object is registered in this map when its guid is assigned a value.

highlighted

Boolean

Indicates if highlighted.

Each highlighted Object is registered in its Scene's highlightedEntities map while its entityType is set to a value.

Default: false

id

String final

Unique ID for this Component within its parent Scene.

matrix

Float32Array

Local matrix.

Default: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]

meshes

String:xeogl.Mesh final

All contained Meshes, mapped to their IDs.

metadata

Object

Arbitrary, user-defined metadata on this component.

model

Model final

The Model which contains this Component, if any.

Will be null if this Component is not in a Model.

numChildren

Number final

Number of child Objects.

numComponents

Number

Number of contained Components.

objects

String:Object final

All contained Objects, mapped to their IDs.

opacity

Number

Opacity factor, multiplies by the rendered fragment alpha.

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

Default: 1.0

outlined

Boolean

Indicates if outlined.

Default: false

parent

Group

The parent.

The parent Group may also be set by passing the Object to the Group/Model's Group/addChild:method method.

pickable

Boolean

Whether or not to allow picking.

Picking is done via calls to Scene#pick().

Default: true

position

Float32Array

Local translation.

Default: [0,0,0]

quaternion

Float32Array

Local rotation quaternion.

Default: [0,0,0, 1]

RADTODEG

Number

The number of degrees in a radian.

receiveShadow

Boolean

Indicates if receiving shadows.

Default: true

rotation

Float32Array

Local rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.

Default: [0,0,0]

scale

Float32Array

Local scale.

Default: [1,1,1]

scene

Scene final

The parent Scene that contains this Component.

selected

Boolean

Indicates if selected.

Each selected Object is registered in its Scene's selectedEntities map while its entityType is set to a value.

Default: false

type

String final

JavaScript class name for this Component.

For example: "xeogl.AmbientLight", "xeogl.MetallicMaterial" etc.

types

String:{String:xeogl.Component}

A map of maps; for each contained Component type, a map to IDs to Component instances, eg.

"xeogl.Geometry": {
       "alpha": <xeogl.Geometry>,
       "beta": <xeogl.Geometry>
     },
"xeogl.Rotate": {
       "charlie": <xeogl.Rotate>,
       "delta": <xeogl.Rotate>,
       "echo": <xeogl.Rotate>,
     },
//...

visible

Boolean

Indicates if visible.

Only rendered when visible is true and culled is false.

Each visible Object is registered in its Scene's visibleEntities map while its entityType is set to a value.

Default: true

worldMatrix

Float32Array

The World matrix.

worldNormalMatrix

Float32Array

This World normal matrix.

Default: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]

Events

destroyed

Fired when this Component is destroyed.