As a farseer/box2d newb I'm still fighting with collision management, especially with broad phase check at the moment.
During debugging the operation where player shoots bullets I noticed that the collisions seem to occur during object creation time. Meaning that when I, as a player, press button to shoot a new bullet entity with physics body/fixture is created. And before
the object has been fully created farseer reports a broadphase collision with the player ship and the bullet (both have bodies). Seems to be occuring just after the body has been added to the physics World...
Should this happen like this?
On my Bullet constructor I set the flags for ignoring collisions with certain types of objects, but Farseer reports a collision before the constructor has been able to call "IgnoreCollisionWith" etc.
Entity class has Shoot()-method:
Bullet bullet = new Bullet(bulletTexture, Owner.LevelBounds, Owner.World, TTL, Owner);
bullet.Body.Position = Owner.Body.Position;
bullet.Body.Rotation = Owner.Body.Rotation;
... etc ...
// We don't want this bullet to report collision with the source ship
How bullet constructor creates a body using BodyFactory.CreateCircle() and sets all other parameters like IsSensor, IsBullet etc.
Farseer reports broad phase collision with the bullet and originating ship when I set the position for the bullet's body, and before the Shoot() method has finished. Shoot is not called during World.Step(), it's called in the game Update()-loop when player
has pressed a required button/key.
Oh, and moving the IgnoreCollisionWith()-calls before the line which sets bullets position does not help either...
Am I misunderstanding something?