浏览代码

lower tennis height

/asymm-envs
Andrew Cohen 5 年前
当前提交
8376b862
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 7
      Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs

7
Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs


var rotate = Mathf.Clamp(vectorAction[2], -1f, 1f) * m_InvertMult;
var upward = 0.0f;
if (moveY > 0.0 && transform.position.y - transform.parent.transform.position.y < 0f)
if (moveY > 0.0 && transform.position.y - transform.parent.transform.position.y < -1.5f)
//m_AgentRb.AddForce(new Vector3(moveX * 20f, upward * 10f, 0f), ForceMode.VelocityChange);
Quaternion deltaRotation = Quaternion.Euler(zAxis * rotateZ);// * .5f);
Quaternion deltaRotation = Quaternion.Euler(zAxis * rotateZ * .5f);
m_AgentRb.MoveRotation(m_AgentRb.rotation * deltaRotation);
//gameObject.transform.Rotate(0f, 0f, rotateZ);

transform.position.z);
}
var rgV = m_AgentRb.velocity;
m_AgentRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -20, 20), Mathf.Min(rgV.y, 20f), rgV.z);
m_AgentRb.velocity = new Vector3(Mathf.Clamp(rgV.x, -20, 20), Mathf.Min(rgV.y, 10f), rgV.z);
// energy usage penalty cumulant
energyPenalty += -0.001f * (Mathf.Abs(moveX) + upward);

正在加载...
取消
保存