Beispiel #1
0
 public Real Magnitude()
 {
     return(Precision.RealSqrt(x * x + y * y + z * z));
 }
Beispiel #2
0
 /// <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;
 }