AnchorSystem
MRSystem
AnchorSystem ⇐ creates and manages WebXR anchors in the MR scene.
Kind: global class
Extends: MRSystem
- AnchorSystem ⇐
MRSystem
- .AnchorSystem
- .update(deltaTime, frame)
- .attachedComponent(entity)
- .updatedComponent(entity)
- .detachedComponent(entity)
- .deleteAnchor(entity)
- .createAnchor(entity, comp)
- .fixed(entity)
- .floating(frame)
- .plane(entity, comp)
- .adjustTransform(xrRigidTransform) ⇒
- .matrix4ToXRRigidTransform(matrix4)
- .multiplyQuaternionWithXRRigidTransform(quaternion, xrRigidTransform)
anchorSystem.AnchorSystem
Kind: instance class of AnchorSystem
new exports.AnchorSystem()
AnchorSystem’s default constructor including setting up event listeners for XR initialization, user interaction, and the MRPlaneManager
anchorSystem.update(deltaTime, frame)
This update function maintains the transforms of anchored entities. This overrides any other transform values set on the element when in mixed reality.
Kind: instance method of AnchorSystem
Param | Type | Description |
---|---|---|
deltaTime | number |
given timestep to be used for any feature changes |
frame | object |
given frame information to be used for any feature changes |
anchorSystem.attachedComponent(entity)
Kind: instance method of AnchorSystem
Param |
---|
entity |
anchorSystem.updatedComponent(entity)
Kind: instance method of AnchorSystem
Param |
---|
entity |
anchorSystem.detachedComponent(entity)
Kind: instance method of AnchorSystem
Param |
---|
entity |
anchorSystem.deleteAnchor(entity)
deletes anchors from the scene and removes all references to the anchored plane (if any)
Kind: instance method of AnchorSystem
Param |
---|
entity |
anchorSystem.createAnchor(entity, comp)
creates the anchor specified by the data-anchor-comp
Kind: instance method of AnchorSystem
Param |
---|
entity |
comp |
anchorSystem.fixed(entity)
anchors the given entity half a meter in front of the users position at launch.
Kind: instance method of AnchorSystem
Param |
---|
entity |
anchorSystem.floating(frame)
creates an anchor at the position specified by the user, either floating in front of them or pinned to the scene mesh
Kind: instance method of AnchorSystem
Param |
---|
frame |
anchorSystem.plane(entity, comp)
anchors the provided entity to the nearest unoccupied plane that meets the given orientation and label. each plane is currently limited to one anchor for simplicity.
Kind: instance method of AnchorSystem
Param |
---|
entity |
comp |
anchorSystem.adjustTransform(xrRigidTransform) ⇒
converts the provided XRRigidTransform to a Matrix4 and adjusts it to ensure that it’s y-axis is pointing directly up and it’s z-axis is facing inward
Kind: instance method of AnchorSystem
Returns: a THREE.js Matrix4
Param |
---|
xrRigidTransform |
anchorSystem.matrix4ToXRRigidTransform(matrix4)
converts the provided matrix4 into a webXR xompatible XRRigidTransform
Kind: instance method of AnchorSystem
Param |
---|
matrix4 |
anchorSystem.multiplyQuaternionWithXRRigidTransform(quaternion, xrRigidTransform)
multuplies an xr rigid transform by the provided quaternion
Kind: instance method of AnchorSystem
Param |
---|
quaternion |
xrRigidTransform |