1.0.1 • Published 2 years ago

@superviz/cesium-plugin v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

SuperViz Cesium SDK Plugin

DISCLAIMER: this version is only compatible with SuperViz SDK version 4.7.2 or higher

Description

@superviz/cesium-plugin is a plug and play package that you can use together with the superviz sdk to easily inject custom mouses and functionality to your cesium 3d world.

  • current cesium sdk version supported: 1.106.1 or above

Getting started

import SuperViz, {
	MeetingEvent
} from '@superviz/sdk';

import { CesiumPlugin } from '@superviz/cesium-plugin';

const supervizSdk = await SuperViz.init(DEVELOPER_KEY, { // for more info on the superviz sdk check docs.superviz.com
	group: {
			id: "<GROUP-ID>",
			name: "<GROUP-NAME>"
	},
	participant: {
			id: "<MY-USER-ID>",
			name: "<MY-USER-NAME>",
			type: 'host'
	},
	roomId: "<ROOM-ID>",
	debug: false
});

const plugin = new CesiumPlugin(cesiumSdk);

supervizSdk.subscribe(MeetingEvent.MY_USER_JOINED, () => {
	this.cesiumPluginInstance = supervizSdk.loadPlugin(plugin, {
		avatarConfig: {},
		isNameEnabled: true,
	});
});

Plugin initialization options

const plugin = new CesiumPlugin(cesiumSdk);

When creating the Cesium Plugin instance you need to pass your Cesium SDK instance. For example:

Cesium.Ion.defaultAccessToken = CESIUM_KEY  //your cesium key

const cesiumSdk = new Cesium.Viewer('cesiumContainer', {
  // ...options
});
const plugin = new CesiumPlugin(cesiumSdk);

SDK Methods

  • getParticipantsOn3D()

    To access users current 3D properties like position, rotation use: this.cesiumPluginInstance.getParticipantsOn3D();

  • e.g

    [{
    	id: 123,
    	name: "John Doe",
    	avatar: {
    		model: "model.gltf"
    	},
    	avatarConfig: {
    		scale: 1,
    		height: 0,
    		laserOrigin: { x:0,y:0,z:0 }
    	},
    	position: { x: 0, y: 0, z: 0 },
    	rotation: { x: 0, y: 0 }
    }]

Issues

To report a new bug or request a new feature, please contact us at contact@superviz.com

Superviz cesium-plugin is BSD 2 licensed.

1.0.1

2 years ago

1.0.0

2 years ago