Dad72 Posted February 27, 2017 Share Posted February 27, 2017 Hello, When you serialize a field with serializeMesh, vertexData is not serialize. I made a PG to reproduce this: http://www.babylonjs-playground.com/#1SQFJP#9 Thanks! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 27, 2017 Share Posted February 27, 2017 Ok thanks I fixed the serializer. Should be good now Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 28, 2017 Author Share Posted February 28, 2017 Yes, it works. Thanks DK. By cons I do not know if this is normaly or not, but mesh.getHeightToCoordinates(10, 10) does not work. Is this normal? Sorry,I know that sometimes I am annoying, but I treat myself, promised http://www.babylonjs-playground.com/#1SQFJP#12 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 28, 2017 Share Posted February 28, 2017 Ok it was a bigger bug than expected..Now ground is CORRECTLY serialized Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 28, 2017 Author Share Posted February 28, 2017 Thanks DK, On my project I still have a bug when using getHeightAtCoordinates. on this line: if (z < quad.slope.x * x + quad.slope.y) { In this function : // Returns the element "facet" from the heightQuads array relative to (x, z) local coordinates GroundMesh.prototype._getFacetAt = function (x, z) { ... if (z < quad.slope.x * x + quad.slope.y) { facet = quad.facet1; } ... return facet; }; I recieve : Uncaught TypeError: Cannot read property 'slope' of undefined at GroundMesh._getFacetAt (babylon.max.js?1488281828:41398) at GroundMesh.getHeightAtCoordinates (babylon.max.js?1488281828:41335) I think this happens when you change the terrain by raising faces. the faces of the terrain are not of quads I think. I reproduce here with a land change. getHeightAtCoordinate not working, but we see no error in the console that I have on my project where "slope" does not define http://www.babylonjs-playground.com/#1SQFJP#15 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 28, 2017 Share Posted February 28, 2017 The data saved here was not saved with latest version. minx, minz, etc.. are missing from the json file. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 28, 2017 Author Share Posted February 28, 2017 In fact I must recreate a land with CreateGround and register again for this to be updated with minx, minz ... that's what you mean? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 28, 2017 Author Share Posted February 28, 2017 yes it works after recreating a terrain . Thank you for all Dk GameMonetize 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.