Is there a way in BluePrint to get Tilt Input from a single Motion Controller for VR? (Of 2, vive)
Hi, I'm attempting to map some movement controls to the tilt of a single motion controller(vive). I want to be able to detect tilting one controller fwd-back, left-right, then use those inputs for movement of an actor. Is this even possible in Blueprints?
asked Oct 20 '16 at 07:56 PM in VR
Yes, it's 100% possible in blueprints. This question is less of a technical capability question and more of a design and implementation question.
If you look at your motion controller component, you can get its position and orientation at that instant in time. You'll be interested in looking at the yaw, pitch, and roll values.
It sounds like you're looking for a change in yaw/pitch over time. That's the key there, that it's over time. That should suggest to you that you're going to be keeping a history of values and watching them as they change over time, and then interpreting the change in values as a form of input. Good so far?
So, the next few questions you'll be asking is, "How do I do that?" and "where do I store these values?" and "how do I get rid of old values?" and "how do I interpret my values correctly?"
To store the values, you'll want to put them into some sort of data structure, such as an array. You'll need to decide how many values you need to store in order to get good data. 10 frames? 100 frames? 1000? I can't tell you this value, you have to find and test for it yourself. But, let's pretend that we're using 10 frames of data so that we can look at how we can discard old data.
Normally, you would use a data structure called a "queue" with a length of 10. When you insert items into this queue, you add them to the "front" (in this case). If your queue already has 10 items in it, then you remove the last item and then insert another. The good news is that you can implement a queue within an array by using a "circular queue" (https://en.wikipedia.org/wiki/Circular_buffer) and just overwrite the next index value instead of dequeuing it.
So, I answered three out of four additional questions you'll run into, and the last question is a question I can't really answer because the answer is going to be "it depends on your implementation / requirements".
answered Oct 21 '16 at 03:04 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here