Objects with a bigger mass are no colliding properly

Topics: Developer Forum, User Forum
Mar 15, 2014 at 10:33 AM
Edited Mar 15, 2014 at 10:34 AM
Image

The are bodies are getting into each other , when i set the mass to 0 or 1 , the effect is less visible of them getting into each other.And setting the density to 0 fixes the problem.

CODE

theOrigin = new Vector2((theSprite.GetFrameWidth() ) / 2f, (theSprite.GetFrameHeight() ) / 2f); thePosition = Pos;
Scale = scale;
Vector2 size = new Vector2(32,32);
        if (Type == "dynamic" || Type == "Dynamic")
        {
            theBody = BodyFactory.CreateRectangle(theWorld, ConvertUnits.ToSimUnits(size.X), ConvertUnits.ToSimUnits(size.Y ), 1f);
            theBody.BodyType = BodyType.Dynamic;
            theBody.Mass = 100;

        }
        else
        {
            theBody = BodyFactory.CreateRectangle(theWorld, ConvertUnits.ToSimUnits(size.X ), ConvertUnits.ToSimUnits(size.Y ), 1f);
            theBody.BodyType = BodyType.Static;

        }

        theBody.Position = ConvertUnits.ToSimUnits(thePosition);