# When a mesh is declared as static.....

This topic is 2259 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Since the skinned mesh is declared as static, it just has one hierarchy.
I have a trouble that when I spawn a couple of copies of identical "Objects" attaching to this single copy of mesh, although I can set their world positions correctly, I can't get the unique combined transformations of their hands.

I tried
 f = D3DXFrameFind(mesh->GetFrameRoot(),"Hand"); HandTransform = &f->matCombined; // Same copy no matter how many objects are generated 
where mesh is a static copy of the skinnedmesh
After a 2nd copy is created, the hierarchy is still pointing to the first hierarchy structure. When I try to attach an object to the hand of this 2nd object, it will "jump" to the hand of the 1st object rather than going to the 2nd one.

My first attempt was not to use static Skinned mesh, that means each object would get its own copy of mesh. This method yields the correct result. But i'd like to create once and use everywhere. What is your opinion?
Thanks
Jack

##### Share on other sites
Why don’t you just keep two copies of the animation transforms/joint hierarchies?

L. Spiro

##### Share on other sites
I can do it. But the problem is I am having to load the mesh 3 times when i need 3 objects. So each hierarchy and matrix are separate and unique.
When I just have one mesh object and dishing out to several game objects, I can just keep one matrix which is the original one that I load in.

 f = D3DXFrameFind(root, "Hand"); matrix = &f->matCombined; 
root comes from the single hierarchy, So f will be the same each time.
I don't know why. local transformations should be relative to its world counterparts.
But from the above code, what I've got is the same "matrix"? Anyway that i can be resolved, either on Direct3D or C++ level?
Thanks
Jack

##### Share on other sites
Ok, I think i need to clone the hierarchy and update it. You think so? Thanks Jack