src/body/RigidBody.cpp
void RigidBody::setLocalInertiaTensor(const Vector3& inertiaTensorLocal) {

    mWorld.mRigidBodyComponents.setLocalInertiaTensor(mEntity, inertiaTensorLocal);

    // If it is a dynamic body
    const BodyType type = mWorld.mRigidBodyComponents.getBodyType(mEntity);
    if (type == BodyType::DYNAMIC) {

        // Compute the inverse local inertia tensor
        Vector3 inverseInertiaTensorLocal(inertiaTensorLocal.x != decimal(0.0) ? decimal(1.0) / inertiaTensorLocal.x : 0,
                                          inertiaTensorLocal.y != decimal(0.0) ? decimal(1.0) / inertiaTensorLocal.y : 0,
                                          inertiaTensorLocal.z != decimal(0.0) ? decimal(1.0) / inertiaTensorLocal.z : 0);
        mWorld.mRigidBodyComponents.setInverseInertiaTensorLocal(mEntity, inverseInertiaTensorLocal);
    }

    RP3D_LOG(mWorld.mConfig.worldName, Logger::Level::Information, Logger::Category::Body,
             "Body " + std::to_string(mEntity.id) + ": Set inertiaTensorLocal=" + inertiaTensorLocal.to_string(),  __FILE__, __LINE__);
}
// Set the local inertia tensor of the body (in local-space coordinates)
/// Note that an inertia tensor with a zero value on its diagonal is interpreted as infinite inertia.
/**
 * @param inertiaTensorLocal A vector with the three values of the diagonal 3x3 matrix of the local-space inertia tensor
 */
Set the local inertia tensor of the body (in local-space coordinates)
Note that an inertia tensor with a zero value on its diagonal is interpreted as infinite inertia.

@param inertiaTensorLocal A vector with the three values of the diagonal 3x3 matrix of the local-space inertia tensor
Set the local inertia tensor of the body ( in local - space coordinates ) Note that an inertia tensor with a zero value on its diagonal is interpreted as infinite inertia . @param inertiaTensorLocal A vector with the three values of the diagonal 3x3 matrix of the local - space inertia tensor
void RigidBody::setLocalInertiaTensor(const Vector3& inertiaTensorLocal) {
    mWorld.mRigidBodyComponents.setLocalInertiaTensor(mEntity, inertiaTensorLocal);
    const BodyType type = mWorld.mRigidBodyComponents.getBodyType(mEntity);
    if (type == BodyType::DYNAMIC) {
        Vector3 inverseInertiaTensorLocal(inertiaTensorLocal.x != decimal(0.0) ? decimal(1.0) / inertiaTensorLocal.x : 0,
                                          inertiaTensorLocal.y != decimal(0.0) ? decimal(1.0) / inertiaTensorLocal.y : 0,
                                          inertiaTensorLocal.z != decimal(0.0) ? decimal(1.0) / inertiaTensorLocal.z : 0);
        mWorld.mRigidBodyComponents.setInverseInertiaTensorLocal(mEntity, inverseInertiaTensorLocal);
    }
    RP3D_LOG(mWorld.mConfig.worldName, Logger::Level::Information, Logger::Category::Body,
             "Body " + std::to_string(mEntity.id) + ": Set inertiaTensorLocal=" + inertiaTensorLocal.to_string(),  __FILE__, __LINE__);
}
void RigidBody :: setLocalInertiaTensor ( const Vector3 & inertiaTensorLocal ) { mWorld . mRigidBodyComponents . setLocalInertiaTensor ( mEntity , inertiaTensorLocal ) ; const BodyType type = mWorld . mRigidBodyComponents . getBodyType ( mEntity ) ; if ( type == BodyType :: DYNAMIC ) { Vector3 inverseInertiaTensorLocal ( inertiaTensorLocal . x != decimal ( 0.0 ) ? decimal ( 1.0 ) / inertiaTensorLocal . x : 0 , inertiaTensorLocal . y != decimal ( 0.0 ) ? decimal ( 1.0 ) / inertiaTensorLocal . y : 0 , inertiaTensorLocal . z != decimal ( 0.0 ) ? decimal ( 1.0 ) / inertiaTensorLocal . z : 0 ) ; mWorld . mRigidBodyComponents . setInverseInertiaTensorLocal ( mEntity , inverseInertiaTensorLocal ) ; } RP3D_LOG ( mWorld . mConfig . worldName , Logger :: Level :: Information , Logger :: Category :: Body , " " + std :: to_string ( mEntity . id ) + " " + inertiaTensorLocal . to_string ( ) , __FILE__ , __LINE__ ) ; }
Set the local inertia tensor of the body (in local-space coordinates)
Note that an inertia tensor with a zero value on its diagonal is interpreted as infinite inertia.
Set the local inertia tensor of the body ( in local - space coordinates ) Note that an inertia tensor with a zero value on its diagonal is interpreted as infinite inertia .
// If it is a dynamic body // Compute the inverse local inertia tensor