Hotspot description as defined in p3d.in, or empty string if not set
Unique string identifier for the object
Determine if this hotspot is rendered
Another hotspot that this hotspot is child of, if any.
Hotspot title as defined in p3d.in. Eg. "Hotspot 1"
Get hotspot position in screen space x and y coordinates
hotspot.getScreenCoordinates().then((resp) => {
console.log('Hotspot is at', resp.x, resp.y, 'pixels');
});
Select this hotpot.
Set transform that camera will move to when hotspot is selected. Coordinates are in scene space.
Only the given coordinates are updated. So if you only want to change the point camera is directed at, you can only provide "target", but not "location". Then camera location itself will not be changed when hotspot is selected.
For example target scene origin and move camera 2 meters on z axis.
hotspot.setCameraTransform({
target: {x: 0, y: 0, z: 0},
location: {x: 0, y: 0, z: 0},
});
Place hotspot in given x, y and z coordinates relative to parent object if any.
Optionally you can also provide a parent object. Given coordinates are relative to the parent, so 0, 0, 0 coordinates will be at the center of the parent object.
For example place hotspot at location of another object:
hotspot.setLocation(0, 0, 0, object);
Optional
parent: P3dObjectPlace hotspot in given x, y and z scene coordinates.
Optionally you can also provide a parent object. In that case coordinates are adjusted so that final scene coordinates match given values even with the parent hierarchy in place.
For example place hotspot at click coordinates on Embed API onclick
callback:
onclick: (e) => {
hotspot.setSceneLocation(e.coordinates.x, e.coordinates.y, e.coordinates.z, e.object);
}
Optional
parent: P3dObject
Get array of all hotspots that this hotspot is parent of