Jump to content

Are parented Meshes pickable?


JCPalmer
 Share

Recommended Posts

Well, I went back to my single Label test to see for myself with top level mesh (I am much far than this now).

post-8492-0-38032600-1425584771.png

 

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

post-8492-0-87976900-1425659535.png

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...