calculateMassInfo method

  1. @override
void calculateMassInfo(
  1. MassInfo out
)
override

Calculate the mass information of the shape.

Implementation

@override
void calculateMassInfo(MassInfo out){
  double rsq = radius * radius;
  double mass = math.pi * rsq * height * density;
  double inertiaXZ = ( ( 0.25 * rsq ) + ( 0.0833 * height * height ) ) * mass;
  double inertiaY = 0.5 * rsq;
  out.mass = mass;
  out.inertia.set( inertiaXZ, 0, 0,  0, inertiaY, 0,  0, 0, inertiaXZ );
}