Obtaining user objects from ray query result

bigjhnny

02-09-2006 17:05:27

Hi:

I'm using pyogre 1.06. I am having problems attaching "user objects" to entities and retrieving them later from a ray query result entry.

From further investigation, the queryResultEntry.movable returns a different instance of the entity....

So here are two problems:

1. there are no methods like "set/get user object" in entity class
2. the ray returns a different instance than the instance that has the attached user object (may not be a problem, probably intended?)

How did you guys work around this? Any hints?

Thanks,

viblo2

04-09-2006 12:33:47

You could do a lookup based on entity (or node) name:

userObjects["ent1"] = userObject1
userObjects["ent2"] = userObject2
...
selectedObject = userObjects[queryResult.movable.name]

bigjhnny

04-09-2006 16:28:12

Yea, I had started binding the name of the entity to the user object identifier. If it became more complicated, I'd start using your method.

BTW, I gave the new 1.2 binary another try, this problem still persists. However, I find that some of the earlier problems are solved and it didn't take much to port over my app to 1.2. So I'm now using the latest 1.2 binary now! Yea!!

Ok Thanks