Example #1
0
 public virtual void createRecBody(float density, float bounce, float friction, bool fixedRotation, bool isStatic)
 {
     body               = BodyFactory.CreateRectangle(doc.getWorld(), ConvertUnits.ToSimUnits(tex.Width * scale * Scale.X), ConvertUnits.ToSimUnits(tex.Height * scale * Scale.Y), density, new Vector2(ConvertUnits.ToSimUnits(x), ConvertUnits.ToSimUnits(y)));
     body.BodyType      = BodyType.Dynamic;
     body.Restitution   = bounce;
     body.Friction      = friction;
     body.FixedRotation = fixedRotation;
     body.IsStatic      = isStatic;
 }