Constructor
new KinematicsManager()
Methods
(static) addAnimationGroup(animationGroup) → {number}
Add new animation group from animation group definition
Parameters:
Name | Type | Description |
---|---|---|
animationGroup |
object | Animation Group Definition |
Returns:
ID of Animation Group
- Type
- number
(static) addAnimationTemplate(name, anime) → {uuid}
Create new Animation Template
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Template Name |
anime |
object | Animation Definition You also need to specifiy if the animation is infinite (e.g an infinitely spinning fan). In that case only easeintime and value are supported parameters.
|
Returns:
ID of Animation Template
- Type
- uuid
(static) addAnimationTemplateFromJson(templateId, def)
Create new Animation Template from JSON definition
Parameters:
Name | Type | Description |
---|---|---|
templateId |
uuid | ID of animation template |
def |
object | Animation Definition |
(static) addTemplate(def) → {uuid}
Adds a new hierachy template from a JSON definition
Parameters:
Name | Type | Description |
---|---|---|
def |
object | JSON definition |
Returns:
Template ID
- Type
- uuid
(static) applyToModel(templateid, nodeid) → {KinematicsHierachy}
Applies a hierachy template to a node and creates a new hierachy
Parameters:
Name | Type | Description |
---|---|---|
templateid |
uuid | Template Id |
nodeid |
number | nodeid |
Returns:
Hierachy
- Type
- KinematicsHierachy
(static) changeAnimationSpeed(component, newspeed)
Change animation speed at given component
Parameters:
Name | Type | Description |
---|---|---|
component |
KinematicsComponent | Component |
newspeed |
number | new speed |
(static) createHierachy() → {KinematicsHierachy}
Creates a new Hierachy
Returns:
Hierachy
- Type
- KinematicsHierachy
(static) deleteAnimationTemplate(templateId)
Delete animation template with given template id
Parameters:
Name | Type | Description |
---|---|---|
templateId |
uuid | Template ID |
(static) getAnimationGroups() → {array}
Retrieves Animation Group Array
Returns:
Animation Group Array
- Type
- array
(static) getAnimationTemplate(animationtemplateid) → {object}
Retrieves an animationtemplate by its id
Parameters:
Name | Type | Description |
---|---|---|
animationtemplateid |
string | id of animation template |
Returns:
Animation Template
- Type
- object
(static) getAnimationTemplates() → {hash}
Retrieves Animation Template Hash
Returns:
Animation Template Hash
- Type
- hash
(static) getComponentFromNodeId(nodeid) → {KinematicsComponent}
Retrieves a component assicated to a nodeid
Parameters:
Name | Type | Description |
---|---|---|
nodeid |
number | nodeid |
Returns:
Component
- Type
- KinematicsComponent
(static) getHandleOperator() → {object}
Retrieves Handle Placement Operator
Returns:
Handle Operator
- Type
- object
(static) getHierachies() → {array}
Retrieves Hierachy Array
Returns:
Hierachy Array
- Type
- array
(static) getHierachyByIndex(i) → {KinematicsHierachy}
Retrieves a Hierachy by its index
Parameters:
Name | Type | Description |
---|---|---|
i |
number | Hierachy Index |
Returns:
Hierachy
- Type
- KinematicsHierachy
(static) getHierachyFromNodeId(nodeid) → {KinematicsHierachy}
Retrieves a hierachy assicated to a nodeid
Parameters:
Name | Type | Description |
---|---|---|
nodeid |
number | nodeid |
Returns:
Hierachy
- Type
- KinematicsHierachy
(static) getHierachyIndex() → {KinematicsHierachy}
Returns index of a given hierachy
Returns:
Hierachy Index
- Type
- KinematicsHierachy
(static) getHierachyTemplates() → {hash}
Retrieves Hierachy Template Hash
Returns:
Hierachy Template Array
- Type
- hash
(static) getRootNode() → {nodeid}
Retrieves Root Node of Kinematics Toolkit
Returns:
Root node
- Type
- nodeid
(static) getTemplate(templateId) → {object}
Retrieves a hierachy template from its id
Parameters:
Name | Type | Description |
---|---|---|
templateId |
uuid | Template ID |
Returns:
Hierachy Template
- Type
- object
(static) getVersion() → {string}
Retrieves Toolkit Version
Returns:
Toolkit Version
- Type
- string
(static) initialize(viewer)
Initializes the KinematicsManager
Should only be called once.
Parameters:
Name | Type | Description |
---|---|---|
viewer |
object | WebViewer Object |
(static) setCustomBehaviorCreationCallback(customTypeCallback)
Sets the callback for creating a custom type object
Parameters:
Name | Type | Description |
---|---|---|
customTypeCallback |
function | Callback function when creating a custom type |
(static) setupHandleOperator()
Initializes Handle Placement Operator
(static) startAnimation(component, animationTemplate)
Create new Animation from given animation template
Parameters:
Name | Type | Description |
---|---|---|
component |
KinematicsComponent | Component to animate |
animationTemplate |
object | Animation Template |
(static) startAnimationDirect(component, anime)
Create new Animation from given animation definition
Parameters:
Name | Type | Description |
---|---|---|
component |
KinematicsComponent | Component to animate |
anime |
object | Animation Definition |
(static) startAnimationGroup(id)
Start animation group with given id
Parameters:
Name | Type | Description |
---|---|---|
id |
object | Animation Group ID |
(static) startAnimationGroupByName(id, name)
Start animation group with given name and hierachy
Parameters:
Name | Type | Description |
---|---|---|
id |
object | Animation Group Hierachy |
name |
string | Animation Group name |
(static) stopAnimation(component)
Stop animation at given component
Parameters:
Name | Type | Description |
---|---|---|
component |
KinematicsComponent | Component to animate |
(static) updateAnimationTemplate(animationtemplateid, name, anime)
Update Animation Template
Parameters:
Name | Type | Description |
---|---|---|
animationtemplateid |
uuid | Template ID |
name |
string | Template Name |
anime |
object | Animation Definition |
(static) updateTemplate(def)
Updates an existing hierachy template from a JSON definition
Parameters:
Name | Type | Description |
---|---|---|
def |
object | JSON definition |