August 2018
Beginner
334 pages
10h 19m
English
We need to make some modifications to our AgentBehaviour class:
public float maxSpeed; public float maxAccel; public float maxRotation; public float maxAngularAccel;
public float MapToRange (float rotation) {
rotation %= 360.0f;
if (Mathf.Abs(rotation) > 180.0f) {
if (rotation < 0.0f)
rotation += 360.0f;
else
rotation -= 360.0f;
}
return rotation;
}
Read now
Unlock full access