Ejemplo n.º 1
0
        private void Initialize()
        {
            StartingLocation = new Vector(0f, 0f, 0f);
            fObject = new FlyingObject(Parent, ModelManager.modelBank[0].model, 7);
            fObject.ShaderProgram = GeneralGraphics.SimulatedLighting;

            var physGui = new Object();
            physGui.Location = new Vector(0f, 0f, 0f);
            PhysicsObject obj = new PhysicsObject();
            obj.Velocity = fObject.PhysicalBody.Velocity;
            obj.ParentObject = physGui;

            for (int i = 0; i < 8; ++i)
            {
                obj.ModulatePhysics();
                obj.ApplyNaturalForces();
            }

            var target = new DecimalVector((decimal)physGui.Location.X,
                (decimal)physGui.Location.Y, (decimal)physGui.Location.Z + 10);
            Camera.MoveTo(target, 60);

            timer = new Timer();
            timer.Interval = 10;
            timer.Tick += AnimationStep;
            timer.Start();
            fObject.Start();
        }