calculateInertia static method

Vector3 calculateInertia(
  1. Vector3 halfExtents,
  2. num mass,
  3. Vector3 target
)

Implementation

static Vector3 calculateInertia(Vector3 halfExtents,num mass, Vector3 target){
  final Vector3 e = halfExtents;
  target.x = 1.0 / 12.0 * mass * (2 * e.y * 2 * e.y + 2 * e.z * 2 * e.z);
  target.y = 1.0 / 12.0 * mass * (2 * e.x * 2 * e.x + 2 * e.z * 2 * e.z);
  target.z = 1.0 / 12.0 * mass * (2 * e.y * 2 * e.y + 2 * e.x * 2 * e.x);
  return target;
}