Skip to content

Scene IDs

Recorded user data is sent to a 'Scene' on the dashboard. Scene Data must be set when CognitiveVRAnalyticsCore is constructed.

The C++ API does not currently contain a simple method to upload Scenes to the Dashboard. Please get in touch to discuss a solution for your specific implementation.

Each Scene should have a SceneData created. The four constructor parameters are:

  • SceneName is used to easily change where session data is sent.
  • SceneId is used internally.
  • VersionNumber is used internally. This is an optional field
std::unique_ptr<CognitiveVRAnalyticsCore> cog;
void main()
{
    //...

    std::vector<cognitive::SceneData> scenedatas;
    scenedatas.emplace_back(cognitive::SceneData("tutorial", "asdf12347890hjkl", "1"));
    scenedatas.emplace_back(cognitive::SceneData("menu", "qwer5678zxcv1234", "1"));
    settings.AllSceneData = scenedatas;
    settings.DefaultSceneName = "tutorial";

    cog = cognitive::make_unique_cognitive<cognitive::CognitiveVRAnalyticsCore>(settings);
    //...
}

Elsewhere in your project the player may transition to a 'new scene'. The following code will ensure the Gaze, Dynamics, Sensors, and Events will be recorded in the context of this new geometry.

void SceneManager::OnSceneChange(std::string sceneName)
{
    auto cog = cognitive::CognitiveVRAnalyticsCore::Instance();
    cog->SetScene(sceneName);
    //If the sceneName is not contained in AllSceneDatas, an error will be printed to the log
}

Alternatively, if your application doesn't have the concept of 'scenes', you can directly set the SceneId. This method allows you to manually provide the VersionNumber or skip it to upload data to the latest version of the scene.

void SceneManager::OnSceneChange()
{
    auto cog = cognitive::CognitiveVRAnalyticsCore::Instance();
    std::string SceneId = "asdf1234uiop5678";
    std::string VersionNumber = "5"; //optional
    cog->SetSceneId(SceneId,VersionNumber);
    //The SceneId does not need to be set in settings.AllSceneData
}

Custom Gateway

You can set a Custom Gateway to send Session Data to your private cloud. This should be done when creating the CoreSettings object before constructing the CognitiveAnalyticsCore.

If you don't have a private cloud, you can ignore this feature.

std::unique_ptr<CognitiveVRAnalyticsCore> cog;
int main()
{
    cognitive::CoreSettings settings;
    settings.webRequest = &MakeWebRequest;
    settings.APIKey = "1234abcd5678";

    settings.CustomGateway = "data.cognitive3d.com";

    //...
    cog = cognitive::make_unique_cognitive<cognitive::CognitiveVRAnalyticsCore>(settings);
    //...
}

Lobby Id

LobbyId is used to connect multiple sessions together to represent a multiplayer experience. The LobbyId is generated from the dashboard. Please get in contact to discuss your implementation details. Also see the Lobby System page.

After you receive the unique LobbyId, this needs to be sent to each client.

void PlayerController::RPC_OnPlayerJoinedServer(std::string lobbyId)
{
    auto cog = cognitive::CognitiveVRAnalyticsCore::Instance();
    cog->SetLobbyId(lobbyId);
    //...
}

intercom If you have a question or any feedback about our documentation please use the Intercom button (purple circle) in the lower right corner of any web page.