HI,
I’m creating a tube dynamically based on points from an array that is calculated on the fly finding a route, in some cases the point is repeated and the tube will return to a prior point as it finds a blocker, when this happens, the tube is not rendered after that point.
This is an example of an array that causes the behaviour, position 0 and 3 are repeated:
var myPathTmp = [];
myPathTmp[0] = new BABYLON.Vector3(2.273655652999878, 0.5, 1.9416018724441528);
myPathTmp[1] = new BABYLON.Vector3(2.680851459503174, 0.5, 2.4170844554901123);
myPathTmp[2] = new BABYLON.Vector3(2.273655652999878, 0.5, 1.9416018724441528);
myPathTmp[3] = new BABYLON.Vector3(2.1215269565582275, 0.5, 2.6639657020568848);
tube = BABYLON.MeshBuilder.CreateTube(“tube”, {path: myPathTmp, radius: 0.02, sideOrientation: BABYLON.Mesh.DOUBLESIDE, updatable: true}, scene);
tube.material = myMaterial;
This code won’t render the tube from array position 2 to 3.
If I remove the point myPathTmp[2]:
var myPathTmp = [];
myPathTmp[0] = new BABYLON.Vector3(2.273655652999878, 0.5, 1.9416018724441528);
myPathTmp[1] = new BABYLON.Vector3(2.680851459503174, 0.5, 2.4170844554901123);
myPathTmp[2] = new BABYLON.Vector3(2.1215269565582275, 0.5, 2.6639657020568848);
It renders the tube correctly. In this case Vector3 on position 1 is not repeated.
In my case the array is dynamically generated as it is finding a route.
Do you think this is a bug or a setting on the CreateTube that I need to set?
Thanks for your valuable help.