From: <hed...@ai...> - 2007-06-10 08:42:06
|
Hi, Thank you for your help. It'll really save my time. (I would probably missed the GetWorldBoundingBox function!). A question (which will help me to understand the code better): The original ClearPlayers functions were using GetAgentBody function which uses FindChildSupportingClass function. It was unable to find any Body node in the AgentAspect's children (body AgentAspect). But when I modified the GetAgentBody function to use GetChildSupportingClass (or maybe the GetChildOfClass, I don't remember now!), it successfully returned the first Body object. (This is the function that the GetBody function uses). Why the FindChildSupportingClass function is unable to find an object of the Body class while there is such an object in it's children?! Thanks for your patience, Hedayat -----Original Message----- From: Joschka Boedecker <jbo...@un...> To: Hedayat Vatankhah <hed...@ai...> Cc: Simspark Devel ML <sim...@li...> Sent: Sun, 10 Jun 2007 11:11 am Subject: Re: [simspark-devel] About SoccerRules Hi Hedayat,? ? Hedayat Vatankhah wrote:? > Hi Hesham,? > OK, from now, I'll (hopefully!) add new function(s) to calculate the > AABB2 or AABB3 around an agent to be used instead of a single position > in functions such as ClearPlayers functions.? ? Just some thoughts which might make this task easier:? ? Each agent is linked into the SceneGraph at a position "/usr/scene/AgentAspectX" in the virtual file system of the zeitgeist framework, with X being the ID of the agent. All the nodes of the agent will be below this node. The actual AgentAspect of the SoccerBot, e.g. for agent with ID 1, will then be at:? ? /usr/scene/AgentAspect1/spaceman/body? ? The "spaceman" is the collision space that encapsulates all the nodes of the agent, and "body" is the name that we set for the AgentAspect in the soccerbot.rsg file.? ? If you have the AgentAspect of a certain agent and you want to get the bounding box containing all of the agents bodies, it should be sufficient to get to the collision space using GetParent and then using the GetWorldBoundingBox method (implemented in the BaseNode class, from which Space is derived). Just to be sure, you could do a UpdateHierarchy (also from BaseNode) before you get the bounding box, but I think it is not necessary.? ? Cheers,? Joschka? ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection. |