ミーティング
概要
このサンプルは、Fusionを使用してシンプルなミーティングアプリケーションを開発する方法のアプローチを説明しています。
まず、プレイヤーはアバター選択画面で自分のアバターをカスタマイズします。その後、ミーティングルームに移動し、いくつかのツールや機能がセットアップされた状態になります。
以下は、特に注目すべき機能です。
- ユーザーを異なる部屋に分けるための公共/非公開グループ
- ドアが閉まっているときの部屋の音の遮断
- 様々な色の3Dペン
- 縦または横のホワイトボードに動かせる描画ができる2Dペン
- 画面共有
- ソーシャルディスタンスの確保
- ユーザーにヒントを提供するためのインタラクティブメニュー
プレイヤーがPCまたはMACでサンプルを起動すると、デスクトップモード(キーボードとマウスを使用)またはVRモード(Meta Questヘッドセット)を選択できます。
技術情報
- This sample uses the Shared Mode topology,
- Builds are available for PC, Mac, Meta Quest & WebGL,
- The project has been developed with Unity 2021.3, Fusion 1.1.8, Photon Voice 2.53,
- 2 avatars solutions are supported (home made simple avatars & Ready Player Me avatars),
Before you start
To run the sample :
Create a Fusion AppId in the PhotonEngine Dashboard and paste it into the
App Id Fusion
field in Real Time Settings (reachable from the Fusion menu).Create a Voice AppId in the PhotonEngine Dashboard and paste it into the
App Id Voice
field in Real Time SettingsThen load the
AvatarSelection
scene and pressPlay
Download
Version | Release Date | Download | |
---|---|---|---|
1.1.8 | Dec 21, 2023 | Fusion meeting 1.1.8 Build 386 |
Download Binaries
A demo version of Meeting is available below :
The Meeting Screen Sharing Recorder for Windows is available below :
WebGL
The Meeting sample can be build for a WebGL target.
You can test Metaverse WebGL build here (Fusion 2 version).
Due to some Unity limitations regarding WebGL builds though, a few point need specific care to work properly and are detailed here.
Note that this WebGL build does not support WebXR (virtual reality in the browser): while it is achievable with some open source libraries, like unity-webxr-export, it is not yet supported by default in Unity, and thus not demonstrated here.
Handling Input
Desktop
Keyboard
- Move : WASD or ZQSD to walk
- Rotate : QE or AE to rotate
- Pen color : C to change the pen Color
- Menu : Esc to open or close the application menu
Mouse
- Move : left click with your mouse to display a pointer. You will teleport on any accepted target on release
- Rotate : keep the right mouse button pressed and move the mouse to rotate the point of view
- Move & rotate : keep both the left and right button pressed to move forward. You can still move the mouse to rotate
- Grab : put the mouse over the object and grab it using the left mouse button.
Meta Quest
- Teleport : press A, B, X, Y, or any stick to display a pointer. You will teleport on any accepted target on release
- Touch (ie for chat bubbles lock buttons) : simply put your hand over a button to toggle it
- Grab : first put your hand over the object and grab it using controller grab button
Folder Structure
The main folder /MeetingRoom
contains all elements specific to this sample.
The folder /IndustriesComponents
contains components shared with others industries samples like Fusion Stage ScreenSharing sample, Fusion Expo sample or Fusion Metaverse sample.
The /Photon
folder contains the Fusion and Photon Voice SDK.
The /Photon/FusionXRShared
folder contains the rig and grabbing logic coming from the VR shared sample, creating a FusionXRShared light SDK that can be shared with other projects.
The /Photon/FusionAddons
folder contains the Industries Addons used in this sample.
The /Plugins
folder contains the Ready Player Me SDK
The /XR
folder contain configuration files for virtual reality.
Architecture overview
The Meeting sample rely on the same code base than the one described in the VR Shared page, notably for the rig synchronization.
The grabbing system used here is the alternative "local rig grabbing" implementation described in the VR Shared - Local rig grabbing page.
Aside from this base, the sample, like the other Industries samples, contains some extensions to the FusionXRShared or Industries Addons, to handle some reusable features like synchronized rays, locomotion validation, touching, teleportation smoothing or a gazing system.
Used Industries Addons
We provide to our Industries Circle members a list of reusable addons to speed up 3D/XR application prototyping.
See Industries Addons for more details.
Here are the addons we've used in this sample.
Spaces
We reused the same approach than the one used in the Metaverse samples to allow several instances of the same room. So, users have the possibility to join the public room or a private meeting room by specyfing a room number. This choice can be made in the avatar selection screen or later with the application menu.
See Space Industries addons for more details.
ConnectionManager
We use the ConnectionManager
addon to manage the connection launch and spawn the user representation.
See ConnectionManager Addons for more details.
Feedback
We use the Feedback
addon to centralize sounds used in the application and to manage haptic & audio feedbacks.
See Feedback Addons for more details.
Dynamic Audio group
We use the dynamic audio group addon to enable users to chat together, while taking into account the distance between users to optimize comfort and bandwidth consumption.
See Dynamic Audio group Industries Addons for more details.
Audio Room
In addition, we wanted to illustrate how to soundproof people who are not in the same room.
So, we have created two rooms in the scene seperated by a sliding door.
We use the AudioRoom
addon to manage the dynamic audio group update according to the door status. The door opening and closing are triggered by buttons which call the AudioDoor.ToogleDoor()
method.
To door animation is managed by the TriggerDoorAnimation
class which listen to the OnStatusChange()
event received from the AudioDoor
class.
See Audio Room Industries addons for more details.
Locomotion validation
We use the locomotion validation addon to limit the player's movements (stay in the room, avoid furniture, etc.).
See Locomotion validation Industries Addons for more details.
Social distancing
To ensure comfort and proxemic distance, we use the social distancing addon.
See Social distancing Industries Addons for more details.
Screen Sharing
Users can share their computer screen and broadcast it on the meeting room's large screen.
Unlike the "Stage ScreenSharing" sample, here there is no authorization management: the last user to start a broadcast takes control of the screen. This is managed by the EmissionOrchestrator
which implements the IEmitterListener
interface.
So when a client starts a screen share, the PlayerId
is saved :
- either directly by the client itself if it has the State Authority over the screen,
- or using a RPC if the client doesn't have the State Authority.
C#
public void SetEmitter(PlayerRef emitter, string name)
{
if (Object.HasStateAuthority)
{
EmittingPlayer = emitter;
EmittingPlayerName = name;
}
else
{
RPC_SetEmitter(emitter, name);
}
}
[Rpc(sources: RpcSources.All, targets: RpcTargets.StateAuthority)]
public void RPC_SetEmitter(PlayerRef emitter, string name)
{
EmittingPlayer = emitter;
EmittingPlayerName = name;
}
As soon as a screen share is started by another player, the screen share is stopped with StopEmitting()
to save resources and bandwidth.
See Screen Sharing Industries Addons for more details.
Drawing
The room contains whiteboards with 2D pens and several 3D pens. When the drawing is complete (i.e. when the user releases the "trigger" button), a handle is displayed. This allows the user to move 2D or 3D drawings.
See 3D & 2D drawing Industries Addons for more details.
Blocking contact
We use this addon to block 2D pens and drawing' pin on whiteboard surfaces.
See Blocking contact Industries Addons for more details.
Interactive Menu
This addon is used to display tips on how to use pens or a delete button on drawings.
See Interactive Menu Industries Addons for more details.
Extended Rig Selection
We use this addon to switch between the various rigs required in this sample. Indeed, we need three configurations in this sample :
- VR rig for Meta build,
- Desktop rig for Windows and Mac client,
- no rig to build the Windows recorder application in charge to stream desktop on the screen (indeed, we do not need to spawn a network rig in this mode).
So, the Extended Rig Selection setup is the following :
See Extended Rig Selection Industries Addons for more details.
Desktop Focus Mode
As it is difficult to use a 2D pen to draw on a whiteboard while being in 3D, the ScreenDrawing
class relies on the "Desktop Focus Mode" addon to activate the focus mode and display a specific user interface.
See Desktop Focus Industries Addons for more details.
Compilation
We use the same Unity scenes for the normal client and for the recorder client (to stream a desktop on the screen).
So, we have to make some manual modifications depending on the client we want to compile.
Recorder Client Compilation
So, to compile the recorder application, you have to follow 2 steps :
1/ Open the AvatarSelection
scene : on the LoadMainSceneInRecorderMode
game object, check the box Is Recorder Compilation Mode
to load the main scene directly without loading the avatar selection scene.
This tips is required because the scene list must be identical for the normal client and for the recorder.
2/ Open the MeetingRoom
scene : on the ExtendedRigSelection
game object, ExtendedRigSelection
class, set the Selection Mode
parameter to Selected by User Pref
.
3/ Change some Unity parameters :
Project Settings
/Player
:- Change
Product name
: add 'Recorder' for example
- Change
Project Settings
/Player
/Resolution and Presentation
/Resolution
- Fullscreen Mode : Windowed
- Default Screen Width : 640
- Default Screen Height : 380
- Resizable : No
- Allow Fullscreen : No
Normal Client Compilation
So, to compile the normal client application, you have to follow 3 steps :
1/ Open the AvatarSelection
scene : on the LoadMainSceneInRecorderMode
game object, uncheck the box Is Recorder Compilation Mode
.
2/ Open the MeetingRoom
scene : on the ExtendedRigSelection
game object, ExtendedRigSelection
class, set the Selection Mode
parameter to Selected by User Pref
.
3/ Change some Unity parameters :
Project Settings
/Player
:- Change
Product name
: add 'Client' for example
- Change
Project Settings
/Player
/Resolution and Presentation
/Resolution
- Fullscreen Mode : Fullscreen Windows
- Resizable : Yes
- Allow Fullscreen : Yes
Third party components
- Oculus Integration
- Oculus Lipsync
- Oculus Sample Framework hands
- Ready player me
- Sounds
- Video
- Videvo "Walking On The Moon"