示例#1
0
        public IPhysical MakeCyllinder(double rbottom, double rtop, double height)
        {
            FBody fb = BodyFactory.CreateCircle(World, FarseerConverter.ToSimUnits((float)rbottom), (float)1);

            fb.BodyType = BodyType.Dynamic;
            return(new FarseerBody(fb));
        }
示例#2
0
        //--------------------------------------------------------------------------

        #region Making primitives

        public IPhysical MakeBox(double xsize, double ysize, double zsise)
        {
            FBody fb = BodyFactory.CreateRectangle(World,
                                                   FarseerConverter.ToSimUnits((float)xsize), FarseerConverter.ToSimUnits((float)ysize), (float)1);

            fb.BodyType = BodyType.Dynamic;
            return(new FarseerBody(fb));
        }
示例#3
0
 static public WeldJoint MakeWeldJoint(FBody a, FBody b, Frame3D bBodyOffset)
 {
     return(JointFactory.CreateWeldJoint(World, a, b, new Microsoft.Xna.Framework.Vector2(0, 0),
                                         FarseerConverter.ToSimUnits(new Microsoft.Xna.Framework.Vector2((float)-bBodyOffset.X, (float)-bBodyOffset.Y))));
     //без минусов не работает как надо
 }