Is it possible to get absolute positions for Flowitems

Is it possible to get absolute positions for Flowitems

philippe_m
Not applicable
83 Views
2 Replies
Message 1 of 3

Is it possible to get absolute positions for Flowitems

philippe_m
Not applicable

[ FlexSim 17.2.2 ]

Dear all,
The Oculus Touch VR model is a very nice example of how the Oculus touch can interact with Flexsim.
Let's hope the interaction process gets streamlined even further !

I am trying to grab flowitems in a queue with the Oculus Touch and release it on a processor. The issue is that the flowitems get assigned "relative" positions with respect to, I believe, the queue in which they are created.

Is there a way to get/set their absolute position in the Model ? That way it would be easier to determine the closest flowitem to the Oculus Touch and to move it with the hand movement.

I stay available for further details if needed.
Thanks immensely for the help !

Cheers,
Philippe

Accepted solutions (1)
84 Views
2 Replies
Replies (2)
Message 2 of 3

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

You can use the project method on the Vec3 class to convert a position from one coordinate space to another.

For example, to get the position of a flowitem inside a queue in model coordinates:

Object item = model().find("Queue1").first;
return item.location.project(item.up, model());

To set the same item's position to the model's origin:

item.location = Vec3(0,0,0).project(model(), item.up);


Matthew Gillespie
FlexSim Software Developer

Message 3 of 3

philippe_m
Not applicable

Hi Matthew,
Thanks for the quick response. It works like a charm and I didn't think of this method.

0 Likes