How to control levers and push buttons in FlexSim VR.

How to control levers and push buttons in FlexSim VR.

__ANON_USER__1
Not applicable
25 Views
2 Replies
Message 1 of 3

How to control levers and push buttons in FlexSim VR.

__ANON_USER__1
Not applicable

[ FlexSim 21.0.5 ]

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.?


0 Likes
Accepted solutions (1)
26 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Explorer
Explorer
Accepted solution

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

0 Likes
Message 3 of 3

ryan_c10
Not applicable

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