mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-13 10:32:16 +02:00
put the ik optimized part of the conditional inside a android build define statement
This commit is contained in:
parent
48f512a553
commit
e72cc8b16e
3 changed files with 16 additions and 15 deletions
|
@ -134,7 +134,6 @@ void AnimClip::copyFromNetworkAnim() {
|
|||
const float animationUnitScale = extractScale(animModel.offset).y;
|
||||
const float avatarHeightInMeters = avatarUnitScale * avatarHipsAbsoluteDefaultPose.trans().y;
|
||||
const float animHeightInMeters = animationUnitScale * animHipsAbsoluteDefaultPose.trans().y;
|
||||
qCDebug(animation) << "meters per unit, avatar: " << avatarUnitScale << " and height of avatar " << avatarHeightInMeters;
|
||||
|
||||
// get the parent scales for the avatar and the animation
|
||||
float avatarHipsParentScale = 1.0f;
|
||||
|
@ -155,7 +154,7 @@ void AnimClip::copyFromNetworkAnim() {
|
|||
const float avatarToAnimationHeightRatio = avatarHeightInMeters / animHeightInMeters;
|
||||
const float unitsRatio = 1.0f / (avatarUnitScale / animationUnitScale);
|
||||
const float parentScaleRatio = 1.0f / (avatarHipsParentScale / animHipsParentScale);
|
||||
qCDebug(animation) << "height ratio: " << avatarToAnimationHeightRatio << " units ratio " << unitsRatio << " parent Scale Ratio " << parentScaleRatio;
|
||||
|
||||
boneLengthScale = avatarToAnimationHeightRatio * unitsRatio * parentScaleRatio;
|
||||
}
|
||||
|
||||
|
|
|
@ -1064,17 +1064,18 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
|
||||
t += deltaTime;
|
||||
|
||||
if (_enableInverseKinematics) {
|
||||
_animVars.set("ikOverlayAlpha", 1.0f);
|
||||
_animVars.set("splineIKEnabled", true);
|
||||
_animVars.set("leftHandIKEnabled", true);
|
||||
_animVars.set("rightHandIKEnabled", true);
|
||||
_animVars.set("leftFootIKEnabled", true);
|
||||
_animVars.set("rightFootIKEnabled", true);
|
||||
_animVars.set("leftFootPoleVectorEnabled", true);
|
||||
_animVars.set("rightFootPoleVectorEnabled", true);
|
||||
} else {
|
||||
_animVars.set("ikOverlayAlpha", 0.0f);
|
||||
if (_enableInverseKinematics != _lastEnableInverseKinematics) {
|
||||
if (_enableInverseKinematics) {
|
||||
_animVars.set("ikOverlayAlpha", 1.0f);
|
||||
} else {
|
||||
_animVars.set("ikOverlayAlpha", 0.0f);
|
||||
}
|
||||
}
|
||||
_lastEnableInverseKinematics = _enableInverseKinematics;
|
||||
|
||||
#if defined(Q_OS_ANDROID) || defined(HIFI_USE_OPTIMIZED_IK)
|
||||
|
||||
if (!_enableInverseKinematics) {
|
||||
_animVars.set("splineIKEnabled", false);
|
||||
_animVars.set("leftHandIKEnabled", false);
|
||||
_animVars.set("rightHandIKEnabled", false);
|
||||
|
@ -1085,7 +1086,9 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
_animVars.set("leftFootPoleVectorEnabled", false);
|
||||
_animVars.set("rightFootPoleVectorEnabled", false);
|
||||
}
|
||||
_lastEnableInverseKinematics = _enableInverseKinematics;
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
_lastForward = forward;
|
||||
_lastPosition = worldPosition;
|
||||
|
|
|
@ -1983,7 +1983,6 @@ float Avatar::getUnscaledEyeHeight() const {
|
|||
|
||||
void Avatar::buildUnscaledEyeHeightCache() {
|
||||
float skeletonHeight = getUnscaledEyeHeightFromSkeleton();
|
||||
qCDebug(avatars_renderer) << "unscaled eye height " << skeletonHeight;
|
||||
|
||||
// Sanity check by looking at the model extents.
|
||||
Extents meshExtents = _skeletonModel->getUnscaledMeshExtents();
|
||||
|
|
Loading…
Reference in a new issue