I have a scene which consists of an OC3D containing about 100 planes. Rather than rotating and panning the camera I’m using a custom vertex shader to update the position and rotation etc of the planes.
I want to be able to click on each plane using MouseEvent3D.CLICK, when the scene isn’t transformed this behaves as it should but when I update the location of vertices in the shader it behaves like I haven’t moved the scene from its original position.
After a short search I read this http://away3d.com/tutorials/Introduction_to_Mouse_Picking and realized it’s because the default Mouse Picker in Away3D uses raytracing from the camera (which isn’t moving, neither are the meshes until they hit the GPU). So thought great - the
view.mousePicker = PickingType.SHADER;
is what I want.
So I’ve set that, and also added
plane.pickingCollider = PickingColliderType.AUTO_FIRST_ENCOUNTERED;
plane.shaderPickingDetails = true;
to each plane (along with standard mouseEnabled=true and attaching a listener) but nothing has changed. When I rotate or move my scene using my vertex shader the picking still behaves as if it’s using raytracing and selects faces which are in the pre-transformed space.
I’m thinking I must be missing something, but can’t find anything in the docs or on the forums to plug the gap. Can anyone see what I’m doing wrong? Surely with the view set to PickingType.SHADER it should be using the object under the mouse just less performant?