JCPalmer Posted March 5, 2015 Share Posted March 5, 2015 Am building a dialog mesh hierarchies. "Buttons" can be in this hierarchy. I am having trouble getting pick actions working. Just want to double check that these are pickable meshes. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 5, 2015 Author Share Posted March 5, 2015 Well, I went back to my single Label test to see for myself with top level mesh (I am much far than this now). I got no console message confirming that it got called. Either I am doing it wrong, or just the opposite is happening. Each of the Letter meshes would get the pick, had they registered for it. On the assumption that my registration is correct, do I have to inset my letters, so it hits the Label (the border) first? If so, does the Label (border) have to be visible? If so, could I set the material transparent? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 5, 2015 Author Share Posted March 5, 2015 Well, I moved letters back by a lot, no joy. Maybe I am doing it wrong. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 5, 2015 Share Posted March 5, 2015 You know the motto: "Please create a repro case:)" Sanity check: did you check is mesh.isPickable is true? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 5, 2015 Author Share Posted March 5, 2015 Well, I made a Label with NO letters. You get a box of minimum size. It still did not work. A Label's positions are updatable (using updateVerticesData, not updateVerticesDataDirectly). In my base class for everything, I was effectively making a box of zero size in the constructor. Only when the final layout of the hierarchy was done are real values for geometry known. At that time the real geometry is assigned. Also, something could be changed while interacting with dialog, so layout can be called again as required. I changed the initial setVerticesData for positions to make the smallest possible real box. The empty Label, now worked when you actually clicked the border!!! If you click in the hollow space though, nothing. At least my registration being wrong can be ruled out. I then added back in a single 'X' , and clicking the border still worked, even without setting the 'X' behind the border. 'XX' did not work. I can make a repo, but that is involved & some stuff now works, so specify what you want. Do you think I will need to make a multi-material front side that is transparent for buttons that sticks far out to get picked ahead of any parents? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 5, 2015 Author Share Posted March 5, 2015 Also, 'XX' is pickable. I changed to 'XK', since 1 was a clone. Did not work. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 5, 2015 Share Posted March 5, 2015 No I just need a repro if something is not working as expected Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 5, 2015 Share Posted March 5, 2015 I thought the motto was "WebGL, Simple, Powerful". But i'll start using the repro one from now on GameMonetize and jerome 2 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 6, 2015 Author Share Posted March 6, 2015 My motto is "It isn't my fault". I was planning on changing the geometry anyway, optionally adding a back to the border. I cheat to get the code. I make it in Blender, generate source using TOB. From that I use the pattern of vertex positions, to construct an array using variables rather than absolute values, & out right steal the matching normals. Guess I need to steal the sub-meshes too now.Was only going add this for top level panels to put a transparent black or blur material on the back. This would help if there were other meshes in the background. I could also put these 2 extra triangles on buttons. I might want the location to the front of the box / tube, but still need to place the Letter meshes proud of them. Question now is: Can you put non-pick registered meshes in front of one that is, or somehow explicitly set them non-pickable? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 6, 2015 Share Posted March 6, 2015 Response: yes you can as the scene.pick will only select isPickable meshes Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 6, 2015 Author Share Posted March 6, 2015 Thanks, I can confirm that, now that I can have backs to borders (.3 alpha black looks nice) . The cursor also changes to a little pointing hand. Problem is now I only get the hand in a small patch right in the middle. Will bypass this for now. Am getting close for a preview, no dialog stack / single camera only, like version 0.9. Will then have something I can post as a repo. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 6, 2015 Author Share Posted March 6, 2015 Well, I thought I could do a paste job in the playground while nursing a beer at the end of the day, so I did. I repo'ed it here:http://www.babylonjs-playground.com/#EETGB I also found the problem is : updateVerticesData. The small area where you get the hand must be based off the 1 by 1 mesh made with the setVerticesData. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 8, 2015 Share Posted March 8, 2015 This will be fixed by next checkin JCPalmer 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 9, 2015 Author Share Posted March 9, 2015 Thanks,I get a little area that's clickable, that is enough for development, so no hurry. I did not know the position data was used for anything after transmission to GPU, except for possible application access. Probably should delete line 110 in VertexBuffer.ts, updateDirectly(), this._data = null; If the shape key is small in relation to the whole mesh, it might still work. Like a face. In hindsight, keeping the float32Array copy instead of number[] seems like the better choice for less garbage collection & faster updates. But that decision was probably one of the earliest made. Still unless you are do development in Typescript, you would never know if it was switched Jeff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 10, 2015 Share Posted March 10, 2015 Fixed! Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted March 11, 2015 Author Share Posted March 11, 2015 I see no difference. The pointer only changes to a hand in the very center. I switched to 2.1 locally. The above playground does not show a hand, except in the very center. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 12, 2015 Share Posted March 12, 2015 My bad, I forgot to mention that you have to ask for a re-computation of mesh's extend:http://www.babylonjs-playground.com/#EETGB#4 JCPalmer 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.