Example #1
0
        protected override void LoadContent()
        {
            arch   = Content.Load <Model>("arch");
            sphere = Content.Load <Model>("sphere");

            Vector2 archPosition = new Vector2(0f, -1f);
            Body3D  arch3D       =
                Body3DFactory.CreateBody3D(
                    arch,
                    world3D.World2D,
                    GraphicsDevice,
                    archPosition,
                    BodyType.Static,
                    basicEffectParams: effectParams);

            world3D.AddBody3D(arch3D);

            Vector2 spherePosition = new Vector2(0f, 5f);
            Body3D  sphere3D       =
                Body3DFactory.CreateBody3D(
                    sphere,
                    world3D.World2D,
                    GraphicsDevice,
                    spherePosition,
                    basicEffectParams: effectParams);

            sphere3D.Body2D.SetRestitution(0.8f);
            sphere3D.Body2D.ApplyAngularImpulse(14f);

            world3D.AddBody3D(sphere3D);
        }
Example #2
0
        protected override void LoadContent()
        {
            ground   = Content.Load <Model>("ground");
            cilinder = Content.Load <Model>("cilinder");

            Vector2 groundPosition = new Vector2(0f, -1f);
            Body3D  ground3D       =
                Body3DFactory.CreateBody3D(
                    ground, world3D.World2D, GraphicsDevice, groundPosition, BodyType.Static);

            world3D.AddBody3D(ground3D);

            Vector2 cilinderPosition = new Vector2(0f, 5f);
            Body3D  cilinder3D       =
                Body3DFactory.CreateBody3D(
                    cilinder, world3D.World2D, GraphicsDevice, cilinderPosition);

            world3D.AddBody3D(cilinder3D);
        }