Unique string identifier for the object
Determine if this hotspot is rendered
Hotspot title as defined in p3d.in. Eg. "Hotspot 1"
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
Hotspot description as defined in p3d.in, or empty string if not set