I show “3Dconnexion” as the manufacturer string on my device, so this isn’t the problem. I have sent you a private message with other details.
damnit I forgot latest release url points to the latest stable one (i forgot to mark 0.2 as prerelease) I’m sincerely sorry about that.
here’s the real latest release at this point
-SpaceMouse/releases/tag/0.4
“Connected SpaceMice: 0”
There’s my problem. The SpaceMouse is definitely connected and it works fine in other programs. Like I said earlier, the “Manufacturer” in the driver properties is “3Dconnexion”, so I’m not sure how this could be getting missed.
Edit: I’ve changed the HID enumeration method parameter in SpaceMouse.cpp so that it looks for the VID that Windows says my device is using. The only way I know how to compile this guy is to put it in the engine source folder structure and compile the whole thing, so I’m doing that, (it’s taking forever) and I’ll let you know how I fare with that. I suspect that this is the issue. It is at least an issue, if not the only one.
aaww man you don’t have to recompile the entire engine! just clone the repo and recompile the test project! It doesn’t have any external dependency
I don’t know how to compile plugin projects. I don’t even know how to open them. I don’t have the right-click menu that would generate the VS project files, and Unreal itself doesn’t seem to know how to open .uplugin projects at all. The whole engine compilation fails when it gets to this plugin, because somehow it can’t find App.h which is definitely where it is supposed to be.
Things like this are why I really, really, truly hate C++ with a passion. I don’t have to deal with this kind of thing when I write in Go or C# or any other programming language on the entire planet.
If it seems like I am very annoyed right now then my tone is being properly conveyed.
I got it compiled. I have to open the SpaceMouseTest project in UE4 and then UE4 offers to compile everything. I don’t know how to recompile after a source change other than deleting the Binaries and Intermediate folder from the plugins\SpaceMouse folder and relaunch UE4. It’s a tediously slow cycle.
Anyway, I was right about the VID being incorrect for this device. However when I build with the appropriate VID (0x256F) in SpaceMouce.cpp:296 It shows a connected SpaceMouse device, which is good. When I start using the device, however, it goes bonkers and I lose control of the camera very quickly. I’m currently spinning out of control in the editor, even without a hand on the controller.
edit: ok yeah the data being sent from this device is a little different than your code is expecting, I think. Maybe.
Both the translation and rotation data comes through when the first byte in pOutput is 0x01. I think your code only reads 3 int16 numbers and decides if they are translation or rotation by the first byte of pOutput, which is not how my device reports data, apparently. Mine reports both translation and rotation when report = 1.
If i make small movements with the knob, small movements result in the editor. If I cross some threshold, control is completely lost and the camera starts spinning VERY fast in an apparently random angle. the angle doesn’t change if I let go of the knob, so I just wind up spinning in the same way from then onwards. After that, only large inputs on the knob will affect the spin. I’m unable to determine what is causing that, yet.
Is there anything I can do to help you understand what is causing this?
I got my device figured out. I haven’t sorted out the buttons, yet, but I never use those, so I’m OK with this.
My changes to your code can be seen here:
https://gist…com/naikrovek/9c39f93e8118eba484a09d39d9081c96
I commented everything I remember changing.
I also changed the VID that is enumerated while looking for the device to 0x256F, and that change is not present in that gist.
Thank you for this code and for your help. I really hate C++. I’m glad I got it working, though. The familiar dopamine hit was experienced when I got it all working.
You are free to incorporate my changes into your codebase however you see fit. You are also free, of course, to do nothing with my changes.
I hear your frustration, I have that too, I’m also mainly a C# guy and it’s infinitely better and faster to use than C++. But epic decided on C++ so well we stuck with it. Actually what epic done already to make development on C++ easier is a huge improvement over what you normally have to work with on other random colossal frameworks. Even if USharp or MonoUE exists, I can’t use them to write plugins because they’re not first party and USharp at least only cover Blueprint visible stuff. I’ve never seen MonoUE actually working.
but side-track aside you can recompile just the SpaceMouseTest. if you open the visual studio solution of the project and just build solution there. UE4 will even try to hot-reload the plugin so IN THEORY you don’t even have to reopen the editor.
the first byte is the report ID. It would be weird that both the navigator and the spacemouse pro have translation and rotation on separate reports but not for the spacepilot hmmm. I don’t have access to that device to learn its data and I couldn’t find documentation about it online about its HID reports. It’s also weird that the manufacturer string test doesn’t seem to pass with that thing. Well I can add a manual set of VID\PID to look for, I guess that would be more stable.
Sorry about the hassle, at this point I would need the device to debug this and see what’s going wrong.
Thanks for the help!
I have a SpaceMouse Enterprise, not SpacePilot. This guy: https://www.3dconnexion.com/products…nterprise.html
I can probably ship this device to you, provided that you return it when done. I don’t have the original packing material but I’m sure I can safely ship this thing. If interested, PM me and we’ll work it out.
I’m trying to see if I can capture the HID data to get you the info you need in the meanwhile.
sorry hard to remember their name, naah no need to post it, I’m sure I’ll find someone here in Frankfurt who has one and test it. can you capture a video using OBS with the debug info on? with OBS (Open Broadcasting Software) can also put your webcam in the corner so I could also see what you are doing with the device
Yeah I can do that. Give me a few days.
OBS is acting up; I think I need to reboot. I will do that some time today. In the meantime, what do you need? I am assuming you only need button presses; the gist above shows how to handle the 6DOF stuff perfectly (as far as my testing went.)
the buttons are weird. some of them generate a press event and a release event when you release the key, some generate a press event and a hold event when you hold the key down for a moment. some of them generate a press event when you press the button and a release event when you release.
I see your code. OK here’s the plan, I will implement a VID-PID table for enumeration and then apparently I also have to implement different data processors for some devices which then will be functions I guess overridden from an interface class.
Sounds good. On the buttons - the 3dconnexion driver works fine when buttons are concerned. Does your software need to worry about them?
yup, I use buttons for setting camera speed but that’s the same thing you can set in the editor ui (at least on the main level editor). Buttons on the SpaceNavigator and the pro one are handled with individual bits. It is possible then that is different too on the Enterprise spacemouse.
OK. well, until I can get OBS to behave, I won’t be able to get you a video. I can get you some screenshots from a HID data inspection program I found (it offers more control than the debug info in your plugin) which should provide you with the data you’re after. I guess I’ll just have to assure you that the 6DOF controller data is handled by the code I provided, for this device.
FWIW, I have the same symptoms as Naikrovek. When I run with debug enabled, it shows connected spacemice:0. The manufacturer is listed as 3Dconnexion but the VID is 0x256F. I have a SpaceMouse Pro Wireless. Thank you for the debug option, that was very helpful to see what it was (or was not) doing. And a huge thank you for doing this.
I’am want to use the space mouse as a in game substitute for a 6dof VR controller whilst developing my game.
I had issues with wireless on another platform, I will add the PID and VID table based enumeration and then undetected spacemice problem shouldn’t occur anymore.
Currently my plugin is an Editor extension only therefore it doesn’t have blueprint nodes which would allow you to access spacemice, however I also want to use them in my projects inside the application so it’ll come at least during this summer.
I am curious if all of the devices with a VID of 0x256F have the same data output as each other - which is different than what is already supported by the plugin.
I also would love to see support for this “in-game”. I’m making non-game applications which could really benefit from 6DOF controller support, so I look forward to those updates, and I will help you test, if that’s ok.