O'Reilly logo

3D Game Development with Microsoft Silverlight 3 Beginner's Guide by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action—adding parallel physics bodies and geometries to 3D characters

We are now going to add a body and geometry to represent the UFO in the physics engine world. This is our first attempt to add physics using Farseer Physics Engine.

  1. Stay in the project 3DInvadersSilverlight.
  2. Open Ufo.cs.
  3. Add the following lines of code at the beginning (as we are going to use many of Farseer's classes and interfaces):
    using FarseerGames.FarseerPhysics;
    using FarseerGames.FarseerPhysics.Collisions;
    using FarseerGames.FarseerPhysics.Dynamics;
    using FarseerGames.FarseerPhysics.Factories;
    using FarseerGames.FarseerPhysics.Mathematics;
    
  4. Add the following public properties:
    public Body Body { get; private set; } public Geom Geom { get; private set; } public float ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required