MREntity
MRElement
MREntity ⇐ The default representation of an MRElement to be expanded upon by actual details ECS Entity items. mr-entity
Kind: global class
Extends: MRElement
- MREntity ⇐
MRElement
- .MREntity
- .width() ⇒
number
- .contentWidth() ⇒
number
- .height() ⇒
number
- .contentHeight() ⇒
number
- .triggerGeometryStyleUpdate()
- .triggerMaterialStyleUpdate()
- .updateMaterialStyle()
- .updateGeometryStyle()
- .onHover(event)
- .onTouch(event)
- .onScroll(event)
- .loadAttributes()
- .connected()
- .connectedCallback()
- .disconnected()
- .disconnectedCallback()
- .mutated(mutation)
- .mutationCallback(mutationList, observer)
- .componentMutated(mutation)
- .add(entity)
- .removeEntity(entity)
- .traverse(callBack)
- .traverseObjects(callBack)
mrEntity.MREntity
Kind: instance class of MREntity
new exports.MREntity()
Constructor for the default Entity Component (MREntity). Sets up the base object3D and useful Mixed Reality information including rendering, touching, and component basics.
number
mrEntity.width() ⇒ Calculates the width of the Entity based on the viewPort’s shape. If in Mixed Reality, adjusts the value appropriately.
Kind: instance method of MREntity
Returns: number
- - the resolved width
number
mrEntity.contentWidth() ⇒ The actual 3D value of the content’s width.
Kind: instance method of MREntity
Returns: number
- - width of the 3D object.
number
mrEntity.height() ⇒ Calculates the height of the Entity based on the viewPort’s shape. If in Mixed Reality, adjusts the value appropriately.
Kind: instance method of MREntity
Returns: number
- - the resolved height
number
mrEntity.contentHeight() ⇒ The actual 3D value of the content’s height.
Kind: instance method of MREntity
Returns: number
- - height of the 3D object.
mrEntity.triggerGeometryStyleUpdate()
Triggers a system run to update geometry specifically for the entity calling it. Useful when it’s not an overall scene event and for cases where relying on an overall scene or all items to update isnt beneficial.
Kind: instance method of MREntity
mrEntity.triggerMaterialStyleUpdate()
Triggers a system run to update material specifically for the entity calling it. Useful when it’s not an overall scene event and for cases where relying on an overall scene or all items to update isnt beneficial.
Kind: instance method of MREntity
mrEntity.updateMaterialStyle()
Directly in MRjs, this function is empty. It is called directly in the MaterialStyleSystem. This allows outside users to add their own additional functionality for the entities. These are run after the MaterialStyleSystem does its own update on the entity.
Kind: instance method of MREntity
mrEntity.updateGeometryStyle()
Directly in MRjs, this function is empty. It is called directly in the GeometryStyleSystem. This allows outside users to add their own additional functionality for the entities. These are run after the GeometryStyleSystem does its own update on the entity.
Kind: instance method of MREntity
mrEntity.onHover(event)
Handles the hover event
Kind: instance method of MREntity
Param | Type | Description |
---|---|---|
event | object |
the hover event |
mrEntity.onTouch(event)
Handles the touch event
Kind: instance method of MREntity
Param | Type | Description |
---|---|---|
event | object |
the touch event |
mrEntity.onScroll(event)
Handles the scroll event
Kind: instance method of MREntity
Param | Type | Description |
---|---|---|
event | object |
the scroll event |
mrEntity.loadAttributes()
Loads all attributes of this entity’s stored dataset including components, attaching them, and their associated rotations and positions.
Kind: instance method of MREntity
mrEntity.connected()
(async) does nothing. Is called by the connectedCallback.
Kind: instance method of MREntity
mrEntity.connectedCallback()
The connectedCallback function that runs whenever this entity component becomes connected to something else.
Kind: instance method of MREntity
mrEntity.disconnected()
Callback function of MREntity - does nothing. Is called by the disconnectedCallback.
Kind: instance method of MREntity
mrEntity.disconnectedCallback()
The disconnectedCallback function that runs whenever this entity component becomes disconnected from something else.
Kind: instance method of MREntity
mrEntity.mutated(mutation)
Callback function of MREntity - does nothing. Is called by mutation Callback.
Kind: instance method of MREntity
Param | Type | Description |
---|---|---|
mutation | object |
the update/change/mutation to be handled. |
mrEntity.mutationCallback(mutationList, observer)
The mutationCallback function that runs whenever this entity component should be mutated.
Kind: instance method of MREntity
Param | Type | Description |
---|---|---|
mutationList | object |
the list of update/change/mutation(s) to be handled. |
observer | object |
w3 standard object that watches for changes on the HTMLElement |
mrEntity.componentMutated(mutation)
Helper function for the mutationCallback. Handles actually updating this entity component with all the associated dispatchEvents.
Kind: instance method of MREntity
Param | Type | Description |
---|---|---|
mutation | object |
the update/change/mutation to be handled. |
mrEntity.add(entity)
Adding an entity as a sub-object of this entity.
Kind: instance method of MREntity
Param | Type | Description |
---|---|---|
entity | MREntity |
the entity to be added. |
mrEntity.removeEntity(entity)
Removing an entity as a sub-object of this entity.
Kind: instance method of MREntity
Param | Type | Description |
---|---|---|
entity | MREntity |
the entity to be removed. |
mrEntity.traverse(callBack)
Runs the passed through function on this object and every child of this object.
Kind: instance method of MREntity
Param | Type | Description |
---|---|---|
callBack | function |
the function to run recursively. |
mrEntity.traverseObjects(callBack)
Runs the passed through function on the objects associated with this Entity
Kind: instance method of MREntity
Param | Type | Description |
---|---|---|
callBack | function |
the function to run recursively. |