First of all, I'm running the C++ version of Box2D using Visual C++ 2010.
I'm manually moving a body around using SetTransform and it appears that collisions with other bodies seem to be failing. I've set the b2Filter.groupIndex property on all of the objects to 1. This has had no effect. I know that the body is in fact updating it's position because I am rendering it to the screen and it is definitely moving to the specified point.
void PhysicsTests::setBodyPosition( float x, float y )
{
b2Vec2 t = foot->GetTransform().position;
t.x = ( x / width ) * 10; // -- translates screen coords to world coords
t.y = ( y / height ) * 10; // -- translates screen coords to world coords
body->SetTransform( t, 0 );
}
There are a couple of other bodies in the world and I'm expecting to see collisions occurring when I manually move one of them. Perhaps it is an issue of the body having no momentum or velocity?
I'm fairly new to this framework, so any help would be greatly appreciated.
Thanks,
makemachine
I'm manually moving a body around using SetTransform and it appears that collisions with other bodies seem to be failing. I've set the b2Filter.groupIndex property on all of the objects to 1. This has had no effect. I know that the body is in fact updating it's position because I am rendering it to the screen and it is definitely moving to the specified point.
void PhysicsTests::setBodyPosition( float x, float y )
{
b2Vec2 t = foot->GetTransform().position;
t.x = ( x / width ) * 10; // -- translates screen coords to world coords
t.y = ( y / height ) * 10; // -- translates screen coords to world coords
body->SetTransform( t, 0 );
}
There are a couple of other bodies in the world and I'm expecting to see collisions occurring when I manually move one of them. Perhaps it is an issue of the body having no momentum or velocity?
I'm fairly new to this framework, so any help would be greatly appreciated.
Thanks,
makemachine