Adding items to the scene
Last updated
Last updated
It’s possible to add additional products/items/configurations to the scene using the insertObject
API:
By default the object is placed somewhere where it does not overlap with other items in the scene. You can also supply a position and a rotation for the object in the scene:
Position (2nd parameter) is in meters and the rotation (3rd parameter) is in radians.
It is possible to implement a behavior which gets called when there is something changed in the plan. It gets all objects of the plan as parameter.
You can react to certain plan element changes using the onPlanElementChanged(changeType)
callback.
Depending on what happened, the changeType
parameter can be:
added
: When a new plan element is added to the scene
removed
: When an existing plan element gets removed
changed
: When a plan element is changed, like rotated or moved. But also when it is added or removed
updated
: When the configuration of a configurable product inside the scene is updated.
You can try and play around with this example here:
You can react on any time when a tooltip is closed on controls button click As a parameter you get the name of the tooltip, e.g. "stopConfiguring"