Quantcast
Channel: Babylon.js
Viewing all articles
Browse latest Browse all 388

Problem with VertexData.Merge

$
0
0

If Positions, Normals, etc can now be Float32Arrays, VertexData.merge() fails.  This is because receiving mesh's array does not have a push function.  This is one of the only differences between typed arrays and Javascript arrays:  typed arrays are of fixed size at the time of construction.

 

Think a merge that will always work is one that:

  • computes the new size of the combination,
  • instances a new array of the final size
  • references receiving array by index

Think we should be creating a new method like, _mergeElement, that does this and returns the new array which should replace the old one.  The current structure of Merge() is quite long,  adding this extra stuff, would increase that.  having a sub method might actually have less code.

 

I double checked for references to push().  They are contained to the canned geometry / ribbon methods, so it looks like this is the only instance of this issue.  I have so many unfinished things that I cannot address this myself right now.  Wanted to bring it up, so anyone else who encountered it would know it was a known issue.


Viewing all articles
Browse latest Browse all 388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>