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 optionalOwner component. When destroyed, the owner will destroy this component as well. Creates this component within the default Scene when omitted.
-
[cfg]
optionalConfigs
-
[id]
String optionalOptional ID, unique among all components in the parent scene, generated automatically when omitted.
-
[meta]
String:Object optionalOptional map of user-defined metadata.
-
[entityType]
String optionalOptional entity classification when using within a semantic data model. See the Object documentation for usage.
-
[parent]
Object optionalThe parent.
-
[position=[0,0,0]
Float32Array optionalLocal 3D position.
-
[scale=[1,1,1]
Float32Array optionalLocal scale.
-
[rotation=[0,0,0]
Float32Array optionalLocal 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 optionalLocal modelling transform matrix. Overrides the position, scale and rotation parameters.
-
[visible=true]
Boolean optionalIndicates if visible.
-
[culled=false]
Boolean optionalIndicates if culled from view.
-
[pickable=true]
Boolean optionalIndicates if pickable.
-
[clippable=true]
Boolean optionalIndicates if clippable.
-
[collidable=true]
Boolean optionalIndicates if included in boundary calculations.
-
[castShadow=true]
Boolean optionalIndicates if casting shadows.
-
[receiveShadow=true]
Boolean optionalIndicates if receiving shadows.
-
[outlined=false]
Boolean optionalIndicates if outline is rendered.
-
[ghosted=false]
Boolean optionalIndicates if rendered as ghosted.
-
[highlighted=false]
Boolean optionalIndicates if rendered as highlighted.
-
[selected=false]
Boolean optionalIndicates if rendered as selected.
-
[edges=false]
Boolean optionalIndicates if edges are emphasized.
-
[aabbVisible=false]
Boolean optionalIndicates if axis-aligned World-space bounding box is visible.
-
[obbVisible=false]
Boolean optionalIndicates if oriented World-space bounding box is visible.
-
[colorize=[1.0,1.0,1.0]
Float32Array optionalRGB colorize color, multiplies by the rendered fragment colors.
-
[opacity=1.0]
Number optionalOpacity factor, multiplies by the rendered fragment alpha.
-
Index
Methods
- addMat4 static
- addMat4Scalar static
- addScalarMat4 static
- addVec3 static
- addVec4 static
- addVec4Scalar static
- addVec4Scalar static
- angleVec3
- canvasPosToLocalRay static
- canvasPosToWorldRay static
- clear
- create
- createUUID static
- cross3Vec3 static
- cross3Vec4 static
- destroy
- determinantMat4 static
- diagonalMat4c static
- diagonalMat4s static
- divScalarVec3 static
- divScalarVec4 static
- divVec3 static
- divVec3Scalar static
- divVec4 static
- divVec4Scalar static
- dotVec3 static
- dotVec4 static
- dotVec4 static
- dupMat4 static
- error
- fire
- flatten static
- fmod static
- frustumMat4v static
- frustumMat4v static
- hasSubs
- identityMat3 static
- identityMat4 static
- inverseMat4 static
- isIdentityMat4 static
- isType
- lenVec2 static
- lenVec3 static
- lenVec4 static
- lerpVec3 static
- log
- lookAtMat4c static
- lookAtMat4v
- m4s static
- mat3 static
- mat3ToMat4 static
- mat4 static
- mat4To3 static
- mat4ToMat3 static
- mulMat4 static
- mulMat4 static
- mulMat4Scalar static
- mulMat4v4 static
- mulVec2Scalar static
- mulVec3 static
- mulVec34calar static
- mulVec3Scalar static
- negateMat4 static
- negateVec4 static
- normalizeVec2 static
- normalizeVec4 static
- normalizeVec4 static
- off
- on
- once
- orthoMat4c static
- perspectiveMat4v static
- projectVec4 static
- rcpVec3 static
- removeChild
- removeChildren
- rotate
- rotateVec3X static
- rotateVec3Y static
- rotateVec3Z static
- rotateX
- rotateY
- rotateZ
- rotationMat4c static
- rotationMat4v static
- scaleMat4c
- scaleMat4c
- scalingMat3v static
- scalingMat4c static
- scalingMat4s static
- scalingMat4v static
- setMat4ToOnes static
- setMat4ToOnes static
- setMat4ToZeroes static
- subMat4 static
- subMat4Scalar static
- subScalarMat4 static
- subScalarVec4 static
- subVec2 static
- subVec3 static
- subVec4 static
- subVec4Scalar static
- traceMat4 static
- transformPoint3 static
- transformPoint3 static
- transformPoints3 static
- transformPositions3 static
- transformPositions4 static
- transformVec3 static
- transformVec4 static
- translate
- translateX
- translationMat3 static
- translationMat4 static
- translationMat4c static
- translationMat4s static
- transposeMat3 static
- transposeMat4 static
- unprojectVec3 static
- vec2 static
- vec3 static
- vec4 static
- warn
- worldRayToLocalRay static
Properties
- aabb
- aabbVisible
- castShadow
- center
- childIDs
- childMap
- children
- clippable
- collidable
- colorize
- components
- culled
- DEGTORAD
- destroyed
- edges
- entities
- entityIds
- entityType
- entityTypeIds
- entityTypeIds
- entityTypes
- ghosted
- guid
- guidObjects
- highlighted
- id
- matrix
- meshes
- metadata
- model
- numChildren
- numComponents
- objects
- opacity
- outlined
- parent
- pickable
- position
- quaternion
- RADTODEG
- receiveShadow
- rotation
- scale
- scene
- selected
- type
- types
- visible
- worldMatrix
- worldNormalMatrix
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]
Adds one three-element vector to another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Second vector
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
addVec4
-
u
-
v
-
[dest]
Adds one four-element vector to another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Second vector
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
addVec4Scalar
-
v
-
s
-
[dest]
Adds a scalar value to each element of a three-element vector.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
addVec4Scalar
-
v
-
s
-
[dest]
Adds a scalar value to each element of a four-element vector.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
angleVec3
-
v
-
w
Gets the angle between two vectors
Returns:
canvasPosToLocalRay
-
camera
-
mesh
-
canvasPos
-
localRayOrigin
-
localRayDir
Transforms a Canvas-space position to a Mesh's Local-space coordinate system, in the context of a Camera.
canvasPosToWorldRay
-
camera
-
canvasPos
-
worldRayOrigin
-
worldRayDir
Transforms a Canvas-space position into a World-space ray, in the context of a Camera.
Parameters:
-
camera
CameraThe Camera.
-
canvasPos
Float32ArrayThe Canvas-space position.
-
worldRayOrigin
Float32ArrayThe World-space ray origin.
-
worldRayDir
Float32ArrayThe World-space ray direction.
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]
optionalConfiguration for the component instance.
Returns:
createUUID
()
static
Returns a new UUID.
Returns:
string The new UUID
cross3Vec3
-
u
-
v
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
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
Divides a scalar by a three-element vector, returning a new vector.
Returns:
[] dest if specified, v otherwise
divScalarVec4
-
s
-
v
-
dest
Divides a scalar by a four-element vector, returning a new vector.
Returns:
[] dest if specified, v otherwise
divVec3
-
u
-
v
-
[dest]
Divides one three-element vector by another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Second vector
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
divVec3Scalar
-
v
-
s
-
dest
Divides a three-element vector by a scalar.
Returns:
[] dest if specified, v otherwise
divVec4
-
u
-
v
-
[dest]
Divides one four-element vector by another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Second vector
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
divVec4Scalar
-
v
-
s
-
dest
Divides a four-element vector by a scalar.
Returns:
[] dest if specified, v otherwise
dotVec3
-
u
-
v
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
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
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
StringThe 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
StringThe event type name
-
value
ObjectThe event parameters
-
[forget=false]
Boolean optionalWhen true, does not retain for subsequent subscribers
flatten
-
a
Flattens a two-dimensional array into a one-dimensional array.
Parameters:
-
a
Array of ArraysA 2D array
Returns:
Flattened 1D array
fmod
-
a
-
b
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
Returns true if there are any subscribers to the given event on this component.
Parameters:
-
event
StringThe event
Returns:
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
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 | FunctionComponent type to compare with, eg "xeogl.PhongMaterial", or a xeogl component constructor.
Returns:
True if this component is of given type or is subclass of the given type.
lenVec2
-
v
Returns the length of a two-element vector.
Parameters:
-
v
Array(Number)The vector
Returns:
The length
lenVec3
-
v
Returns the length of a three-element vector.
Parameters:
-
v
Array(Number)The vector
Returns:
The length
lenVec4
-
v
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>
Parameters:
-
message
StringThe message to log
lookAtMat4c
()
static
Returns a 4x4 'lookat' viewing transform matrix.
lookAtMat4v
-
pos
-
target
-
up
-
dest
Returns a 4x4 'lookat' viewing transform matrix.
Parameters:
Returns:
dest if specified, a new mat4 otherwise
m4s
()
static
Returns a 4x4 matrix with each element set to the given scalar value.
mat3
-
[values]
Returns a new, uninitialized 3x3 matrix.
Parameters:
-
[values]
Object optionalInitial values.
Returns:
mat3ToMat4
-
mat3
-
mat4
Converts a 3x3 matrix to 4x4
Returns:
mat4
-
[values]
Returns a new, uninitialized 4x4 matrix.
Parameters:
-
[values]
Object optionalInitial values.
Returns:
mat4To3
()
static
Extracts a 3x3 matrix from a 4x4 matrix.
mat4ToMat3
-
mat4
-
mat3
Converts a 4x4 matrix to 3x3
Returns:
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]
Multiplies each element of a two-element vector by a scalar.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
mulVec3
-
u
-
v
-
[dest]
Multiplies one three-element vector by another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Second vector
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
mulVec34calar
-
v
-
s
-
[dest]
Multiplies each element of a four-element vector by a scalar.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
mulVec3Scalar
-
v
-
s
-
[dest]
Multiplies each element of a three-element vector by a scalar.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
negateMat4
()
static
Negates the given 4x4 matrix.
negateVec4
-
v
-
[dest]
Negates a four-element vector.
Parameters:
-
v
Array(Number)Vector to negate
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
normalizeVec2
()
static
Normalizes a two-element vector
normalizeVec4
-
v
-
dest
Normalizes a four-element vector
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
StringPublication subId
on
-
event
-
callback
-
[scope=this]
Subscribes to an event on this component.
The callback is be called with this component as scope.
Parameters:
-
event
StringThe event
-
callback
FunctionCalled fired on the event
-
[scope=this]
Object optionalScope for the callback
Returns:
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
StringData event to listen to
-
callback
Function(data)Called when fresh data is available at the event
-
[scope=this]
Object optionalScope for the callback
orthoMat4c
()
static
Returns a 4x4 orthographic projection matrix.
perspectiveMat4v
()
static
Returns a 4x4 perspective projection matrix.
projectVec4
-
p
-
q
Transforms a four-element vector by a 4x4 projection matrix.
Parameters:
-
p
Float32Array3D View-space coordinate
-
q
Float32Array2D Projected coordinate
Returns:
2D Projected coordinate
rcpVec3
-
v
-
dest
Returns:
[] dest if specified, v otherwise
removeChildren
()
Removes all children.
rotate
-
angle
Rotates about the given local axis by the given increment.
Parameters:
-
angle
NumberAngle increment in degrees.
rotateVec3X
-
a
-
b
-
c
-
dest
Rotate a 3D vector around the x-axis
Parameters:
-
a
Float32ArrayThe vec3 point to rotate
-
b
Float32ArrayThe origin of the rotation
-
c
NumberThe angle of rotation
-
dest
Float32ArrayThe receiving vec3
Returns:
dest
rotateVec3Y
-
a
-
b
-
c
-
dest
Rotate a 3D vector around the y-axis
Parameters:
-
a
Float32ArrayThe vec3 point to rotate
-
b
Float32ArrayThe origin of the rotation
-
c
NumberThe angle of rotation
-
dest
Float32ArrayThe receiving vec3
Returns:
dest
rotateVec3Z
-
a
-
b
-
c
-
dest
Rotate a 3D vector around the z-axis
Parameters:
-
a
Float32ArrayThe vec3 point to rotate
-
b
Float32ArrayThe origin of the rotation
-
c
NumberThe angle of rotation
-
dest
Float32ArrayThe receiving vec3
Returns:
dest
rotateX
-
angle
Rotates about the local X-axis by the given increment.
Parameters:
-
angle
NumberAngle increment in degrees.
rotateY
-
angle
Rotates about the local Y-axis by the given increment.
Parameters:
-
angle
NumberAngle increment in degrees.
rotateZ
-
angle
Rotates about the local Z-axis by the given increment.
Parameters:
-
angle
NumberAngle 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.
scaleMat4c
-
x
-
y
-
z
-
m
Efficiently post-concatenates a scaling to the given matrix.
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]
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
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
subVec2
-
u
-
v
-
[dest]
Subtracts one two-element vector from another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Vector to subtract
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
subVec3
-
u
-
v
-
[dest]
Subtracts one three-element vector from another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Vector to subtract
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
subVec4
-
u
-
v
-
[dest]
Subtracts one four-element vector from another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Vector to subtract
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
subVec4Scalar
-
v
-
s
-
[dest]
Subtracts a scalar value from each element of a four-element vector.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
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
Float32ArrayNormalized local space 3D vector along which to translate.
-
distance
NumberDistance to translate along the vector.
translateX
-
distance
Translates along the local X-axis by the given increment.
Parameters:
-
distance
NumberDistance 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
Unprojects a three-element vector.
Parameters:
-
p
Float32Array3D Projected coordinate
-
viewMat
Float32ArrayView matrix
Returns:
projMat Projection matrix
vec2
-
[values]
Returns a new, uninitialized two-element vector.
Parameters:
-
[values]
Object optionalInitial values.
Returns:
vec3
-
[values]
Returns a new, uninitialized three-element vector.
Parameters:
-
[values]
Object optionalInitial values.
Returns:
vec4
-
[values]
Returns a new, uninitialized four-element vector.
Parameters:
-
[values]
Object optionalInitial values.
Returns:
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>
Parameters:
-
message
StringThe message to log
worldRayToLocalRay
-
mesh
-
worldRayOrigin
-
worldRayDir
-
localRayOrigin
-
localRayDir
Transforms a ray from World-space to a Mesh's Local-space coordinate system.
Parameters:
-
mesh
MeshThe Mesh.
-
worldRayOrigin
Float32ArrayThe World-space ray origin.
-
worldRayDir
Float32ArrayThe World-space ray direction.
-
localRayOrigin
Float32ArrayThe Local-space ray origin.
-
localRayDir
Float32ArrayThe 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.
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
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.
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
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
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
matrix
Float32Array
Local matrix.
Default: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
model
Model
final
The Model which contains this Component, if any.
Will be null if this Component is not in a Model.
numComponents
Number
Number of contained Components.
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]
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}
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.