question

anon-user avatar image
0 Likes"
anon-user asked Ryan Clark commented

How to control levers and push buttons in FlexSim VR.

I am trying to figure out how to control levers and push buttons in FlexSim VR.


I found these info.

https://answers.flexsim.com/articles/37895/vr-demo-models.html

https://answers.flexsim.com/questions/44272/how-to-interact-with-the-objects-using-vr-oculus-r.html

https://answers.flexsim.com/questions/59854/vr-model-custome-code.html



Looking at these samples, I can see that by writing FlexScript.

It looks like I can control levers and push buttons in VR by writing FlexScript, am I right?


Am I correct in my understanding, or do I need to create some kind of DLL using C++, etc.?


FlexSim 21.0.5
oculus riftoculusflexsim vr
· 1
5 |100000

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

Ryan Clark avatar image Ryan Clark commented ·

Hi anonymous user, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

Yes, you can do all necessary coding in FlexScript. Mostly you will use the "stick()" command to compare the coordinates of the virtual hand and other objects, such as buttons. If they are within a certain vicinity and/or a certain button is pressed on the controller, some action in the model can be triggered.

The movement of levers/buttons in the demo is done by essentially "slaving" the objects position to that of the virtual hand when near it, adjusting location and rotation according to the controller movement.

The commented version of the demo model is a good starting point to learn.

oculustouchdemo-6-commented.fsm

More information on the "stick()" can be found in FlexSim when searching for it in the "Command Helper" or in the manual.

https://docs.flexsim.com/en/22.0/Reference/CodingInFlexSim/CommandReference/Commands.html


5 |100000

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