how to get bone tip position?
-
- Gnoblar
- Posts: 3
- Joined: Tue Aug 25, 2020 3:09 am
how to get bone tip position?
Hi,
my problem is similar to this post: viewtopic.php?t=49689
I can get bone's position using _getDerivedPosition() function. However, I can't get the tip position since bone3 doesn't have child bone.
Is there a way to get the position of the tip?
Thank you.
my problem is similar to this post: viewtopic.php?t=49689
I can get bone's position using _getDerivedPosition() function. However, I can't get the tip position since bone3 doesn't have child bone.
Is there a way to get the position of the tip?
Thank you.
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: how to get bone tip position?
That information is lost because it is not exported. Only the head's data is exported.
You can assume the bone to be of a certain size (e.g. 1 unit) and see if it has been preserved through scale: e.g.
Code: Select all
pos = bone3->_getDerivedPosition();
rot = bone3->_getDerivedOrientation();
scale = bone3->_getDerivedScale();
tip = pos + rot * scale.z;
-
- Gnoblar
- Posts: 3
- Joined: Tue Aug 25, 2020 3:09 am
Re: how to get bone tip position?
I see. i'll get the scale factor in Blender.
Thank you!
Thank you!
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: how to get bone tip position?
Btw a much better workaround would be to create a dummy child node; since the child's head is essentially the parent's tip
-
- Gnoblar
- Posts: 3
- Joined: Tue Aug 25, 2020 3:09 am
Re: how to get bone tip position?
Code: Select all
Bone *dummy = bone3->createChild(handle, translate, rotate);
So I still need to get the scale factor in Blender. Or am I using the wrong function?
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: how to get bone tip position?
I meant creating a child bone in Blender