private Vector3 CalculateForce(ITraceable astralBody, int sampleTime) { Vector3 result = new Vector3(0, 0, 0); //求合力 foreach (ITraceable body in astralBody.GetAffectedPlanets()) { if (body == astralBody) { continue; } result += GetGravityVector3(astralBody, body, sampleTime); } //Debug.Log(astralBody.name + " force: " + result); return(result); }