mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 20:17:01 +02:00
whitespace
This commit is contained in:
parent
f68ee4e7ce
commit
ffd374e7d4
2 changed files with 6 additions and 10 deletions
|
@ -44,7 +44,7 @@ static CubicHermiteSplineFunctorWithArcLength computeSplineFromTipAndBase(const
|
||||||
}
|
}
|
||||||
|
|
||||||
static glm::vec3 computeSpine2WithHeadHipsSpline(MyAvatar* myAvatar, AnimPose hipsIKTargetPose, AnimPose headIKTargetPose) {
|
static glm::vec3 computeSpine2WithHeadHipsSpline(MyAvatar* myAvatar, AnimPose hipsIKTargetPose, AnimPose headIKTargetPose) {
|
||||||
|
|
||||||
// the the ik targets to compute the spline with
|
// the the ik targets to compute the spline with
|
||||||
CubicHermiteSplineFunctorWithArcLength splineFinal = computeSplineFromTipAndBase(headIKTargetPose, hipsIKTargetPose);
|
CubicHermiteSplineFunctorWithArcLength splineFinal = computeSplineFromTipAndBase(headIKTargetPose, hipsIKTargetPose);
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,6 @@ AnimSplineIK::AnimSplineIK(const QString& id, float alpha, bool enabled, float i
|
||||||
if (i < MAX_NUMBER_FLEX_VARIABLES) {
|
if (i < MAX_NUMBER_FLEX_VARIABLES) {
|
||||||
_tipTargetFlexCoefficients[i] = tipTargetFlexCoefficients[i];
|
_tipTargetFlexCoefficients[i] = tipTargetFlexCoefficients[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
_numTipTargetFlexCoefficients = std::min((int)tipTargetFlexCoefficients.size(), MAX_NUMBER_FLEX_VARIABLES);
|
_numTipTargetFlexCoefficients = std::min((int)tipTargetFlexCoefficients.size(), MAX_NUMBER_FLEX_VARIABLES);
|
||||||
|
|
||||||
|
@ -70,7 +69,6 @@ AnimSplineIK::~AnimSplineIK() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const AnimPoseVec& AnimSplineIK::evaluate(const AnimVariantMap& animVars, const AnimContext& context, float dt, AnimVariantMap& triggersOut) {
|
const AnimPoseVec& AnimSplineIK::evaluate(const AnimVariantMap& animVars, const AnimContext& context, float dt, AnimVariantMap& triggersOut) {
|
||||||
|
|
||||||
assert(_children.size() == 1);
|
assert(_children.size() == 1);
|
||||||
if (_children.size() != 1) {
|
if (_children.size() != 1) {
|
||||||
return _poses;
|
return _poses;
|
||||||
|
@ -135,8 +133,6 @@ const AnimPoseVec& AnimSplineIK::evaluate(const AnimVariantMap& animVars, const
|
||||||
_poses[_baseJointIndex] = baseParentAbsPose.inverse() * baseTargetAbsolutePose;
|
_poses[_baseJointIndex] = baseParentAbsPose.inverse() * baseTargetAbsolutePose;
|
||||||
_poses[_baseJointIndex].scale() = glm::vec3(1.0f);
|
_poses[_baseJointIndex].scale() = glm::vec3(1.0f);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// initialize the middle joint target
|
// initialize the middle joint target
|
||||||
IKTarget midTarget;
|
IKTarget midTarget;
|
||||||
midTarget.setType((int)IKTarget::Type::Spline);
|
midTarget.setType((int)IKTarget::Type::Spline);
|
||||||
|
@ -167,7 +163,7 @@ const AnimPoseVec& AnimSplineIK::evaluate(const AnimVariantMap& animVars, const
|
||||||
tipTarget.setPose(tipRotation, tipTranslation);
|
tipTarget.setPose(tipRotation, tipTranslation);
|
||||||
tipTarget.setWeight(1.0f);
|
tipTarget.setWeight(1.0f);
|
||||||
tipTarget.setFlexCoefficients(_numTipTargetFlexCoefficients, _tipTargetFlexCoefficients);
|
tipTarget.setFlexCoefficients(_numTipTargetFlexCoefficients, _tipTargetFlexCoefficients);
|
||||||
|
|
||||||
// solve the upper spine spline
|
// solve the upper spine spline
|
||||||
AnimChain upperJointChain;
|
AnimChain upperJointChain;
|
||||||
AnimPoseVec finalAbsolutePoses;
|
AnimPoseVec finalAbsolutePoses;
|
||||||
|
@ -241,7 +237,7 @@ const AnimPoseVec& AnimSplineIK::evaluate(const AnimVariantMap& animVars, const
|
||||||
|
|
||||||
|
|
||||||
} else if (context.getEnableDebugDrawIKTargets() != _previousEnableDebugIKTargets) {
|
} else if (context.getEnableDebugDrawIKTargets() != _previousEnableDebugIKTargets) {
|
||||||
|
|
||||||
// remove markers if they were added last frame.
|
// remove markers if they were added last frame.
|
||||||
QString name = QString("ikTargetSplineTip");
|
QString name = QString("ikTargetSplineTip");
|
||||||
DebugDraw::getInstance().removeMyAvatarMarker(name);
|
DebugDraw::getInstance().removeMyAvatarMarker(name);
|
||||||
|
@ -374,9 +370,9 @@ void AnimSplineIK::solveTargetWithSpline(const AnimContext& context, int base, c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
::blend(1, &absolutePoses[splineJointInfo.jointIndex], &desiredAbsPose, interpedCoefficient, &flexedAbsPose);
|
::blend(1, &absolutePoses[splineJointInfo.jointIndex], &desiredAbsPose, interpedCoefficient, &flexedAbsPose);
|
||||||
|
|
||||||
AnimPose relPose = parentAbsPose.inverse() * flexedAbsPose;
|
AnimPose relPose = parentAbsPose.inverse() * flexedAbsPose;
|
||||||
|
|
||||||
bool constrained = false;
|
bool constrained = false;
|
||||||
if (splineJointInfo.jointIndex != base) {
|
if (splineJointInfo.jointIndex != base) {
|
||||||
// constrain the amount the spine can stretch or compress
|
// constrain the amount the spine can stretch or compress
|
||||||
|
@ -398,7 +394,7 @@ void AnimSplineIK::solveTargetWithSpline(const AnimContext& context, int base, c
|
||||||
relPose.trans() = glm::vec3(0.0f);
|
relPose.trans() = glm::vec3(0.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!chainInfoOut.setRelativePoseAtJointIndex(splineJointInfo.jointIndex, relPose)) {
|
if (!chainInfoOut.setRelativePoseAtJointIndex(splineJointInfo.jointIndex, relPose)) {
|
||||||
qCDebug(animation) << "error: joint not found in spline chain";
|
qCDebug(animation) << "error: joint not found in spline chain";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue