setUserObject() on Geometry "and others", for detection link

Hi!



Mostly at picking ray, that detects a geometry, I miss getUserObject(), that forces me to go on a list to find out what I need. I still couldnt find a good and easy to use, use, for setUserData().



Also, if there is any other detectable objects (in this case is geometry at cast ray), they could have the setUserObject() also, I think that is a lot handy and could be more spread up, unless it can cause some trouble, what I would like to know :slight_smile:



thx!

I’m unable to understand what you are trying to use this for. Can you explain more about the larger issue?

I was having picking ray to show geometry name, but I couldnt find my object linked to it, to list other of its properties.



But, I just saw that I can get the object that has the data I need thru geom.getControl(Class), so the controls can be used to find out what data that geometry is linked to. It is working as getUserObject() to me, what is enough for what I need.



thx

You can also use geom.getUserData?

mmm… user data just need to be Savable to work! I hadnt seen that when I got an exception of unsupported type! thx! (I just read the code, I havent tested yet, gotta sleep, good night! :D)

mmm… I see now getUserData() is much more usefull, and I seem to need it on PhysicsRigidBody got from PhysicsCollisionEvent…



The getUserObject() already contains PhysicsBoneLink, and if I overwrite it I will break bad many functionalities, in this case, on the ragdoll… I am already taking care of removing all setUserObject I have done, despite I could do if it is null…



Do you think it can be added there or I am missing something again? :>