Jump to content

Maybe a bug in the Mesh.clone() method ?


Temechon
 Share

Recommended Posts

Hi all, 

 

I think I found a bug in the Mesh.clone() method (line 4 here) : 

// Buffersresult._vertexBuffers = this._vertexBuffers;for (var kind in result._vertexBuffers) {    result._vertexBuffers[kind].references++;}

VertexBuffer.references is not defined  => this line set the attribute references to all vertex buffer at NaN.

It should be : 

result._vertexBuffers[kind]._buffer.references++;

This bug caused some bad behaviour when all my cloned mesh were being disposed : 

BABYLON.VertexBuffer.prototype.dispose = function () {   this._engine._releaseBuffer(this._buffer);};

this._buffer.references were not incremented, and all my meshes were removed from screen :(

 

Is it possible to include this fix in the next version of babylon ?

 

Thanks :)

Link to comment
Share on other sites

Hi Temechon,

 

I may suggest you to do a pull request on GitHub. You seem to have fixed a bug and Deltakosh could check that in your fork and then merge it so your fix will be included to BabylonJS code.

 

BTW, no need to have a fork to do a pull request, you can directly modify the file on GitHub and GitHub will do the pull request for you :)

https://github.com/BabylonJS/Babylon.js/edit/master/Babylon/Mesh/babylon.mesh.js

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