Hi ,
i have created an animated skel from an object (the object have animation - open door) , how can i move it in the world ?
i tried :
Code:
door = ObjectPtr(UID(3856963616, 3268566013, 2296428730, 1785660301));
skel.create(door->mesh()->skeleton(), 1.0);
door->mesh()->move(Vec(2.0,0,0));
skel.move(Vec(2.0,0,0));
but this animates the door wrong (it rotates around wrong vector), its like the bones haven't really moved (attached image explains) .
if i don't move it , it plays fine
(This post was last modified: 05-09-2016 05:45 AM by mixpro.)
Instead call animated_skel.updateMatrix(here set custom draw matrix);
AnimatedSkeleton& updateMatrix (C Matrix &body_matrix=MatrixIdentity ); // update 'AnimSkelBone' bones 'matrix' according to bones 'orn rot pos scale' and 'body_matrix', this should be called after animating and applying manual modifications, 'body_matrix' must be normalized, this method also sets skeleton points according to bone matrixes
(05-08-2016 12:33 AM)Esenthel Wrote: don't move mesh or skeleton.
Instead call animated_skel.updateMatrix(here set custom draw matrix);
AnimatedSkeleton& updateMatrix (C Matrix &body_matrix=MatrixIdentity ); // update 'AnimSkelBone' bones 'matrix' according to bones 'orn rot pos scale' and 'body_matrix', this should be called after animating and applying manual modifications, 'body_matrix' must be normalized, this method also sets skeleton points according to bone matrixes
sorry maybe i wasn't clear , by move i meant to create the obj(skel) itself at a certain position not 0,0,0 .
because :
Code:
skel.create(door->mesh()->skeleton(), 1.0);
creates it at 0,0,0 and i wanted it at other location so i asked if it can be moved .