Plugin

is very cool. I just talked with another engine tech and he’s going to bring in his Hydra from home to check out with. We’re trying to get together an entire VR rig with whatever hardware we can find to see if it’s achievable (also it’s fun).

A very cool plugin, but I get some error when loading it.

**Plugin ‘HydraPlugin’ failed to load because module ‘HydraPlugin’ could not be found. **

I’ve placed the Plugin folder in my project folder. The warning comes up after I enable the plugin just after the engine restarts.

I’m using Windows :frowning: but I have the same problem as the Mac user above.

[=Kashaar;25454]
is pretty awesome! I just integrated Hydra support into a fresh template project and am happily moving around and rotating two gizmos with the hydras :slight_smile:

Would it be helpful to anyone if I released my HydraInputActor-derived blueprint that handles almost all the things?

One thing I’ve noticed, Hydras rotation and joystick structs seem to be not directly mapped to UE4’s… for example, Sixense’s Pitch is UE’s Yaw, Yaw is inverted Roll, and Roll is inverted Pitch. Though I’m not sure if isn’t maybe because of the project template and perspective I was using.
[/]

That would be very helpfull, I’m making my own implementation right now for simulating hands for a future VR game. Still a bit buggy so I’m wondering what you have made!

I’ve also noticed the mixing up of the rotation’s pitch, roll and yaw for the rotation, would be nice if they could be converted in the plugin to UE4’s yaw, roll and pitch.

Great work on the plugin. I have brought in a Hydra I had at home that wasn’t being used and it didn’t take long to get some basic gameplay working with it. I look forward to seeing how you are able to keep improving on this.

I moved thread to Engine Source & Github section.

[=LoveTune;38090]
A very cool plugin, but I get some error when loading it.

**Plugin ‘HydraPlugin’ failed to load because module ‘HydraPlugin’ could not be found. **

I’ve placed the Plugin folder in my project folder. The warning comes up after I enable the plugin just after the engine restarts.

I’m using Windows :frowning: but I have the same problem as the Mac user above.
[/]

Make sure you are using the correct version of the plugin for your engine version (0.5.1 for 4.1 and 0.5 for 4.0.x). Also is the engine being used in 64bit mode?

[=Strykeforce;42156]

I’ve also noticed the mixing up of the rotation’s pitch, roll and yaw for the rotation, would be nice if they could be converted in the plugin to UE4’s yaw, roll and pitch.
[/]

will hopefully be fixed in the next version, it’s on the todo list.

[= ;37460]
is very cool. I just talked with another engine tech and he’s going to bring in his Hydra from home to check out with. We’re trying to get together an entire VR rig with whatever hardware we can find to see if it’s achievable (also it’s fun).
[/]

[= ;43728]
Great work on the plugin. I have brought in a Hydra I had at home that wasn’t being used and it didn’t take long to get some basic gameplay working with it. I look forward to seeing how you are able to keep improving on this.
[/]

Glad to see Unreal taking a strong interest in VR! If you have any suggestions on how to improve the plugin to fit epic style better, I’m all ears :slight_smile:

Hi ,

I have not had an opportunity to look at the source code you have available with your plugin, but it would be a good idea to make sure your source code matches the coding standards used at Epic (if you have already done this, then please disregard :slight_smile: ). You can see our current standards here](Epic C++ Coding Standard for Unreal Engine | Unreal Engine 5.1 Documentation).

Hi getamo,

Thanks for the help. I forgot to download the source code for 4.1 and ended up not being able to compile the project. It’s all fixed but I can’t run your plugin in 4.1.1.

I am very new in kind of stuff could you please tell me the process of updating a plugin so it can work for the newer version? Does it only involves re-compiling the plugin?

:slight_smile:

I am not much of a programmer but I am going to make a VR project. I already have the first oculus the second version is coming :P.
I am thinking of making a Virtual reality horror game where the player hold a flashlight/gun with . Could you please tell me if the plugin provide the necessary functions to achieve it?

Cheers

@

I also noticed that one of the axis (Yaw I think) is going from 90 to -90 so I can never get the full rotation, it just switches from 90 to -90 or vica versa. Good stuff that you are actively working on the plugin!

Just a suggestion also, dont know if you want to keep the plugin closed source but it would be nice if would be available via github or something so we can suggest or help with the plugin (even though im not so much into c++ but still)

[=Strykeforce;48144]
Just a suggestion also, dont know if you want to keep the plugin closed source but it would be nice if would be available via github or something so we can suggest or help with the plugin (even though im not so much into c++ but still)
[/]

You do realize that the source is included in the download, right?

[=Kashaar;48385]
You do realize that the source is included in the download, right?
[/]

Oops my bad, gonna look into it now!

[=LoveTune;46585]
Hi getamo,

Thanks for the help. I forgot to download the source code for 4.1 and ended up not being able to compile the project. It’s all fixed but I can’t run your plugin in 4.1.1.

I am very new in kind of stuff could you please tell me the process of updating a plugin so it can work for the newer version? Does it only involves re-compiling the plugin?

:slight_smile:

I am not much of a programmer but I am going to make a VR project. I already have the first oculus the second version is coming :P.
I am thinking of making a Virtual reality horror game where the player hold a flashlight/gun with . Could you please tell me if the plugin provide the necessary functions to achieve it?

Cheers
[/]

Just checked, the 0.5.1 plugin version works on ue 4.1.1 so just make sure you have the latest plugin downloaded replacing the old one located in your project’s Plugins folder.

Plugin binds the Hydra to UE4, what you do with it is up to you, there are really no limitations.

[=Strykeforce;48144]
@

I also noticed that one of the axis (Yaw I think) is going from 90 to -90 so I can never get the full rotation, it just switches from 90 to -90 or vica versa. Good stuff that you are actively working on the plugin!

Just a suggestion also, dont know if you want to keep the plugin closed source but it would be nice if would be available via github or something so we can suggest or help with the plugin (even though im not so much into c++ but still)
[/]

That’s the data you get from the hydra API. To track rotations you will need to manually check for large changes in rotation (e.g. yaw going from -89 to +88 in one frame) and add/subtract full rotations to your input. is how I solved the problem for my own project.

I might add capability to the plugin, but I generally prefer to keep plugins clean without extra convenience code.

Also as Kashaar mentioned, source is included, but for your convenience, here’s a github:
https://github.com//hydra-ue4

[]
Just checked, the 0.5.1 plugin version works on ue 4.1.1 so just make sure you have the latest plugin downloaded replacing the old one located in your project’s Plugins folder.
[/]

I got a warning that the module is not compatible and recompiling may be necessary. How can I recompile the plugin?

The plugin header etc is not really linked in my solution. What is the actual process to re-compile the plugin?

Edit : Recompiled successfully following the step above. Thanks a lot

[=;48872]
Just checked, the 0.5.1 plugin version works on ue 4.1.1 so just make sure you have the latest plugin downloaded replacing the old one located in your project’s Plugins folder.

That’s the data you get from the hydra API. To track rotations you will need to manually check for large changes in rotation (e.g. yaw going from -89 to +88 in one frame) and add/subtract full rotations to your input. is how I solved the problem for my own project.

I might add capability to the plugin, but I generally prefer to keep plugins clean without extra convenience code.

Also as Kashaar mentioned, source is included, but for your convenience, here’s a github:
https://github.com//hydra-ue4
[/]

Alright so lets start off that I HATE angles and lots of math in general (despite being a programmer), but what I hate even more is adding hacks to solve a problem that gets created elsewhere. So bear with me while we go on a short journey here…

So I dug around in the source code and since I write C# on a daily basis everything I tried for converting the rotation matrix to a quat failed, so that was fun. I decided to google some more for whacky rotation from the sdk and see if there were other people having the same problem and some have had problems with it as well, but not in the same kind!
http://www.mtbs3d.com/phpbb/viewtopic.php?f=139&t=16051#p91610

When I reached the end of the thread I was starting to think there is nothing we can do since they did not have a solution for the problem.
Then in the following thread a thing called gimbal lock was mentioned:
http://www.mtbs3d.com/phpBB/viewtopic.php?f=139&t=18265&start=40#p144361

So ok still bad luck I guess?, nope. The problem occurs because we break up the rotator to fix incorrect rotation, we lose the original rotator and so we get a gimbal lock on an axis because from there on out we are working with euler angles which have problem.

Since I can switch out params in C++ I did a bit of guessing and within 4 tries I fixed the rotator.


converted.rotation = FQuat(data->rot_quat[2], -data->rot_quat[0], -data->rot_quat[1], data->rot_quat[3]);

Woop woop, pretty happy it works now and I can focus on my game!

So in general guys, dont break up rotators, they dont like you if you do so!

Edit: I just tried breaking up and making the rot again but not changing anything, that works so confirms my HATE for doing math with angles :cool:

Well, maybe will help… For reference, here’s how I translated the rotation from the Hydra to UE’s rotation system in Blueprints:

http://stuff.pyrron.com/ue4-hydrarot.jpg

It’s just a different source coordinate system, it seems. Where in UE, X is forward, Y is sideways, and Z is up, the Hydra seems to use a different system where Y is upwards, Z is forwards, and X is sideways… unless I’ve got that mixed up. Edit: At least for rotation.

I actually think it would be good if the plugin handled coordinate system translation… it seems to work alright for positional tracking, at least.

[=Kashaar;53035]
Well, maybe will help… For reference, here’s how I translated the rotation from the Hydra to UE’s rotation system in Blueprints:

[img]

It’s just a different source coordinate system, it seems. Where in UE, X is forward, Y is sideways, and Z is up, the Hydra seems to use a different system where Y is upwards, Z is forwards, and X is sideways… unless I’ve got that mixed up. Edit: At least for rotation.

I actually think it would be good if the plugin handled coordinate system translation… it seems to work alright for positional tracking, at least.
[/]

Read my post I fixed the plugin so the UE4 engine gets the correct rotator cause now you probably have the same problem: when you rotate the hydra in a way you it freaks out and rotates in a weird or opposite way.

I’ve proposed the change I made in code on github, if you want to try it out for yourself you can edit the “Plugins/HydraPlugin/Source/HydraPlugin/Private/FHydraPlugin.cpp” file with the rotator fix.

Hm, are you sure? Because I don’t have that problem. But might it be related to what actor/component rotation function you use, maybe? I know that there is one rotation node in BP that is basically like FPS rotation (pitch is clamped to -90 to 90), and another that isn’t, which gives you free rotation. Can’t check right now which is which since I’m not near a computer, though.

I’m sure, had same problem but was calculating new data with history data and by doing so avoiding the real problem.

Anyway the rotation should be correct from the plugin to use with UE4, its crazy to constantly have 2 or more nodes in blueprint to convert the rotation. There is not a single use case I can imagine for using the inverted/wrong rotation, you will always have to convert it.

Try rotating every axis of the hydra controller to over 90 degrees, im quite positive you will see the same gimbal lock. I’m using a gun mesh that rotates accordingly to the rotation of the hydra controller.

[=Strykeforce;52658]


converted.rotation = FQuat(data->rot_quat[2], -data->rot_quat[0], -data->rot_quat[1], data->rot_quat[3]);

Woop woop, pretty happy it works now and I can focus on my game!

So in general guys, dont break up rotators, they dont like you if you do so!

Edit: I just tried breaking up and making the rot again but not changing anything, that works so confirms my HATE for doing math with angles :cool:
[/]

Kashaar brought up earlier, but solution is what made me dig in and update my quaternion knowledge. TIL you can change quat coordinate system by effectively ignoring the W component and just swapping x,y,z around.

In general UnrealX = - SixenseZ UnrealY = SixenseX UnrealZ = SixenseY. I had fixed for position, but because of (fearing) the quaternion, left the rotation for a later day. The caveat is that the values coming from hydra rotation are inverted, which means you have invert each axis and is why your solution is correct.

Thanks for and I’ve patched it into v0.5.2 of the plugin.

Please note that the rotation count issue is separate from the gimbal lock and if you want to count revolutions you will still need to check for big rotation changes.

[=;53617]

I had fixed for position, but because of (fearing) the quaternion, left the rotation for a later day. The caveat is that the values coming from hydra rotation are inverted, which means you have invert each axis and is why your solution is correct.

Thanks for and I’ve patched it into v0.5.2 of the plugin.

Please note that the rotation count issue is separate from the gimbal lock and if you want to count revolutions you will still need to check for big rotation changes.
[/]

Maybe we should start a club for people in fear of quaternions! :smiley: