Skip to content

Commit

Permalink
FIX: fix a bug of getting the feet position
Browse files Browse the repository at this point in the history
  • Loading branch information
Telojuriol committed Apr 11, 2018
1 parent 4a00b1d commit d6c8708
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions source/components/player_controller/comp_player_animator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ void TCompPlayerAnimator::registerMsgs() {
}

void TCompPlayerAnimator::onCreated(const TMsgEntityCreated& msg) {

ownHandle = CHandle(this).getOwner();
CEntity *e = ownHandle;
TCompSkeleton * compSkeleton = e->get<TCompSkeleton>();
assert(compSkeleton);
initializeAnimations();
setFeetNumAndCalculate(2);
}
4 changes: 2 additions & 2 deletions source/components/skeleton/comp_skeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ std::vector<VEC3> TCompSkeleton::getFeetPositions() {
float x = model->getSkeleton()->getBone(feetBonesId[i])->getTranslationAbsolute().x;
float y = model->getSkeleton()->getBone(feetBonesId[i])->getTranslationAbsolute().y;
float z = model->getSkeleton()->getBone(feetBonesId[i])->getTranslationAbsolute().z;
feetPositions[i] = VEC3(x,y,z);
feetPositions.push_back(VEC3(x,y,z));
}

dbg("");
return feetPositions;
}

0 comments on commit d6c8708

Please sign in to comment.