This project has moved and is read-only. For the latest updates, please go here.

bullets, kinematic bodies, performance

Feb 11, 2013 at 8:17 PM
I'm using farseer for the physics in my game. I thought I may as well also use it for collision detection.
What Im doing is each bullet is a kinematic bodytype sensor.
The problem is when I generate a lot of them performance takes a big hit..
Heres what I'm doing each time a weapon is fired...
        _bullet = BodyFactory.CreateRectangle(_world, ConvertUnits.ToSimUnits(Globals.SmallGridSize.X),
            ConvertUnits.ToSimUnits(Globals.SmallGridSize.Y), 30f);
        _bullet.Position = ConvertUnits.ToSimUnits(_position.X, _position.Y );
        _bullet.BodyType = BodyType.Kinematic;
        _bullet.IsSensor = true;
Is there a more efficient way of doing this.. ?