/// <summary>
        /// Shoots a FlyingObject
        /// </summary>
        /// <returns></returns>
        public FlyingObject Shoot()
        {
            var fObject = new FlyingObject(null, model, 5);

            fObject.Start();
            angle.Z = (float)GeometryMath.RadianToDegree(
                GeometryMath.GetZAngle(fObject.PhysicalBody.Velocity));
            angle.Y = (float)GeometryMath.RadianToDegree(
                GeometryMath.GetYAngle(fObject.PhysicalBody.Velocity));
            explosion.Explode();

            return fObject;
        }
示例#2
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();
        }
示例#3
0
        private void Shoot()
        {
            //3 is the blur stack size
            var managedModel = ModelManager.GetRandomModel();

            var fObject = new FlyingObject(Parent, managedModel.model, 3);
            fObject.Location = new Vector(-10 + GeneralMath.RandomInt() % 20, -20f, 0f);
            fObject.ModelReference = managedModel;
            fObject.Start();

            flyingObjects.Add(fObject);
        }