Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

Picking updated mesh

$
0
0

Hi guys,

I have a problem with mesh picking and it is a specific case.

When I create a ribbon like this, I can see it on the scene:

 var someRibbon = BABYLON.Mesh.CreateRibbon("ribb", [[new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(10, 0, 0)], [new BABYLON.Vector3(0, 10, 0), new BABYLON.Vector3(10, 10, 0)]], false, false, 0, _scene, true, BABYLON.Mesh.FRONTSIDE);
            

On mouse down I am writing the name of the picked mesh in the log:

handleMouseDown: function(event){

var pickResult = _scene.pick(_scene.pointerX, _scene.pointerY);
var pickedPoint = pickResult.pickedPoint;
console.log(pickResult.pickedMesh.name); // writes ribb when I click on it
}

BUT, when I update the ribbon mesh after creation, like this:

  var someRibbon = BABYLON.Mesh.CreateRibbon("ribb", [[new BABYLON.Vector3(0, 0, 0), new BABYLON.Vector3(10, 0, 0)], [new BABYLON.Vector3(0, 10, 0), new BABYLON.Vector3(10, 10, 0)]], false, false, 0, _scene, true, BABYLON.Mesh.FRONTSIDE);
  someRibbon = BABYLON.Mesh.CreateRibbon(null, [[new BABYLON.Vector3(0, 0, 5), new BABYLON.Vector3(10, 0, 5)], [new BABYLON.Vector3(0, 10, 5), new BABYLON.Vector3(10, 10, 5)]], null, null, null, null, null, null, someRibbon);

Then I can see that the ribbon that is updated (moved 5units along z axis), but it can't be picked. Actually, the picker "thinks" that the ribbon is still in the old position.

Does someone have any idea how this could be solved?


Viewing all articles
Browse latest Browse all 760

Trending Articles



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