calculate the change in velocity, when the body is rotated.

The size of my world is twice the size of the screen(single screen, no scrolling world or what so ever exist in my game). Changing it to the screen size doesn't make it work either, if thats what you were asking.

Code:
b2AABB worldAABB;
worldAABB.minVertex.Set(0,0);
worldAABB.maxVertex.Set(WIDTH*2,HEIGHT*2);

//gravity vector;
b2Vec2 gravity(0.0f,25.0f);

bool dosleep = true;

b2World world(worldAABB,gravity,dosleep);


b2Body::IsFrozen():
Code:
char frozen; 
if(body1->IsFrozen())
{
  frozen = 't';
}
else
{
  frozen = 'f';
}

returns false('f').
Is the body somehow constrained? Are you pushing the body into the floor?

Set a breakpoint in b2Island.cpp on this line:

Code:
b->m_linearVelocity += step->dt * (gravity + b->m_invMass * b->m_force);


Does the linear velocity increase? Is m_force non-zero?

I added a test case to the SVN version called "Apply Force". This shows how to apply a force and torque to a body.
The body isn't being pushed down by anything else than what box2d does itself. I tried to download the SVN version, however i seem to get allot of errors when i try to compile the testbed:

Quote:
Error 1 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 2 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 3 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 4 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 5 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 6 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 7 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 8 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 9 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 10 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 11 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 12 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 13 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 14 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 15 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 16 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 17 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 18 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 19 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31
Error 20 error C2248: 'b2NullContact::b2NullContact' : cannot access private member declared in class 'b2NullContact' c:\documents and settings\mads\dokumenter\ny mappe (18)\source\dynamics\b2ContactManager.h 31


I don't really have a clue why it is happening. This is the file:
Code:
/*
* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty.  In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/

#ifndef B2_CONTACT_MANAGER_H
#define B2_CONTACT_MANAGER_H

#include "../Collision/b2BroadPhase.h"
#include "../Dynamics/Contacts/b2NullContact.h"

class b2World;
class b2Contact;

class b2ContactManager : public b2PairCallback
{
public:
   b2ContactManager() : m_world(NULL), m_destroyImmediate(false) {} // this is the line it seems to complain about

   // Implements PairCallback
   void* PairAdded(void* proxyUserData1, void* proxyUserData2);

   // Implements PairCallback
   void PairRemoved(void* proxyUserData1, void* proxyUserData2, void* pairUserData);

   void Collide();

   void CleanContactList();

   void DestroyContact(b2Contact* contact);

   b2World* m_world;

   // This lets us provide broadphase proxy pair user data for
   // contacts that shouldn't exist.
   b2NullContact m_nullContact;

   bool m_destroyImmediate;
};

#endif
Hmm, VC8 seems a bit lenient. I checked in a fix.

Try setting that breakpoint and see what happens to the velocity.
Thanks for including the sample program in your new release! 🙂 it helped to get it working, however, i have to make a change. Could you please explain what a world vector is, and what a world point is? also, why are you passing a vector to a the Get() functions? I see that its defined in b2body.h, but you are using b2Mul() which i though was only for, when multiple bodies where tied together. I have to do the following to get even a small change in velocity:

Code:
b2Vec2 f = body1->GetWorldVector(b2Vec2(0.0f, -200.0f*11170));
            b2Vec2 p = body1->GetWorldPoint(b2Vec2(0.0f, 2.0f));
            body1->ApplyForce(f, p);
b2Mul is for multiplying matrices and vectors.

The GetWorldPoint function takes a point defined in the body's coordinate system and converts it to the world coordinate system. You can read more about this in the manual.
Sorry, couldn't find it the first time in the manual. To answer my own question. My body was too heavy. Sorry for being such a dumb ass 😀
No worries. I'm glad you got it working. This stuff isn't rocket science, but it isn't easy either.
Having the same problem 🙁
Code:
  rad = @body.GetRotation()
      cosa = Math.cos(rad)
      sina = Math.sin(rad)
      force_vector = B2Vec2.new(100 * cosa, 100 * sina);
      @body.ApplyForce(force_vector, @body.GetCenterPosition());


My mass is "0.40" for a little square, i've got some gravity set up, screen is plenty big. What fix was added to svn? IsFrozen returns false for me also. The code is triggered when I press the Up key, am I maybe not applying enough force?

Edit: Oh wow I'm bad. I just increased my force to 10000 and it had an effect. Didn't expect to need this much force!
If you use pixels as units, then you can get some really large force values. Torques will be huge.

Original thread: https://box2d.org/forum/viewtopic.php?t=119