You can apply forces (as in F = ma) to objects at any time to make them move.
Gravity in box2d is doing this all the time to make objects fall "down" if you have defined a gravity vector.
So, your fan doesn't have to be a real "object" in the sense that it has a body. You can apply the force from the fan at any time using the methods in box2d to the thing you want the fan to blow on. I have some code for an "EntityController" that applies thrust so it moves in a certain direction (target direction). This is the code for it:
void ApplyThrust()
{
// Get the distance to the target.
Vec2 toTarget = GetTargetPos() - GetBody()->GetWorldCenter();
toTarget.Normalize();
Vec2 desiredVel = GetMaxSpeed()*toTarget;
Vec2 currentVel = GetBody()->GetLinearVelocity();
Vec2 thrust = desiredVel - currentVel;
GetBody()->ApplyForceToCenter(GetMaxLinearAcceleration()*thrust);
}
In this case, the body is moving towards a target. But it could just as easily been the target is the direction the fan is blowing in and now the center of mass of the "thing being blown" is being pushed away from the fan.
All my objects have a maximum speed (GetMaximumSpeed(...)), so this function will only apply force until the object is moving at the max speed and then not apply any more (it is a natural feedback loop).
You are welcome to look at the rest of the code base here on git hub. It is also talked about in this post. Note that this is in cocos2d-x (C++), but the same c++ code will work in cocos2d if you declare the files as .mm (allows c++ code). Or just use the technique without the code as you see fit.
Was this helpful?