mirror of
https://github.com/lubosz/overte.git
synced 2025-04-14 14:46:55 +02:00
cleaned up print statements
This commit is contained in:
parent
e7941f78d6
commit
2574e82184
3 changed files with 6 additions and 23 deletions
|
@ -199,7 +199,7 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
|||
// if hips are not under direct control, estimate the hips position.
|
||||
if (avatarHeadPose.isValid() && !(params.primaryControllerFlags[Rig::PrimaryControllerType_Hips] & (uint8_t)Rig::ControllerFlags::Enabled)) {
|
||||
bool isFlying = (myAvatar->getCharacterController()->getState() == CharacterController::State::Hover || myAvatar->getCharacterController()->computeCollisionGroup() == BULLET_COLLISION_GROUP_COLLISIONLESS);
|
||||
|
||||
|
||||
// timescale in seconds
|
||||
const float TRANS_HORIZ_TIMESCALE = 0.15f;
|
||||
const float TRANS_VERT_TIMESCALE = 0.01f; // We want the vertical component of the hips to follow quickly to prevent spine squash/stretch.
|
||||
|
@ -255,9 +255,6 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
|||
AnimPose newSpinePose(glm::mat4(glm::vec4(w, 0.0f), glm::vec4(u, 0.0f), glm::vec4(v, 0.0f), glm::vec4(glm::vec3(0.0f, 0.0f, 0.0f), 1.0f)));
|
||||
currentSpine2Pose.rot() = safeLerp(currentSpine2Pose.rot(), newSpinePose.rot(), SPINE2_ROTATION_FILTER);
|
||||
params.primaryControllerPoses[Rig::PrimaryControllerType_Spine2] = currentSpine2Pose;
|
||||
qCDebug(interfaceapp) << "finding the spine 2 azimuth";
|
||||
qCDebug(interfaceapp) << currentSpine2Pose;
|
||||
|
||||
params.primaryControllerFlags[Rig::PrimaryControllerType_Spine2] = (uint8_t)Rig::ControllerFlags::Enabled | (uint8_t)Rig::ControllerFlags::Estimated;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -237,7 +237,6 @@ void AnimInverseKinematics::solve(const AnimContext& context, const std::vector<
|
|||
|
||||
// solve all targets
|
||||
for (size_t i = 0; i < targets.size(); i++) {
|
||||
// qCDebug(animation) << "target id: " << targets[i].getIndex() << " and type " << (int)targets[i].getType();
|
||||
switch (targets[i].getType()) {
|
||||
case IKTarget::Type::Unknown:
|
||||
break;
|
||||
|
@ -259,7 +258,6 @@ void AnimInverseKinematics::solve(const AnimContext& context, const std::vector<
|
|||
|
||||
// ease in expo
|
||||
alpha = 1.0f - powf(2.0f, -10.0f * alpha);
|
||||
qCDebug(animation) << "the alpha for joint chains is " << alpha;
|
||||
|
||||
size_t chainSize = std::min(_prevJointChainInfoVec[i].jointInfoVec.size(), jointChainInfoVec[i].jointInfoVec.size());
|
||||
|
||||
|
@ -322,10 +320,6 @@ void AnimInverseKinematics::solve(const AnimContext& context, const std::vector<
|
|||
}
|
||||
}
|
||||
|
||||
//qCDebug(animation) << "joint chain pose for head animIK " << jointChainInfoVec[4].jointInfoVec[w].trans << " " << jointChainInfoVec[4].jointInfoVec[w].rot;
|
||||
qCDebug(animation) << "absolute pose for head animIK " << absolutePoses[_skeleton->nameToJointIndex("Head")];
|
||||
qCDebug(animation) << "target pose for head animIK " << targets[4].getTranslation() << " " << targets[4].getRotation();
|
||||
|
||||
// compute maxError
|
||||
maxError = 0.0f;
|
||||
for (size_t i = 0; i < targets.size(); i++) {
|
||||
|
@ -366,7 +360,6 @@ void AnimInverseKinematics::solve(const AnimContext& context, const std::vector<
|
|||
// copy jointChainInfoVec into _prevJointChainInfoVec, and update timers
|
||||
for (size_t i = 0; i < jointChainInfoVec.size(); i++) {
|
||||
_prevJointChainInfoVec[i].timer = _prevJointChainInfoVec[i].timer - dt;
|
||||
//qCDebug(animation) << "the alpha for joint chains is " << _prevJointChainInfoVec[i].timer;
|
||||
if (_prevJointChainInfoVec[i].timer <= 0.0f) {
|
||||
_prevJointChainInfoVec[i] = jointChainInfoVec[i];
|
||||
_prevJointChainInfoVec[i].target = targets[i];
|
||||
|
@ -830,9 +823,7 @@ void AnimInverseKinematics::solveTargetWithSpline(const AnimContext& context, co
|
|||
|
||||
AnimPose relPose = parentAbsPose.inverse() * flexedAbsPose;
|
||||
|
||||
|
||||
bool constrained = false;
|
||||
/*
|
||||
if (splineJointInfo.jointIndex != _hipsIndex) {
|
||||
// constrain the amount the spine can stretch or compress
|
||||
float length = glm::length(relPose.trans());
|
||||
|
@ -853,7 +844,7 @@ void AnimInverseKinematics::solveTargetWithSpline(const AnimContext& context, co
|
|||
relPose.trans() = glm::vec3(0.0f);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
jointChainInfoOut.jointInfoVec[i] = { relPose.rot(), relPose.trans(), splineJointInfo.jointIndex, constrained };
|
||||
|
||||
parentAbsPose = flexedAbsPose;
|
||||
|
@ -878,6 +869,7 @@ const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars
|
|||
// disable IK on android
|
||||
return underPoses;
|
||||
#endif
|
||||
|
||||
// allows solutionSource to be overridden by an animVar
|
||||
auto solutionSource = animVars.lookup(_solutionSourceVar, (int)_solutionSource);
|
||||
|
||||
|
@ -885,7 +877,7 @@ const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars
|
|||
if (dt > MAX_OVERLAY_DT) {
|
||||
dt = MAX_OVERLAY_DT;
|
||||
}
|
||||
|
||||
|
||||
if (_relativePoses.size() != underPoses.size()) {
|
||||
loadPoses(underPoses);
|
||||
} else {
|
||||
|
@ -1040,20 +1032,17 @@ const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars
|
|||
|
||||
preconditionRelativePosesToAvoidLimbLock(context, targets);
|
||||
|
||||
//qCDebug(animation) << "hips before ccd" << _relativePoses[_hipsIndex];
|
||||
solve(context, targets, dt, jointChainInfoVec);
|
||||
//qCDebug(animation) << "hips after ccd" << _relativePoses[_hipsIndex];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (context.getEnableDebugDrawIKConstraints()) {
|
||||
debugDrawConstraints(context);
|
||||
}
|
||||
}
|
||||
|
||||
processOutputJoints(triggersOut);
|
||||
|
||||
|
||||
return _relativePoses;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ const AnimPoseVec& AnimTwoBoneIK::evaluate(const AnimVariantMap& animVars, const
|
|||
if (_children.size() != 1) {
|
||||
return _poses;
|
||||
}
|
||||
|
||||
|
||||
// evalute underPoses
|
||||
AnimPoseVec underPoses = _children[0]->evaluate(animVars, context, dt, triggersOut);
|
||||
|
@ -79,7 +78,6 @@ const AnimPoseVec& AnimTwoBoneIK::evaluate(const AnimVariantMap& animVars, const
|
|||
|
||||
// determine if we should interpolate
|
||||
bool enabled = animVars.lookup(_enabledVar, _enabled);
|
||||
// qCDebug(animation) << "two bone var " << _enabledVar;
|
||||
if (enabled != _enabled) {
|
||||
AnimChain poseChain;
|
||||
poseChain.buildFromRelativePoses(_skeleton, _poses, _tipJointIndex);
|
||||
|
@ -123,7 +121,6 @@ const AnimPoseVec& AnimTwoBoneIK::evaluate(const AnimVariantMap& animVars, const
|
|||
// First look in the triggers then look in the animVars, so we can follow output joints underneath us in the anim graph
|
||||
AnimPose targetPose(tipPose);
|
||||
if (triggersOut.hasKey(endEffectorRotationVar)) {
|
||||
qCDebug(animation) << " end effector variable " << endEffectorRotationVar << " is " << triggersOut.lookupRigToGeometry(endEffectorRotationVar, tipPose.rot());
|
||||
targetPose.rot() = triggersOut.lookupRigToGeometry(endEffectorRotationVar, tipPose.rot());
|
||||
} else if (animVars.hasKey(endEffectorRotationVar)) {
|
||||
targetPose.rot() = animVars.lookupRigToGeometry(endEffectorRotationVar, tipPose.rot());
|
||||
|
|
Loading…
Reference in a new issue