Convert motion_frequency to floating point

This commit is contained in:
Simon Detheridge 2015-06-24 10:52:21 +01:00
parent 1a37504b09
commit d75a15136d
2 changed files with 4 additions and 6 deletions

View File

@ -731,7 +731,7 @@ public:
{
//Original only pulls these from the first motion xform which is a bug. Want to pull it from each one.
Xform<T>& currentMot = xform.m_Motion[i];
intmax_t freq = currentMot.m_MotionFreq;
T freq = currentMot.m_MotionFreq;
eMotion func = currentMot.m_MotionFunc;
//Clamp these to the appropriate range after all are applied.
@ -1232,7 +1232,7 @@ public:
T m_Animate;//Whether or not this xform rotates during animation. 0 means stationary, > 0 means rotate. Use T instead of bool so it can be interpolated.
T m_Wind[2];
eMotion m_MotionFunc;
intmax_t m_MotionFreq;
T m_MotionFreq;
vector<Xform<T>> m_Motion;
string m_Name;

View File

@ -971,7 +971,7 @@ private:
if (theXform)
{
//Check for non-zero motion params.
if (theXform->m_MotionFreq != 0)//Original checked for motion func being non-zero, but it was set to MOTION_SIN (1) in Xform::Init(), so don't check for 0 here.
if (abs(theXform->m_MotionFreq) > 0.0)//Original checked for motion func being non-zero, but it was set to MOTION_SIN (1) in Xform::Init(), so don't check for 0 here.
{
m_ErrorReport.push_back(string(loc) + " : Motion parameters should not be specified in regular, non-motion xforms");
}
@ -1047,9 +1047,7 @@ private:
else if (ParseAndAssignFloat(curAtt->name, attStr, "animate", xform.m_Animate, success)) { }
else if (ParseAndAssignFloat(curAtt->name, attStr, "opacity", xform.m_Opacity, success)) { }
else if (ParseAndAssignFloat(curAtt->name, attStr, "var_color", xform.m_DirectColor, success)) { }
//Parse simple int reads.
else if (ParseAndAssignInt(curAtt->name, attStr, "motion_frequency", xform.m_MotionFreq, success)) { }
else if (ParseAndAssignFloat(curAtt->name, attStr, "motion_frequency", xform.m_MotionFreq, success)) { }
//Parse more complicated reads that have multiple possible values.
else if (!Compare(curAtt->name, "name"))