Actions
Calculate XRCamera Root Transform |
Calculates the transform to be used to align coordinate spaces of connected clients. The result should be set as the world transform of the parent of the camera component. This function is a BlueprintNativeEvent, override to implement a custom behavior. Default implementation -> inv(inv(AlignmentTransform) * ClientPinTransform) and uses only yaw component in rotation to ensure up vector alignes with gravity. The result is an average of the calculated transforms for each shared pin. Target is Magic Leap Shared World Game State |
Can Send Local Data to Server |
Getter to check if the current client can start sending local pins to the server Target is Magic Leap Shared World Player Controller |
Client Set Chosen One |
Marks the client as the "chosen-one" or pseudo-authoritative for this shared world session. Means that this client is responsible for sending the list of it's pin transforms (in world space so its own alignment is unaffected) to the server via ServerSetAlignmentTransforms(). Everyone will align to this client's coordinate space using those pin transforms. The game mode or the player controller doesnt directly use this property. It is just a helper data point to determine which client should send the alignment transforms. Apps can choose to implement their own ways to select which client should should everyone align with. See: ServerSetAlignmentTransforms Target is Magic Leap Shared World Player Controller |
Determine Shared World Data |
Determine which pins should be used for shared world aligment of all clients. The result can be set to AMagicLeapSharedWorldGameMode::SharedWorldData. Calling SendSharedWorldDataToClients() will replicate these local pins to all clients. Calling SelectChosenOne() can select a certain client to be pseudo-authoritative i.e. all other clients will align to its coordinate space. This function is a BlueprintNativeEvent, override to implement a custom behavior. Default implementation -> simple selection of pins common in all connected non-spectator clients, with their confidence value thresholded by PinSelectionConfidenceThreshold Target is Magic Leap Shared World Game Mode |
Is Chosen One |
Getter to check if the current client is the chosen one Target is Magic Leap Shared World Player Controller |
On Alignment Transforms Updated |
Event fired when alignment transforms are updated on the client. @see AlignmentTransforms |
On Shared World Data Updated |
Event fired when shared pins are updated on the client. @see SharedWorldData |
Select Chosen One |
Select a certain client to be the "chosen-one" or pseudo-authoritative for this shared world session. Means that this client is responsible for sending the list of it's pin transforms (in world space so its own alignment is unaffected) to the server via AMagicLeapSharedWorldPlayerController::ServerSetAlignmentTransforms(). Everyone will align to this client's coordinate space using those pin transforms. This function is a BlueprintNativeEvent, override to implement a custom behavior. Default implementation -> client with best confidence values for selected shared pins. Target is Magic Leap Shared World Game Mode |
Send Shared World Data to Clients |
Replicate pins common among all clients via AMagicLeapSharedWorldGameState. These pins can be selected by calling DetermineSharedWorldData() Target is Magic Leap Shared World Game Mode |
Server Set Alignment Transforms |
Sets list of transforms to be used by all clients to align coordinate spaces. This list is redirected to AMagicLeapSharedWorldGameState which performs the replication. Bind an event to AMagicLeapSharedWorldGameState::OnAlignmentTransformsUpdated to get a notification when new alignment transforms are available. If performing shared world alignment on-the-fly (i.e. without any prior setup like in a museum app), these transforms should be sent by a single selected client. Apps can make use of the "chosen one" client for this purpose. Override AMagicLeapSharedWorldGameMode::SelectChosenOne() to select which of the connected clients should send the alignment transforms. By default the first connected client is considered the "chosen one". See: AMagicLeapSharedWorldGameMode::SelectChosenOne() See: AMagicLeapSharedWorldGameState::OnAlignmentTransformsUpdated See: AMagicLeapSharedWorldGameState::CalculateXRCameraRootTransform() Target is Magic Leap Shared World Player Controller |
Server Set Local World Data |
Updates list of pins local to a client on the server. This makes the list of local pins available to AMagicLeapSharedWorldGameMode to determine which ones to share across all clients and use for global coordinate space alignment. Target is Magic Leap Shared World Player Controller |