+
+ void CalculateShapeInertia(void) {
+ switch(eShapeType) {
+ case esTube:
+ mPMInertia(1,1) = (Weight/(slugtolb))*Radius*Radius; // mr^2
+ mPMInertia(2,2) = (Weight/(slugtolb*12))*(6*Radius*Radius + Length*Length);
+ mPMInertia(3,3) = mPMInertia(2,2);
+ break;
+ case esCylinder:
+ mPMInertia(1,1) = (Weight/(slugtolb*2))*Radius*Radius; // 0.5*mr^2
+ mPMInertia(2,2) = (Weight/(slugtolb*12))*(3*Radius*Radius + Length*Length);
+ mPMInertia(3,3) = mPMInertia(2,2);
+ break;
+ case esSphere:
+ mPMInertia(1,1) = (Weight/(slugtolb*3))*Radius*Radius*2; // (2mr^2)/3
+ mPMInertia(2,2) = mPMInertia(1,1);
+ mPMInertia(3,3) = mPMInertia(1,1);
+ case esBall:
+ mPMInertia(1,1) = (Weight/(slugtolb*5))*Radius*Radius*2; // (2mr^2)/5
+ mPMInertia(2,2) = mPMInertia(1,1);
+ mPMInertia(3,3) = mPMInertia(1,1);
+ break;
+ default:
+ break;
+ }
+ }
+
+ enum esShape {esUnspecified, esTube, esCylinder, esSphere, esBall} eShapeType;