Mouse picking help

hi there,



does someone have a simple example on how to access selfdefined methods on a picked object. tried for a while now. seems like i don't get it.





HALP!! :wink:

You need to use instanceof operator followed by casting. Here is an example.


Spatial pickedObject = getPickResult();
if (pickedObject instanceof MyObject) {
    MyOjbect myObjecy = (MyObject) pickedObject;
    myObject.myMethod();
}

awesome!

that's working perfectly.



you made my day.

thank you very much!