浏览代码

fix inverse lerp

/active-variablespeed
HH 4 年前
当前提交
375fcfff
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 6
      Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs

6
Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs


}
public Vector3 avgVelValue;
public float velDeltaDistance; //distance between the goal and actual vel
float distance = Vector3.Distance(currentVel, velocityGoal);
float percent = Mathf.InverseLerp(m_maxWalkingSpeed, 0, distance);
velDeltaDistance = Vector3.Distance(currentVel, velocityGoal);
// float percent = Mathf.InverseLerp(m_maxWalkingSpeed, 0, velDeltaDistance);
float percent = Mathf.InverseLerp(walkingSpeed, 0, velDeltaDistance);
return percent;
}

正在加载...
取消
保存