Interacting with Sandy 3D shapes
Well, I finally got user interaction working with Sandy 3D objects. It took a bit of fiddling around, but it works. It’s fiddly because there is no obvious way to send the calling object to the event handler, so you end up responding to a mouse click without knowing where it came from. The trick in the event handler is to use event.target which will give you the container (but not the shape itself) where the container is of type Sprite. Then look through the Sandy static enumeration world.root.children to find the original Shape3D by comparing each shape’s container to the one you have.
Anyway, here is a quick example of interaction below. Click on the shape to get a random movement effect - animations are done with Tweener.
