got the shoulders working

This commit is contained in:
Dante Ruiz 2017-05-24 19:31:48 +01:00
parent ac3c9655ec
commit 0fdf136251
4 changed files with 12 additions and 24 deletions

View file

@ -121,8 +121,8 @@
"rotationVar": "leftArmRotation",
"typeVar": "leftArmType",
"weightVar": "leftArmWeight",
"weight": 1.0,
"flexCoefficients": [1, 0.5, 0.25, 0.0, 0.0, 0.0]
"weight": 0.75,
"flexCoefficients": [1.0, 0.35, 0.2, 0.1, 0.05, 0.0, 0.0, 0.0]
},
{
"jointName": "RightArm",
@ -130,8 +130,8 @@
"rotationVar": "rightArmRotation",
"typeVar": "rightArmType",
"weightVar": "rightArmWeight",
"weight": 1.0,
"flexCoefficients": [1, 0.5, 0.25, 0.0, 0.0, 0.0]
"weight": 0.75,
"flexCoefficients": [1.0, 0.35, 0.2, 0.1, 0.05, 0.0, 0.0, 0.0]
}
]
},

View file

@ -1049,12 +1049,18 @@ void Rig::updateFromHeadParameters(const HeadParameters& params, float dt) {
}
if (params.leftArmEnabled) {
_animVars.set("leftArmType", (int)IKTarget::Type::RotationAndPosition);
_animVars.set("leftArmPosition", params.leftArmPosition);
_animVars.set("leftArmRotation", params.leftArmRotation);
} else {
_animVars.set("leftArmType", (int)IKTarget::Type::Unknown);
}
if (params.rightArmEnabled) {
_animVars.set("rightArmType", (int)IKTarget::Type::RotationAndPosition);
_animVars.set("rightArmPosition", params.rightArmPosition);
_animVars.set("rightArmRotation", params.rightArmRotation);
} else {
_animVars.set("rightArmType", (int)IKTarget::Type::Unknown);
}

View file

@ -178,7 +178,6 @@ ViveControllerManager::InputDevice::InputDevice(vr::IVRSystem*& system) : contro
_configStringMap[Config::FeetAndHips] = QString("FeetAndHips");
_configStringMap[Config::FeetHipsAndChest] = QString("FeetHipsAndChest");
_configStringMap[Config::FeetHipsAndShoulders] = QString("FeetHipsAndShoulders");
_configStringMap[Config::FeetAndShoulders] = QString("FeetAndShoulders");
}
void ViveControllerManager::InputDevice::update(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) {
@ -342,11 +341,6 @@ void ViveControllerManager::InputDevice::calibrate(const controller::InputCalibr
if (_config == Config::Feet) {
calibrateFeet(defaultToReferenceMat, inputCalibration);
} else if (_config == Config::FeetAndShoulders && puckCount >= MIN_FEET_HIPS_CHEST) {
calibrateFeet(defaultToReferenceMat, inputCalibration);
int firstShoulder = 2;
int secondShoulder = 3;
calibrateShoulders(defaultToReferenceMat, inputCalibration, firstShoulder, secondShoulder);
} else if (_config == Config::FeetAndHips && puckCount >= MIN_FEET_AND_HIPS) {
calibrateFeet(defaultToReferenceMat, inputCalibration);
calibrateHips(defaultToReferenceMat, inputCalibration);
@ -666,10 +660,6 @@ void ViveControllerManager::InputDevice::calibrateShoulders(glm::mat4& defaultTo
}
}
void ViveControllerManager::InputDevice::calibrateHands(glm::mat4& defaultToReferenceMat, const controller::InputCalibrationData& inputCalibration,
PuckPosePair firstHand, PuckPosePair secondHand) {
}
void ViveControllerManager::InputDevice::calibrateHead(glm::mat4& defaultToReferenceMat, const controller::InputCalibrationData& inputCalibration) {
int headIndex = _validTrackedObjects.size() - 1;
}
@ -708,8 +698,6 @@ void ViveControllerManager::InputDevice::setConfigFromString(const QString& valu
_preferedConfig = Config::FeetHipsAndChest;
} else if (value == "FeetHipsAndShoulders") {
_preferedConfig = Config::FeetHipsAndShoulders;
} else if (value == "FeetAndShoulders") {
_preferedConfig = Config::FeetAndShoulders;
}
}
@ -722,7 +710,7 @@ void ViveControllerManager::InputDevice::createPreferences() {
auto getter = [this]()->QString { return _configStringMap[_preferedConfig]; };
auto setter = [this](const QString& value) { setConfigFromString(value); saveSettings(); };
auto preference = new ComboBoxPreference(VIVE_PUCKS_CONFIG, "Configuration", getter, setter);
QStringList list = (QStringList() << "Auto" << "Feet" << "FeetAndHips" << "FeetHipsAndChest" << "FeetAndShoulders");
QStringList list = (QStringList() << "Auto" << "Feet" << "FeetAndHips" << "FeetHipsAndChest" << "FeetHipsAndShoulders");
preference->setItems(list);
preferences->addPreference(preference);

View file

@ -108,14 +108,11 @@ private:
Auto,
Head,
Feet,
Hands,
Shoulders,
FeetAndHips,
FeetAndShoulders,
FeetHipsAndChest,
FeetHipsAndShoulders,
FeetHipsChestAndHands,
FeetHipsShouldersAndHands
FeetHipsChestAndHead
};
Config _config { Config::Auto };
Config _preferedConfig { Config::Auto };
@ -153,9 +150,6 @@ private:
void calibrateHips(glm::mat4& defaultToReferenceMat, const controller::InputCalibrationData& inputCalibration);
void calibrateChest(glm::mat4& defaultToReferenceMat, const controller::InputCalibrationData& inputCalibration);
void calibrateHands(glm::mat4& defaultToReferenceMat, const controller::InputCalibrationData& inputCalibration,
PuckPosePair firstHand, PuckPosePair secondHand);
void calibrateShoulders(glm::mat4& defaultToReferenceMat, const controller::InputCalibrationData& inputCalibration,
int firstShoulderIndex, int secondShoulderIndex);