Multiple devices initialize in unity

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
450302324@qq.com
Posts: 4
Joined: Mon Nov 04, 2019 7:50 pm

Multiple devices initialize in unity

Post by 450302324@qq.com » Sun Nov 24, 2019 10:23 pm

My goal is to bind multiple space mouse devices to different objects in unity3d.So I have some question:
1.What is the max value about tx,ty,tz?
2.How to initialize multiple devices in same window which is unity built execute?Such as multiple calls SiOpen method to get these devices' handle or multiple new DeviceClass to get the drivers.
Thanks

jwick
Moderator
Moderator
Posts: 2715
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Multiple devices initialize in unity

Post by jwick » Mon Nov 25, 2019 1:07 am

You can never count on the range of values of the devices. A user can always scale them behind your back. The raw values are in the +/- 350 range, though it depends on the default cfg file that is used by your application if they are subsequently scaled. We always make them work without changing anything in the GUI. The users are free adjust for their own tastes and circumstances.

There are two concerns with supporting multiple devices.
1) Yes, you call SiOpen for each device, incrementing devID. Use SiGetNumDevices to find out how many devices there are.
2) When you get a DeviceChange event (user hot plugged a device), you may want to just close and reopen everything.

I'd like to see what you do with multiple devices. There are a lot of interesting options. Each can control subsets of the 6DOFs. Or one the camera, the others the objects. One editing surfaces (morphing the object), the other moving the object to see what you've done. Multiple simultaneous users. Lots of possibilities.

450302324@qq.com
Posts: 4
Joined: Mon Nov 04, 2019 7:50 pm

Re: Multiple devices initialize in unity

Post by 450302324@qq.com » Mon Nov 25, 2019 2:21 am

I need the max value to make the range between -1 to 1 in my project.But I get the value is more than 2000 through Siapp demo.
In addition,which method is use for listening the device work?
.

jwick
Moderator
Moderator
Posts: 2715
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Multiple devices initialize in unity

Post by jwick » Mon Nov 25, 2019 2:47 am

The demo cfg file contains a 4x scale factor. If you do your own cfg file you can make it what you want.
If you must limit the values to +/- 1, then clamp them in your code.

I don't understand what you are asking in the second question.

Post Reply