public Real Magnitude() { return(Precision.RealSqrt(x * x + y * y + z * z)); }
/// <summary> /// 设置质量 /// @warning This invalidates internal data for the particle. /// Either an integration function, or the calculateInternals /// function should be called before trying to get any settings /// from the particle. /// </summary> /// <param name="mass"></param> public void SetMass(Real mass) { Assert.IsFalse(Precision.RealApproximately(mass, 0)); _inverseMass = ((Real)1) / mass; }