Jump to content

  • Log In with Google      Sign In   
  • Create Account

accessing/modifying data in a tree structure (hierarchical skeleton)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Adam Romney   Members   -  Reputation: 166

Like
0Likes
Like

Posted 12 January 2013 - 05:05 AM

Given a hierarchical joint/bone structure, what is the fastest/best way to  access a specific node, e.g. LeftKnee?  I take it there is no way to access a node in constant time or am I forgetting something?  Would it be possible to create a map that pairs a string name identifier to the JointNode pointer?  This seems like a bad idea because now there are two structures, the map and the node tree itself.  But otherwise, it would seem that a depth first traversal with string comparison at every step is required every time.  Perhaps this isn't so bad since there are relatively few joint nodes, but doesn't this add up if you have a large population of characters being articulated?

 

If further context is helpful, I'm tracking the location of end effectors, or leaf nodes, and may need to modify a joint node further up the tree via inverse kinematics.   



Sponsor:

#2 mrbastard   Members   -  Reputation: 1573

Like
1Likes
Like

Posted 12 January 2013 - 03:14 PM

Does the hierarchy change? If not, you don't need to store in a tree with actual parent-> child ptrs. Instead, store all the bones in an array/vector, and keep the index of each. Instead of traversing the tree, just look up using the index. Keep a map of strings to indices for lookup in asset loading / ui / scripting, but otherwise refer to joints by their index.







Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS