mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
changed pose orientation calculation
This commit is contained in:
@@ -61,7 +61,15 @@ namespace vb01{
|
||||
void Bone::setPoseRot(Quaternion r){
|
||||
this->poseRot = r;
|
||||
setOrientation(restRot);
|
||||
Quaternion parentSpacePoseRot = parent->globalToLocalOrientation(localToGlobalOrientation(r));
|
||||
|
||||
Quaternion parentSpacePoseRot = Quaternion::QUAT_W;
|
||||
vector<Node*> ancestors = getAncestors(this);
|
||||
for(int i = 0; i < ancestors.size(); i++)
|
||||
parentSpacePoseRot = parentSpacePoseRot * ancestors[i]->getOrientation();
|
||||
for(int i = ancestors.size() - 1; i > 0; i--)
|
||||
parentSpacePoseRot = parentSpacePoseRot * ancestors[i]->getOrientation().conj();
|
||||
parentSpacePoseRot = r * parentSpacePoseRot;
|
||||
|
||||
setOrientation(parentSpacePoseRot);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user