TDx.TDxInput.dll for .NET 4.0
Moderator: Moderators
TDx.TDxInput.dll for .NET 4.0
I have been using the SpaceNavigator in Unity (the game engine) successfully for some time, but now that Unity is deprecating .NET 3.5 it is no longer possible to build working applications using SpaceNavigator. That is a shame.
I am using the "SpaceNavigator Driver" extension available on the Unity Asset Store. However, the problem lies not in the extension, but in the TDx.TDxInput.dll which is compiled for .NET 3.5. I have just downloaded the latest 3DWare drivers and TDx.TDxInput.dll remains .NET 3.5.
Is there any chance that 3DConnextion can provide a TDx.TDxInput.dll compiled for .Net 4.0?
All the best
Carl Emil
I am using the "SpaceNavigator Driver" extension available on the Unity Asset Store. However, the problem lies not in the extension, but in the TDx.TDxInput.dll which is compiled for .NET 3.5. I have just downloaded the latest 3DWare drivers and TDx.TDxInput.dll remains .NET 3.5.
Is there any chance that 3DConnextion can provide a TDx.TDxInput.dll compiled for .Net 4.0?
All the best
Carl Emil
Re: TDx.TDxInput.dll for .NET 4.0
Hi CarlEmail,
3DxInput is a deprecated interface. The driver still ships with a build to ensure older software can still operate in end-users machines but it's not intended for new development.
Recent version of the 3DxWare SDK have a .NET sample, TestSiapp. Our recommendation is to port the software to the driver's official API.
3DxInput is a deprecated interface. The driver still ships with a build to ensure older software can still operate in end-users machines but it's not intended for new development.
Recent version of the 3DxWare SDK have a .NET sample, TestSiapp. Our recommendation is to port the software to the driver's official API.
Nuno Gomes
Re: TDx.TDxInput.dll for .NET 4.0
I have returned to the problem of implementing SpaceNavigator input in .NET 4.0 Unity builds.
I am looking at the TestSiapp example. So far I've imported siappdll and Siapp.cs into Unity. I am now trying to recreate the functionality of Form1.cs and here I get stuck. The Form1 class inherits from Form which is not accessible. Somehow Message msg is send to the WndProc method after InitializeSiApp() is called in the Form1 constructor. How exactly do I subscribe to messages? I hope I don't need to point to a form window, because I am not sure such a concept exist in Unity.
All the best
Carl Emil
I am looking at the TestSiapp example. So far I've imported siappdll and Siapp.cs into Unity. I am now trying to recreate the functionality of Form1.cs and here I get stuck. The Form1 class inherits from Form which is not accessible. Somehow Message msg is send to the WndProc method after InitializeSiApp() is called in the Form1 constructor. How exactly do I subscribe to messages? I hope I don't need to point to a form window, because I am not sure such a concept exist in Unity.
All the best
Carl Emil
Re: TDx.TDxInput.dll for .NET 4.0
Hi Carl,
If the Unity Engine does not allow access to the low-level native window, perhaps one approach is to create a managed assembly (in C#, say) and create a wrapper to the native 3D mouse driver API. I think the TestSiapp demo can be used as a first stepping stone to building the assembly.
Ultimately, the driver relies on a window to send messages to. To subscribe to messages sent by the driver, the client program calls SiOpen (as demonstrated in the TestSiapp demo).How exactly do I subscribe to messages? I hope I don't need to point to a form window, because I am not sure such a concept exist in Unity.
If the Unity Engine does not allow access to the low-level native window, perhaps one approach is to create a managed assembly (in C#, say) and create a wrapper to the native 3D mouse driver API. I think the TestSiapp demo can be used as a first stepping stone to building the assembly.
Re: TDx.TDxInput.dll for .NET 4.0
Hi NGomes, thanks for the responding.
All the best
Carl Emil
So the assembly would then open a window in the background to receive input? Is there absolutely no way to avoid the creation of a window?
All the best
Carl Emil
Re: TDx.TDxInput.dll for .NET 4.0
The TestSiapp example app needs window (Form) focus to receive input. I wonder if you have any hints how to make it work while unfocused?
Re: TDx.TDxInput.dll for .NET 4.0
Refer to SiGrabDevice in the SDK documentation. It will allow your program to receive 3D mouse data when the process loses input focus.
-
- Posts: 4
- Joined: Mon Nov 04, 2019 7:50 pm
Re: TDx.TDxInput.dll for .NET 4.0
I met same problem which is that initialize driver in unity.I want to implement that by getting the message which windows send to unity,and I call the CallWindowProc method.I can get the unity main window by unity's process.However I got message failed.
Is this feasible?in addition, can it work when unity build to exe?
Code: Select all
const int GWL_WNDPROC = -4;
const int WM_SIZE = 0x0005;
//自定义消息处理程序
private IntPtr CustomWndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam)
{
// if (msg==WM_SIZE)
// {
Debug.Log("msg");
// }
return CallWindowProc(OldWndProc, hWnd, msg, wParam, lParam);
}
public void Start()
{
Debug.Log("start monobehaviour");
this._WndProc=new CallBack(this.CustomWndProc);
//开始拦截消息
OldWndProc = SetWindowLong(GetForegroundWindow(), GWL_WNDPROC, this._WndProc);
}
Re: TDx.TDxInput.dll for .NET 4.0
Not entirely sure I follow what you're asking, 450302324. I recall seeing separate project that had support for 3Dconnexion device in Unity. Search for "SpaceNavigator" or "3Dconnexion" the Unity "Asset Store". Perhaps you can find an example that fits what you're working on.450302324@qq.com wrote: ↑Wed Nov 20, 2019 7:08 pm Is this feasible?in addition, can it work when unity build to exe?
Re: TDx.TDxInput.dll for .NET 4.0
The Asset Store product your speak of is broken. It only works in the editor, not in builds. As far as I am aware of there is currently no solution for Unity builds.
https://assetstore.unity.com/packages/t ... river-9774
https://forum.unity.com/threads/spacena ... st-5544775
Re: TDx.TDxInput.dll for .NET 4.0
There's a .NET sample in the 3DxWare SDK. Refer to the siapp.cs file. It has the necessary methods (native interop) to add support for 3D mice in C# programs. The same approach will work with applications based on Unity.
Re: TDx.TDxInput.dll for .NET 4.0
Hi, I'm the author of the SpaceNavigator Unity driver.
I'm aware of the .net example that's being referred to, I've successfully tested that method in Unity.
This research branch holds the code of that test https://github.com/PatHightree/SpaceNav ... connection
So the fundamentals work, but there still is a lot of coding, testing and publishing remaining to get this working in a new version of the driver.
Unfortunately, I can only work on this project occasionally, as life gets in the way...
I'm aware of the .net example that's being referred to, I've successfully tested that method in Unity.
This research branch holds the code of that test https://github.com/PatHightree/SpaceNav ... connection
So the fundamentals work, but there still is a lot of coding, testing and publishing remaining to get this working in a new version of the driver.
Unfortunately, I can only work on this project occasionally, as life gets in the way...
Hit any user to continue.