зеркало из https://github.com/microsoft/cocos2d-x.git
fix compiling error on windows
This commit is contained in:
Родитель
269ed214a9
Коммит
d6776b664a
|
@ -111,17 +111,17 @@ void Animate3D::update(float t)
|
|||
auto curve = it.second;
|
||||
if (curve->translateCurve)
|
||||
{
|
||||
curve->translateCurve->evaluate(t, transDst, EvaluateType::LINEAR);
|
||||
curve->translateCurve->evaluate(t, transDst, EvaluateType::INT_LINEAR);
|
||||
trans = &transDst[0];
|
||||
}
|
||||
if (curve->rotCurve)
|
||||
{
|
||||
curve->rotCurve->evaluate(t, rotDst, EvaluateType::QUAT_SLERP);
|
||||
curve->rotCurve->evaluate(t, rotDst, EvaluateType::INT_QUAT_SLERP);
|
||||
rot = &rotDst[0];
|
||||
}
|
||||
if (curve->scaleCurve)
|
||||
{
|
||||
curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::LINEAR);
|
||||
curve->scaleCurve->evaluate(t, scaleDst, EvaluateType::INT_LINEAR);
|
||||
scale = &scaleDst[0];
|
||||
}
|
||||
bone->setAnimationValue(trans, rot, scale, _weight);
|
||||
|
|
|
@ -37,10 +37,10 @@ NS_CC_BEGIN
|
|||
|
||||
enum class EvaluateType
|
||||
{
|
||||
LINEAR,
|
||||
NEAR,
|
||||
QUAT_SLERP,
|
||||
USER_FUNCTION,
|
||||
INT_LINEAR,
|
||||
INT_NEAR,
|
||||
INT_QUAT_SLERP,
|
||||
INT_USER_FUNCTION,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,20 +25,20 @@ void AnimationCurve<componentSize>::evaluate(float time, float* dst, EvaluateTyp
|
|||
float* toValue = fromValue + componentSize;
|
||||
|
||||
switch (type) {
|
||||
case EvaluateType::LINEAR:
|
||||
case EvaluateType::INT_LINEAR:
|
||||
{
|
||||
for (auto i = 0; i < componentSize; i++) {
|
||||
dst[i] = fromValue[i] + (toValue[i] - fromValue[i]) * t;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EvaluateType::NEAR:
|
||||
case EvaluateType::INT_NEAR:
|
||||
{
|
||||
float* src = t > 0.5f ? toValue : fromValue;
|
||||
memcpy(dst, src, _componentSizeByte);
|
||||
}
|
||||
break;
|
||||
case EvaluateType::QUAT_SLERP:
|
||||
case EvaluateType::INT_QUAT_SLERP:
|
||||
{
|
||||
// Evaluate.
|
||||
Quaternion quat;
|
||||
|
@ -50,7 +50,7 @@ void AnimationCurve<componentSize>::evaluate(float time, float* dst, EvaluateTyp
|
|||
dst[0] = quat.x, dst[1] = quat.y, dst[2] = quat.z, dst[3] = quat.w;
|
||||
}
|
||||
break;
|
||||
case EvaluateType::USER_FUNCTION:
|
||||
case EvaluateType::INT_USER_FUNCTION:
|
||||
{
|
||||
if (_evaluateFun)
|
||||
_evaluateFun(time, dst);
|
||||
|
|
Загрузка…
Ссылка в новой задаче