|
|
|
|
|
|
var torqueZ = Mathf.Clamp(vectorAction[1], -1f, 1f) * 150f; |
|
|
|
m_RbA.AddTorque(new Vector3(torqueX, 0f, torqueZ)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ vectorAction[1] * vectorAction[1] |
|
|
|
+ vectorAction[2] * vectorAction[2] |
|
|
|
+ vectorAction[3] * vectorAction[3] |
|
|
|
)); |
|
|
|
+ vectorAction[1] * vectorAction[1] |
|
|
|
+ vectorAction[2] * vectorAction[2] |
|
|
|
+ vectorAction[3] * vectorAction[3] |
|
|
|
)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
{ |
|
|
|
AddReward( - 0.001f * (goal.transform.position - hand.transform.position).magnitude); |
|
|
|
// Debug.Log( - 0.001f * (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); |
|
|
|