calculateMassInfo method

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

Calculate the mass information of the shape.

Implementation

@override
	void calculateMassInfo(MassInfo out ) {
		final mass = width * height * depth * density;
		const divid = 1/12;
		out.mass = mass;
		out.inertia.setValues(
			mass * ( height * height + depth * depth ) * divid, 0, 0,
			0, mass * ( width * width + depth * depth ) * divid, 0,
			0, 0, mass * ( width * width + height * height ) * divid
		);
	}