Methods
claraplayer(elOrId, options) → {API}
The main function. This function initializes the player for a given DOM Node.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
elOrId |
String | DOMNode | the DOM Node or String id of a DOM Node. |
||||||
options |
Object |
Properties
|
Returns:
The clara playera API.
- Type
- API
Type Definitions
Animation
The Dynamic animation object.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
name |
String | A name for the animation |
iterations |
Number | Number of iterations (use |
start |
Number | Start time of animation (default |
easing |
String | Easing type of the animation |
easingDuration |
Number | Amount of time in milliseconds to ease in the animation (default 0) |
autoplay |
Boolean | If set and we are not currently animating anything, will start animations playing immediately (default false). |
playSpeed |
Number | How fast the animation should play. Use negative numbers to play in reverse. (default 1). |
tracks |
Array.<Track> | Track list |
Annotation
The annotation object, for displaying custom annotations.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
id |
String | The id of the annotation node. |
top |
Number | The number of pixels from the top |
bottom |
Number | The number of pixels from the bottom |
left |
Number | The number of pixels from the left |
right |
Number | The number of pixels from the right |
text |
String | The annotation text (node name or custom text). |
visibile |
Boolean | Is the annotation visible. |
alpha |
Number | The opacity of the annotation as requested by limit visibility and camera position. |
position |
Vector3 | For advanced use, the 3d position of the annotation |
normal |
Vector3 | For advanced use, the normal vector |
API
The API for the clara player. This is an Object
that contains:
- the event emitter
- A
deps
key that exposes some of the player's dependencies for use externally - The available modules, which namespace the actions and selectors.
Type:
- Object
- Mixes In:
- eventEmitter
deps
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
THREE |
Object | The three.js version used by the player. |
h |
function | The DOM helper library used by |
patch |
function | The patch function used by |
Node
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
id |
String | An optional id for the node |
name |
String | The node name |
type |
String | The node type. |
parent |
String | The id of the parent node. |
plugs |
Object.<string.Plug> | Optional operator data. |
QueryObject
The query object, used for filtering and finding within the scene graph.
If only id and/or name are specified, the query will return nodes. If a plug is specified,
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
from |
String | QueryObject | Path |
<nullable> |
The root node to search from, defaults to the active scene node. |
id |
String |
<nullable> |
The id of the node. |
child |
String |
<nullable> |
If you can ask for an id, you can ask for a specific child of that node (by type). |
parent |
Boolean |
<nullable> |
If true, will return the parent id of the matched node. (Note: This is only valid for id queries) |
name |
String | RegExp |
<nullable> |
The name of the node, or a RegExp that will match |
type |
String |
<nullable> |
The type of the node |
plug |
String |
<nullable> |
If provided, will only match nodes with this plug |
operatorIndex |
Integer |
<nullable> |
The index of the operator to include in the path |
property |
String |
<nullable> |
The property to use in path, will match the first operator with this property. |
properties |
Object |
<nullable> |
Will match operators that that match the provided value. |
shallow |
Boolean |
<nullable> |
If true, will match only direct children of the |
includeParent |
Boolean |
<nullable> |
If true, will include |
Track
The Track animation object.
The track may have keyframes
defined, in which case the track will interpolate over the keyframes, or it
may have value
defined, in which case it will interpolate to the value
.
Available easing Functions:
linear
,
easeInQuad
, easeOutQuad
, easeInOutQuad
,
easeInCubic
, easeOutCubic
, easeInOutCubic
,
easeInQuart
, easeOutQuart
, easeInOutQuart
,
easeInQuint
, easeOutQuint
, easeInOutQuint
,
easeInExpo
, easeOutExpo
, easeInOutExpo
,
easeInCirc
, easeOutCirc
, easeInOutCirc
,
easeInElastic
, easeOutElastic
, easeInOutElastic
,
easeInBack
, easeOutBack
, easeInOutBack
,
easeInBounce
, easeOutBounce
, easeInOutBounce
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
path |
Array.<String> | Path to the key being modified. |
|
value |
Any | The end value to animate to (required for non keyframe animations). |
|
start |
Number | Start time of the track (offset from the start of the animation, default 0). |
|
duration |
Number | Duration of the track in milliseconds. (default 0, ignored for keyframes) |
|
type |
String | Type of property being animated ('Number','Vec3','Color') |
|
easing |
String | Easing function to use (default 'linear'). |
|
tween |
function |
<optional> |
If specified, will be used as a custom tween function for the property. |
set |
function |
<optional> |
This lets you animate properties that are not part of the scene graph. |
Events
loaded
Emitted when the scene and all assets necessary to render the scene have been loaded.
loading
Emitted while the scene is loading, with a progress value from 0 to 1.
preloaded
Emitted when the scene and all assets necessary to render the scene have been loaded. Occurs before the 'loaded' event, and is an opportunity to modify the scene before it becomes visible.
rendered
Emitted when the scene has been fully rendered.
renderingMode
Emitted when render mode changes between vr, normal and lenticular.
threeinitialized
Emitted when three.js has been loaded and initialized