mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 13:33:38 +02:00
used avatar constants from AvatarConstants.h to initialize tpposehips and tposerightfoot, and added space between multiplication to meet coding standards
This commit is contained in:
parent
85b7a9b67c
commit
12cb212dc7
1 changed files with 4 additions and 4 deletions
|
@ -3060,8 +3060,8 @@ glm::vec3 MyAvatar::computeCounterBalance() {
|
|||
JointMass cgLeftHandMass(QString("LeftHand"), DEFAULT_AVATAR_LEFTHAND_MASS, glm::vec3(0.0f, 0.0f, 0.0f));
|
||||
JointMass cgRightHandMass(QString("RightHand"), DEFAULT_AVATAR_RIGHTHAND_MASS, glm::vec3(0.0f, 0.0f, 0.0f));
|
||||
glm::vec3 tposeHead = DEFAULT_AVATAR_HEAD_POS;
|
||||
glm::vec3 tposeHips = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
glm::vec3 tposeRightFoot = glm::vec3(0.0f, -1.0f, 0.0f);
|
||||
glm::vec3 tposeHips = DEFAULT_AVATAR_HIPS_POS;
|
||||
glm::vec3 tposeRightFoot = DEFAULT_AVATAR_RIGHTFOOT_POS;
|
||||
|
||||
if (_skeletonModel->getRig().indexOfJoint(cgHeadMass.name) != -1) {
|
||||
cgHeadMass.position = getAbsoluteJointTranslationInObjectFrame(_skeletonModel->getRig().indexOfJoint(cgHeadMass.name));
|
||||
|
@ -3107,8 +3107,8 @@ glm::vec3 MyAvatar::computeCounterBalance() {
|
|||
glm::vec3 xzDiff((cgHeadMass.position.x - counterBalancedCg.x), 0.0f, (cgHeadMass.position.z - counterBalancedCg.z));
|
||||
float headMinusHipXz = glm::length(xzDiff);
|
||||
float headHipDefault = glm::length(tposeHead - tposeHips);
|
||||
float hipFootDefault = glm::length(tposeHips - tposeRightFoot);
|
||||
float sitSquatThreshold = tposeHips.y - (UPPER_LEG_FRACTION*hipFootDefault);
|
||||
float hipFootDefault = tposeHips.y - tposeRightFoot.y;
|
||||
float sitSquatThreshold = tposeHips.y - (UPPER_LEG_FRACTION * hipFootDefault);
|
||||
float hipHeight = 0.0f;
|
||||
if (headHipDefault > headMinusHipXz) {
|
||||
hipHeight = sqrtf((headHipDefault * headHipDefault) - (headMinusHipXz * headMinusHipXz));
|
||||
|
|
Loading…
Reference in a new issue