/// <summary> /// Sets the limit points and recalculates the reach cones. /// </summary> /// <param name='_points'> /// _points. /// </param> public void SetLimitPoints(LimitPoint[] points) { if (points.Length < 3) { LogWarning("The polygon must have at least 3 Limit Points."); return; } this.points = points; BuildReachCones(); }
/* * Apply the default initial setup of 4 Limit Points * */ public void ResetToDefault() { points = new LimitPoint[4]; for (int i = 0; i < points.Length; i++) { points[i] = new LimitPoint(); } Quaternion swing1Rotation = Quaternion.AngleAxis(45, Vector3.right); Quaternion swing2Rotation = Quaternion.AngleAxis(45, Vector3.up); points[0].point = (swing1Rotation * swing2Rotation) * axis; points[1].point = (Quaternion.Inverse(swing1Rotation) * swing2Rotation) * axis; points[2].point = (Quaternion.Inverse(swing1Rotation) * Quaternion.Inverse(swing2Rotation)) * axis; points[3].point = (swing1Rotation * Quaternion.Inverse(swing2Rotation)) * axis; BuildReachCones(); }
/* * Apply the default initial setup of 4 Limit Points * */ public void ResetToDefault() { points = new LimitPoint[4]; for (int i = 0; i < points.Length; i++) points[i] = new LimitPoint(); Quaternion swing1Rotation = Quaternion.AngleAxis(45, Vector3.right); Quaternion swing2Rotation = Quaternion.AngleAxis(45, Vector3.up); points[0].point = (swing1Rotation * swing2Rotation) * axis; points[1].point = (Quaternion.Inverse(swing1Rotation) * swing2Rotation) * axis; points[2].point = (Quaternion.Inverse(swing1Rotation) * Quaternion.Inverse(swing2Rotation)) * axis; points[3].point = (swing1Rotation * Quaternion.Inverse(swing2Rotation)) * axis; BuildReachCones(); }