mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:37:46 +02:00
opened up shoulder constraint + other fixes
* bent elbows will be away from the body a bit more. * sped up smoothing of pole vectors
This commit is contained in:
parent
54af6af651
commit
f320610681
2 changed files with 7 additions and 5 deletions
|
@ -1122,7 +1122,9 @@ void AnimInverseKinematics::initConstraints() {
|
||||||
if (0 == baseName.compare("Arm", Qt::CaseSensitive)) {
|
if (0 == baseName.compare("Arm", Qt::CaseSensitive)) {
|
||||||
SwingTwistConstraint* stConstraint = new SwingTwistConstraint();
|
SwingTwistConstraint* stConstraint = new SwingTwistConstraint();
|
||||||
stConstraint->setReferenceRotation(_defaultRelativePoses[i].rot());
|
stConstraint->setReferenceRotation(_defaultRelativePoses[i].rot());
|
||||||
stConstraint->setTwistLimits(-PI / 2.0f, PI / 2.0f);
|
//stConstraint->setTwistLimits(-PI / 2.0f, PI / 2.0f);
|
||||||
|
const float TWIST_LIMIT = 5.0f * PI / 8.0f;
|
||||||
|
stConstraint->setTwistLimits(-TWIST_LIMIT, TWIST_LIMIT);
|
||||||
|
|
||||||
/* KEEP THIS CODE for future experimentation
|
/* KEEP THIS CODE for future experimentation
|
||||||
// these directions are approximate swing limits in root-frame
|
// these directions are approximate swing limits in root-frame
|
||||||
|
@ -1148,7 +1150,7 @@ void AnimInverseKinematics::initConstraints() {
|
||||||
|
|
||||||
// simple cone
|
// simple cone
|
||||||
std::vector<float> minDots;
|
std::vector<float> minDots;
|
||||||
const float MAX_HAND_SWING = PI / 2.0f;
|
const float MAX_HAND_SWING = 5.0f * PI / 8.0f;
|
||||||
minDots.push_back(cosf(MAX_HAND_SWING));
|
minDots.push_back(cosf(MAX_HAND_SWING));
|
||||||
stConstraint->setSwingLimits(minDots);
|
stConstraint->setSwingLimits(minDots);
|
||||||
|
|
||||||
|
|
|
@ -1089,7 +1089,7 @@ void Rig::updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnab
|
||||||
const bool LEFT_HAND = true;
|
const bool LEFT_HAND = true;
|
||||||
const bool RIGHT_HAND = false;
|
const bool RIGHT_HAND = false;
|
||||||
|
|
||||||
const float ELBOW_POLE_VECTOR_BLEND_FACTOR = 0.9f;
|
const float ELBOW_POLE_VECTOR_BLEND_FACTOR = 0.95f;
|
||||||
|
|
||||||
if (leftHandEnabled) {
|
if (leftHandEnabled) {
|
||||||
if (!_isLeftHandControlled) {
|
if (!_isLeftHandControlled) {
|
||||||
|
@ -1260,7 +1260,7 @@ void Rig::updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnab
|
||||||
|
|
||||||
void Rig::updateFeet(bool leftFootEnabled, bool rightFootEnabled, const AnimPose& leftFootPose, const AnimPose& rightFootPose) {
|
void Rig::updateFeet(bool leftFootEnabled, bool rightFootEnabled, const AnimPose& leftFootPose, const AnimPose& rightFootPose) {
|
||||||
|
|
||||||
const float KNEE_POLE_VECTOR_BLEND_FACTOR = 0.9f;
|
const float KNEE_POLE_VECTOR_BLEND_FACTOR = 0.95f;
|
||||||
|
|
||||||
int hipsIndex = indexOfJoint("Hips");
|
int hipsIndex = indexOfJoint("Hips");
|
||||||
|
|
||||||
|
@ -1390,7 +1390,7 @@ glm::vec3 Rig::calculateElbowPoleVector(int handIndex, int elbowIndex, int armIn
|
||||||
|
|
||||||
// give dProj a bit of offset away from the body.
|
// give dProj a bit of offset away from the body.
|
||||||
float avatarScale = extractUniformScale(_modelOffset);
|
float avatarScale = extractUniformScale(_modelOffset);
|
||||||
const float LATERAL_OFFSET = 0.333f * avatarScale;
|
const float LATERAL_OFFSET = 1.0f * avatarScale;
|
||||||
const float VERTICAL_OFFSET = -0.333f * avatarScale;
|
const float VERTICAL_OFFSET = -0.333f * avatarScale;
|
||||||
glm::vec3 dProjWithOffset = dProj + sign * LATERAL_OFFSET * n + y * VERTICAL_OFFSET;
|
glm::vec3 dProjWithOffset = dProj + sign * LATERAL_OFFSET * n + y * VERTICAL_OFFSET;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue