src/body/RigidBody.cpp
void RigidBody::applyWorldForceAtCenterOfMass(const Vector3& force) {

    // If it is not a dynamic body, we do nothing
    if (mWorld.mRigidBodyComponents.getBodyType(mEntity) != BodyType::DYNAMIC) return;

    // Awake the body if it was sleeping
    if (mWorld.mRigidBodyComponents.getIsSleeping(mEntity)) {
        setIsSleeping(false);
    }

    // Add the force
    const Vector3& externalForce = mWorld.mRigidBodyComponents.getExternalForce(mEntity);
    mWorld.mRigidBodyComponents.setExternalForce(mEntity, externalForce + force);
}
// Manually apply an external force (in world-space) to the body at its center of mass.
/// If the body is sleeping, calling this method will wake it up. Note that the
/// force will we added to the sum of the applied forces and that this sum will be
/// reset to zero at the end of each call of the PhyscisWorld::update() method.
/// You can only apply a force to a dynamic body otherwise, this method will do nothing.
/**
 * @param force The external force (in world-space) to apply on the center of mass of the body (in Newtons)
 */
Manually apply an external force (in world-space) to the body at its center of mass.
If the body is sleeping, calling this method will wake it up. Note that the
force will we added to the sum of the applied forces and that this sum will be
reset to zero at the end of each call of the PhyscisWorld::update() method.
You can only apply a force to a dynamic body otherwise, this method will do nothing.

@param force The external force (in world-space) to apply on the center of mass of the body (in Newtons)
Manually apply an external force ( in world - space ) to the body at its center of mass . If the body is sleeping calling this method will wake it up . Note that the force will we added to the sum of the applied forces and that this sum will be reset to zero at the end of each call of the PhyscisWorld :: update () method . You can only apply a force to a dynamic body otherwise this method will do nothing . @param force The external force ( in world - space ) to apply on the center of mass of the body ( in Newtons )
void RigidBody::applyWorldForceAtCenterOfMass(const Vector3& force) {
    if (mWorld.mRigidBodyComponents.getBodyType(mEntity) != BodyType::DYNAMIC) return;
    if (mWorld.mRigidBodyComponents.getIsSleeping(mEntity)) {
        setIsSleeping(false);
    }
    const Vector3& externalForce = mWorld.mRigidBodyComponents.getExternalForce(mEntity);
    mWorld.mRigidBodyComponents.setExternalForce(mEntity, externalForce + force);
}
void RigidBody :: applyWorldForceAtCenterOfMass ( const Vector3 & force ) { if ( mWorld . mRigidBodyComponents . getBodyType ( mEntity ) != BodyType :: DYNAMIC ) return ; if ( mWorld . mRigidBodyComponents . getIsSleeping ( mEntity ) ) { setIsSleeping ( false ) ; } const Vector3 & externalForce = mWorld . mRigidBodyComponents . getExternalForce ( mEntity ) ; mWorld . mRigidBodyComponents . setExternalForce ( mEntity , externalForce + force ) ; }
Manually apply an external force (in world-space) to the body at its center of mass.
Manually apply an external force ( in world - space ) to the body at its center of mass .
// If it is not a dynamic body, we do nothing // Awake the body if it was sleeping // Add the force