@onirix/embed-sdk
Version:
Onirix helper library for iframe event communication.
238 lines (140 loc) • 9.01 kB
Markdown
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Added `setProperties` action to modify 3d elements properties dynamically.
- A new parameter is added to the `initNavigation` method to display the complete route in 3D mode.
- Added `highlightElementNode` action to highlight a node of a 3D model.
- Added `clearHighlightNodes` action to clear all highlighted nodes.
- Added `NAVIGATION_COMPLETED`, `NAVIGATION_STARTED` and `NAVIGATION_CANCELED` events.
- Added `cancelNavigation` action.
- Added `enableHighlightNodes` action to highlight the touched part of the 3d model.
- `setOpacity` action to change the opacity of an element.
- `initNavigation` init navigation action.
- Add `highlightBIMPieces` action to highlight the touched part of the IFC model.
- Add `getMetadata` action to retrieve IFC properties from CAD models.
- Add `loadScene` action ([ENG-1092](https://onirix.atlassian.net/browse/ENG-1092)).
- Add `setScreenCaptureOverlay` and `clearScreenCaptureOverlay` methods.
- Fix retrocompatibility used in `loadElement` and `createElement`.
- Add `OnirixEmbedSDK.Transitions` and `OnirixEmbedSDK.Sounds` enumerations.
- Add `OnirixEmbedSDK.Transitions.TRANSLATION` transition.
- Add `sound` param to transitions for `enable`, `disable`, `toggle`, `loadElement` and `createElement`.
- On `enable`, `disable` and `toggle`, the parameter `transition` now accepts an object with the `type` of transition
and the parameters of the transition. `time` can be provided in that object. All three methods can be called using
the former call interface.
- On `loadElement` and `createElement` a new `transition` parameter has been added with the same shape as the one in
`enable`, `disable` and `toggle`. Both methods are retrocompatible with the former call interface.
- Add `setTransformControlsAllowlist` and `setTransformControlsBlocklist` actions.
- Changed origin to be automatically detected from the localtion of the window.
- Changed `connect` to prevent race conditions when trying to connect before an iframe has loaded.
- Add `loadSurfacePlaceholder` action.
- Add support for multiple host domains.
- Add support for `player.onirix.com`.
- Add `getAssetImage` action.
- Add `stop` action for multimedia elements.
- Fix `SCENE_LOAD_START` and `SCENE_LOAD_END` events not returning the correct values in params.
- Update README.md
- New screen capture support.
- New action `setVariant(oid, variant)` to set a specific variant of a 3D model.
- Action `loadElement(oid, params)`: Loads a lazily loaded element with oid `oid`. Its final position, Euler rotation (
`euler` attribute) and scale can be customized using the optional `params` parameter. Also, a transition can be
applied using the transition, time and sound attributes of the `params` object (see `enable` for more information
about transitions). Returns a promise that resolves when the element is loaded.
- Action `createElement(oid, params)`: Creates a new element with oid `oid` from the asset identified by the attribute
`assetOid` of `params`. This element will be a child of the element identified by `parentOid` attribute of params.
When not present, it will be a direct child of the scene. `position`, `euler`, `scale`, `opacity` are required
attributes of the `params` object. Returns a promise that resolves when the element is created.
- Added the `LAZY_LOAD_END` event that is fired when any element is loaded or created lazily.
## 1.5.0 - 2023-05-22
### Added
- Added the following events to surface scenes ([ENG-555](https://onirix.atlassian.net/browse/ENG-555)):
- SCENE_LOST: Triggered when you are lost and need to find a surface.
- SCENE_DETECTED: Triggered when a surface is detected.
- SESSION_ENDED: Triggered on WebXR's exit.
## 1.4.0
### Added
- setCameraRigTransform action. It takes a single parameter, matrix, which is an array representing the new transformation matrix of the camera in row-major format (it also accepts an array of rows because the array is flattened before sending it to Studio).
- setCameraRigPosition action. It takes three parameters x, y, and z that will be the new coordinates of the camera.
- setCameraRigRotation action. It rotates the camera using the Euler angle specified on its parameters: x, y, and z.
- setCameraRigRotationQuaternion action. Similar to setCameraRigRotation but using the quaternion formed by its parameters: x, y, z, and w.
- disableCameraControls action. Disables the default camera controls.
### Changed
- SCENE_LOAD_END and SCENE_LOAD_START now return two new keys:
- orientation: with value 'vertical' or 'horizontal' (as specified in the scene settings).
- preview: wich is true on preview 3D and false on AR mode.
## 1.3.0
### Added
- New SCENE_CLICK event. Returns an object with the scene coordinates where the user has touched. If an element has been touched, it returns the exact point where it was touched and the information of the touched element.
- New ON_SCENE_TOUCH_START and ON_SCENE_TOUCH_END with a behaviour simliar to SCENE_CLICK.
### Changed
- ELEMENT_CLICK, ON_TOUCH_START and ON_TOUCH_END now return the element's center position(x, y, z) and intersection point.
## 1.2.4 - 2023-01-26
### Added
- Add 'autoStop' parameter to 'playAnimation' action. If this parameter is true, the model will return to its original pose after finishing the animation. If this parameter is false, the model will keep the pose of the last frame of the animation.
- Add 'time' parameter to 'playAnimation' action. This parameter allows you to specify the duration (in seconds) of the animation. If this parameter is not set, the original duration of the animation will be maintained.
- Add 'resetScenes' action. This action takes no parameters and its function is to return the web AR player to its initial state.
- Add 'rotateTo' and 'rotateToQuaternion' actions. Both actions change the angle of an element to the one specified in the given amount of time but they take different kinds of parameters. The 'rotateTo' action will take the oid of the element; the Euler angles (in radians) for the x, y, and z axes; and the time the transition will last in seconds. The 'rotateToQuaternion' action will take the oid of the element; the four components of the unit quaternion that defines the new rotation; and the duration of the transtion in seconds.
- Add 'MAP_READY', 'SCENE_LOCATION_CLICK', and 'BACK_TO_MAP' events. These events can be used only in geolocated scenes. The first one is triggered after the map is loaded or when there is some error during the map loading process. In the latter case, the event params object will have an error field whose value is the error occurred. The second one will be called when the user clicks on a marker in the map and the fields in its params object are the same as the ones in 'SCENE_LOAD_START'. The last event is triggered when the user leaves some scene and goes back to the map screen.
- Add 'ON_TOUCH_START' and 'ON_TOUCH_END' events. The 'ON_TOUCH_START' event is called immediately after the finger touches the screen and the 'ON_TOUCH_END' is triggered immediately after the finger is lifted from the screen. Both receive the oid of the element touched in the params object.
- Add 'ON_POSE' event. This event is called every time the camera is updated and receives a param object with the fields 'position', 'quaternion', and 'euler'. The field 'position' is a 3-dimensional vector with the position of the camera and the 'quaternion' field is a 4-dimensional vector with the components of the quaternion that describes the camera rotation.
- Removing message event listener on disconnect.
- 'translateToPosition' action.
- 'translateToElement' action.
- 'SCENE_RADIUS_ENTER' event.
- 'SCENE_RADIUS_EXIT' event.
- 'animation' param to 'stopAnimation' action.
- 'setLabelText' method
- NPM publish
- Initial release