In plugin of Unreal, there is class called AOptitrackClientOrigin, which contains HMD Rigidbody ID.
But this variable is not used in any initialization process, or position update.

After several testing, I figure out that this variable is used to pre-initialize HMD rotation, to synchronize rotation between HMD and HMD rigidbody, but it is really difficult to figure out which timing, or which part of process, is doing that stuff, since it is not opened on plugin.

Since I have multiple number of HMD that need to be intialized, I have tried to put one specific ID of it just before calling InitializeClient() function or put it on constructor, but it still has no effect unless default value of HMD Rigidbody ID is stored as non-zero.

It would be appreciaed if anyone can clarify aboue this variable and related function

Thank you for reaching out to the community regarding this question.
We are currently looking into this to see if there is any relevant information we can provide.

It might help us if we could understand what you are trying to achieve with this. You mention that you have multiple HMDs, and we are not sure how you hope to configure them. In a typical multiplayer environment, there is usually one HMD connected per PC, which prevents the need to drive multiple HMDs in a single instance of Unreal.

If you could reply with some additional information regarding what you are working toward, this will help us to gather the most useful information.

steven.andrews wrote:
You mention that you have multiple HMDs, and we are not sure how you hope to configure them. In a typical multiplayer environment, there is usually one HMD connected per PC, which prevents the need to drive multiple HMDs in a single instance of Unreal.

And yes, you are right. What I wanted to do was initializing one HMD per PC, but with dynamic HMD ID for better accessibility.
I just want to clarify that which step of engine initialization process that plugin used to initialize its HMD(Not initialize function on Opttriack Client Origin. That is for connection to motive server), since it seems like only called once before begin play called.

Edit:
What I am thinking is, there is "Hidden" Initialization process for HMD. Only source opened to us for initialization is for ClientOrigin itself, which only manages to connect to Motive server.

I've found that FindHmdClientOrigin of OptitrackClientOrigin is called just before hmd initialization, but seems like client origin without HMD ID can initialize HMD after connected to Motive server if HMD ID is filled later.

Is there any way to manage those HMD initialization process in our hand?

I believe the explanation for the issue you're seeing is the fact that, internally, the HMD rigid body ID value is read and stored only once by the HMD plugin in response to the first call to FHeadMountedDisplay::OnStartGameFrame. It's possible you may be able to find an appropriate actor lifecycle event that occurs earlier than this and would therefore allow you to change the value preemptively, though I have not investigated in depth to see whether this is the case.

Apologies for the confusion! I will investigate making improvements the next version of the Unreal plugin to better support your use case of dynamically reconfiguring those parameters.

ZachBrockway wrote:It's possible you may be able to find an appropriate actor lifecycle event that occurs earlier than this and would therefore allow you to change the value preemptively

I've implemented this already and I gotta say, you guys really didn't make this easy.
The only reliable way I've found to catch this event is

- In UGameInstance::StartGameInstance register for OnPostWorldInitialization
- In the post world initialization function, register for AddOnActorSpawnedHandler on the world.
- In the actor spawned handler, check if it's a playercontroller. If so, spawn your OptitrackClientOrigin dynamically, and unregister the actor spawned handler.