|
|
|
|
|
|
torqueZ = Mathf.Clamp(vectorAction[3], -1f, 1f) * 150f; |
|
|
|
m_RbB.AddTorque(new Vector3(torqueX, 0f, torqueZ)); |
|
|
|
|
|
|
|
AddReward( - 0.005f * (vectorAction[0] * vectorAction[0] |
|
|
|
AddReward( - 0.001f * (vectorAction[0] * vectorAction[0] |
|
|
|
+ vectorAction[1] * vectorAction[1] |
|
|
|
+ vectorAction[2] * vectorAction[2] |
|
|
|
+ vectorAction[3] * vectorAction[3] |
|
|
|
|
|
|
{ |
|
|
|
if ((goal.transform.position - hand.transform.position).magnitude > 3.5f) |
|
|
|
{ |
|
|
|
AddReward(-0.001f); |
|
|
|
AddReward(-0.002f); |
|
|
|
// Debug.Log((goal.transform.position - hand.transform.position).magnitude);
|
|
|
|
var radians = m_GoalDegree * Mathf.PI / 180f; |
|
|
|
var goalX = 8f * Mathf.Cos(radians); |
|
|
|
var goalY = 8f * Mathf.Sin(radians); |
|
|
|