Jump to content

Ray error with pickable meshes which deform


JCPalmer
 Share

Recommended Posts

I have had an intermittent error, in one of my sample scenes.  Could never reproduce it on command till now.  This has been happening for a long time, not just 2.2, though I am using this mornings 2.2.max in the link below.

 

Have been testing new versions of POV & MOPRH extensions.  In this scene, there are a group of buttons, which deform the plane mesh.  The mesh is pickable, so that you can click on it after pressing the 'Conflict' button & reset it.

 

Everything works, if and only if you put the cursor over the mesh Before you press any of the buttons.  If a deform occurs first, you get a console error when the mouse moves over the mesh, and it does not change to a pointing hand.

 

https://googledrive.com/host/0B6-s6ZjHyEwUeXlkcGtoT1duTEU/

 

The error is 'vertex1 is undefined', as shown on the last line below.  I am in the process of upgrading MORPH, if there was something I should do, that would be fine.  Problem is what.  Thanks.

        Ray.prototype.intersectsTriangle = function (vertex0, vertex1, vertex2) {            if (!this._edge1) {                this._edge1 = Vector3.Zero();                this._edge2 = Vector3.Zero();                this._pvec = Vector3.Zero();                this._tvec = Vector3.Zero();                this._qvec = Vector3.Zero();            }            vertex1.subtractToRef(vertex0, this._edge1);
Link to comment
Share on other sites

Of course, I needed to go through the exercise of publishing a test & posting a topic to realize that this probably a result of the Mesh.updateVerticesDataDirectly calls.  There is eventually a setting of the of the original VerfexBuffer._data to null, which might be too aggressive.  The goal of direct updates was to fully process in Float32Arrays and take a short cut, and avoid all the short lived garbage generation needed. Made SIMD interpolation simple as well.

 

Think, chucking all the non-typed array data for 2.3, might be a good idea, with almost no rework outside of switching args in Typescript from number[] to Float32Array or Uint16Array.  The data would then stored closer to GPU transfer format already.

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...