Josh Posted September 2 Share Posted September 2 This is what I figured out. const int INDEX_BUTTON_B = 1; const int INDEX_BUTTON_A = 2;// also squeeze handle const int INDEX_BUTTON_DPAD = 32;// also touchpad button const int INDEX_BUTTON_TRIGGER = 33; const int INDEX_AXIS_DPAD = 0;// this is also the touchpad const int INDEX_AXIS_TRIGGER = 1; const int VIVE_BUTTON_TOUGHPAD = 32; const int VIVE_BUTTON_TRIGGER = 33; const int VIVE_BUTTON_MENU = 1; const int VIVE_BUTTON_GRIP = 2; const int VIVE_AXIS_TOUCHPAD = 0; const int VIVE_AXIS_TRIGGER = 1;// x axis only More info: https://www.vive.com/hk/support/vive-pro-hmd/category_howto/about-the-controllers.html This is the code I am using to test: #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CLIENTCOORDS | WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Get the VR headset auto hmd = GetHmd(world); //Environment maps auto specmap = LoadTexture("https://github.com/UltraEngine/Assets/raw/main/Materials/Environment/footprint_court/specular.dds"); auto diffmap = LoadTexture("https://github.com/UltraEngine/Assets/raw/main/Materials/Environment/footprint_court/diffuse.dds"); world->SetEnvironmentMap(specmap, ENVIRONMENTMAP_BACKGROUND); world->SetEnvironmentMap(specmap, ENVIRONMENTMAP_SPECULAR); world->SetEnvironmentMap(diffmap, ENVIRONMENTMAP_DIFFUSE); //Add a floor auto floor = CreateBox(world, 5, 1, 5); floor->SetPosition(0, -0.5, 0); auto mtl = CreateMaterial(); mtl->SetTexture(LoadTexture("https://github.com/UltraEngine/Documentation/raw/master/Assets/Materials/Developer/griid_gray.dds")); floor->SetMaterial(mtl); const int INDEX_BUTTON_B = 1; const int INDEX_BUTTON_A = 2;// also squeeze handle const int INDEX_BUTTON_DPAD = 32;// also touchpad button const int INDEX_BUTTON_TRIGGER = 33; const int VIVE_BUTTON_TOUGHPAD = 32; const int VIVE_BUTTON_TRIGGER = 33; const int VIVE_BUTTON_MENU = 1; //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { bool change = false; //Test axes float tol = 0.01f; for (int n = 0; n < 64; ++n) { for (int k = 0; k < 2; ++k) { if (hmd->controllers[k]) { auto v = hmd->controllers[k]->GetAxis(VrControllerAxis(n)); if (Abs(v.x) > tol or Abs(v.y) > tol) { window->SetText("Axis " + String(n) + ": " + String(v.x) + ", " + String(v.y)); change = true; break; } } } } // Check buttons for (int n = 0; n < 64; ++n) { for (int k = 0; k < 2; ++k) { if (hmd->controllers[k] and hmd->controllers[k]->ButtonDown(VrControllerButton(n))) { window->SetText("Button: " + String(n)); change = true; } } } if (not change) window->SetText(""); world->Update(); world->Render(framebuffer); } return 0; } Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted September 2 Author Share Posted September 2 Okay, no big surprises here, but I noted some small details. It does not appear to be possible to retrieve the Index finger orientations with the original OpenVR interface. I will look into this next. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted September 3 Author Share Posted September 3 I don't think there is any way to get finger tracking data from Knuckles controllers without using Valve's horrible action manifest system. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.