calculateLocalInertia method

  1. @override
Vec3 calculateLocalInertia(
  1. num mass, [
  2. Vec3? target
])
override

Calculates the inertia in the local frame for this shape. @see http://en.wikipedia.org/wiki/List_of_moments_of_inertia

Implementation

@override
Vec3 calculateLocalInertia(num mass, [Vec3? target]) {
  target ??= Vec3();
  double I = (2.0 * mass * radius * radius) / 5.0;
  target.x = I;
  target.y = I;
  target.z = I;
  return target;
}