/// <summary> /// The new line on which the cone should be modeled around /// </summary> /// <param name="rotation">The rotation of the cone</param> /// <param name="q">The quadrant the bone is inside</param> /// <param name="radius">The x,y radius of the cone</param> /// <returns>The new Line on which the cone should be modeled</returns> private Vector3 GetNewL(Quaternion rotation, Quadrant q, Vector2 radius) { Quaternion inverRot = Quaternion.Invert(rotation); Vector3 right = Vector3.Transform(Vector3.UnitX, inverRot); Vector3 forward = Vector3.Transform(Vector3.UnitZ, inverRot); Vector3 L2; switch (q) { case Quadrant.q1: if (radius.X > 90) { L2 = right; } else { L2 = forward; } break; case Quadrant.q2: if (radius.X > 90) { L2 = right; } else { L2 = -forward; } break; case Quadrant.q3: if (radius.X > 90) { L2 = -right; } else { L2 = -forward; } break; case Quadrant.q4: if (radius.X > 90) { L2 = -right; } else { L2 = forward; } break; default: L2 = right; break; } L2.NormalizeFast(); return(L2); }