Trouble picking modified mesh

BlitzMax Forums/MiniB3D Module/Trouble picking modified mesh

TomToad(Posted 2013) [#1]
Seems that when I use EntityPickMode Entity,2 and then pick a polygon that has been moved by modifying a mesh, PickedX(),PickedY(), and PickedZ() report the old position of the polygon instead of the new position.

Try out the example here, Press the spacebar to print the value of PickedZ() on the entity. It will print -4.0000 as expected. Press 'M' to modify the mesh by moving the Z component of all the vertices to -2. You can see that the quad moves by lining up with the blue spheres. Now press space again. You would expect the Z component to now be -2, but instead it is still -4. The example here doesn't show it, but the bug affects proper collisions as well.


ETA: Just tried the sample in Blitz3D and it works as expected. Definitely a bug in MiniB3D.


TomToad(Posted 2013) [#2]
I found a workaround. If I add TMesh(Quad).col_tree.reset_col_tree = True after modifying the mesh, it will work.

Should be added to the TSurface AddVertex() and Vertexcoords() methods.