lightmap Posted February 27, 2019 Share Posted February 27, 2019 (edited) Hello For some reason vive controller trigger button affect gui mouse object_gui.setMouseMode(ObjectGui.MOUSE_VIRTUAL);// init ... object_gui.setMouse(p0, p1, buttonPressed, showMouseCursor);// update at half press it try to move window at full press it hide window I don't write this, and don't want it and can't find how to change it so intension to click on any button turns in total disaster how to workaround this behavior? Edited February 27, 2019 by lightmap Link to comment
alexander Posted February 28, 2019 Share Posted February 28, 2019 Hi Lightmap, I'm afraid i don't understand you. I need more information about it. Is it based on VR Template? What is the "buttonPressed" variable and where and how do you set it? Can you give to us a small sample? Best regards, Alexander Link to comment
lightmap Posted February 28, 2019 Author Share Posted February 28, 2019 (edited) Hi It is not based on VR Template, it on sdk 2.7.2 with c# wrapper + AppVive dll buttonPressed comes from vive trigger state; buttonPressed = hit_gui * (Vive.trigger()>0.5f?1:0) As I suppose, somewhere in Engine code, if Vive connected, happens controller logic that move window at mid trigger state - is that true? Edited February 28, 2019 by lightmap Link to comment
alexander Posted March 1, 2019 Share Posted March 1, 2019 Hi, As I suppose, somewhere in Engine code, if Vive connected, happens controller logic that move window at mid trigger state - is that true? Engine doesn't know about Vive because it is an extern plugin "AppVive". This is not an engine code. In your code: buttonPressed = hit_gui * (Vive.trigger()>0.5f?1:0); // if trigger position more than 50% then buttonPressed == 1 object_gui.setMouse(p0, p1, buttonPressed, showMouseCursor); // use gui at vive controller position (click, hold, drag...) you can see that window starts moving when "trigger > 0.5f" (half press of the trigger). If you don't want it - just remove the "Vive.trigger() > 0.5f" condition. By the way, what type of behavior do you expect? If you don't want to move a specific window use WidgetWindow::setMoveable(0) method. Best regards, Alexander 1 Link to comment
lightmap Posted March 1, 2019 Author Share Posted March 1, 2019 ok, simple check Vive.Trigger(){return 0;} shows that something wrong in our code the problem when I press trigger at 1.0f - gui mouse disappears, and I can't find where it is public void OnUpdate(){ int hit_gui = 0; // update visuals vec3 p0 = param().start.ToVec3(); vec3 p1 = param().end.ToVec3(); WorldIntersection intersection = new WorldIntersection(); Unigine.Object hitObj = World.get().getIntersection(p0, p1, 1, intersection); if (hitObj != null) { hit_gui = 1; } var press = param().exec;// < (Vive.trigger()>0.5f?1:0); var buttonPressed = hit_gui * press; object_gui.setMouse(p0, p1, buttonPressed, hit_gui); } thanks Link to comment
silent Posted March 1, 2019 Share Posted March 1, 2019 To always render a cursor you can use extern define MOUSE_SOFT (either, pass on engine start-up in -extern_define command or specify it in system script). How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
lightmap Posted March 2, 2019 Author Share Posted March 2, 2019 Thanks, found problem, it's gui intersection with skinned hand also, how to setup intersection mask for object_gui? object_gui.setCollisionMask(64, 0);// init Unigine.Object hitObj = World.get().getIntersection(p0, p1, 64, intersection);// update and how to draw vr gui always on top of scene objects? object_gui.getGui().addChild(imageItem, Gui.ALIGN_OVERLAP | Gui.ALIGN_CENTER); Link to comment
alexander Posted March 4, 2019 Share Posted March 4, 2019 Hi, How to setup intersection mask for object_gui? You should use setIntersectionMask() instead of collision mask.How to draw vr gui always on top of scene objects? Just disable "Depth Test" in your ObjectGui material. Best regards, Alexander 1 Link to comment
Recommended Posts