question

Paulino SMH avatar image
0 Likes"
Paulino SMH asked Paulino SMH edited

Control model status through VR

Hello,

I would like to know if its possible to control the model status (reset, run, stop) through virtual reality with the headset on.

So far I have been able to control model logic following the VR Models that you provide without any problem, but when I try to control the model state I get some errors.

1670576544135.png

I think "OnPreDraw" is not the best place to insert this kind of code, is there any place I can move it to get what I am looking for?

Attached is a demo model showing the problem I am facing (VR Mode must be enabled).

TestVRControl.fsm

Thanks in advance.

FlexSim 22.1.1
virtual realitymodel control
1670576544135.png (96.4 KiB)
testvrcontrol.fsm (27.2 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jonah K avatar image
0 Likes"
Jonah K answered Paulino SMH edited

The simplest way I've found to control the model through the Oculus Quest is to set up a desktop view. Or you could make buttons/levers in the model environment that run/stop/reset the model when interacted with.


Set Up Desktop View:

When you're in the FlexSim model in your VR, press the Oculus home button on your right-hand controller. On the bottom toolbar, select Add Desktop Panel, then chose FlexSim. This should pull up the desktop view of FlexSim with all the model features available (Run, Stop, Skip, etc.). You can then quickly toggle back and forth between your desktop view and the VR view by clicking the Oculus home button on your right-hand controller.

oculusscreenshot1670611027.pngoculusscreenshot1670611317.png


Creating A VR Button to Run/Stop:

If you look at the Zombie game in the VR Demo Models, there are buttons and levers on a control panel. 1670617236028.pngIn the tree for this model, under MODEL:/Controls, you can see each of the buttons and lever objects. You could use these as templates to create your own button or lever to start/stop/reset the model.

I found that inserting this line of code;

  1. onButtonPress(applicationcommand("run"));

in /RunSpeed/One>labels/pressCallback, allows you to run the model by pressing the "1x" button. Use these buttons as templates for creating your own button with the desired functionality.


· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.