예제 #1
0
파일: Launcher.cs 프로젝트: THSJF/sjf
 public void Update(_3DPraticleManager manager)
 {
     ++this.time;
     if (this.time == this.times)
     {
         for (int index = 0; index < this.quan; ++index)
         {
             _3DPraticle obj = new _3DPraticle();
             obj.id    = this.id;
             obj.model = this.model;
             obj.scale = this.setting.scale;
             obj.life  = this.setting.life;
             float x = this.setting.scale.X;
             float y = this.setting.scale.Y;
             float z = this.setting.scale.Z;
             obj.Position = new Vector3(MathHelper.Lerp(this.rectvta.X / x, this.rectvtb.X / x, (float)Main.rand.NextDouble()), MathHelper.Lerp(this.rectvta.Y / y, this.rectvtb.Y / y, (float)Main.rand.NextDouble()), MathHelper.Lerp(this.rectvta.Z / z, this.rectvtb.Z / z, (float)Main.rand.NextDouble()));
             obj.speed    = this.setting.speed;
             obj.speed   += new Vector3(MathHelper.Lerp(-this.speedr.X, this.speedr.X, (float)Main.rand.NextDouble()), MathHelper.Lerp(-this.speedr.Y, this.speedr.Y, (float)Main.rand.NextDouble()), MathHelper.Lerp(-this.speedr.Z, this.speedr.Z, (float)Main.rand.NextDouble()));
             obj.acced    = this.setting.acced;
             obj.rotate   = this.setting.rotate;
             obj.rotate  += new Vector3(MathHelper.Lerp(-this.rotater.X, this.rotater.X, (float)Main.rand.NextDouble()), MathHelper.Lerp(-this.rotater.Y, this.rotater.Y, (float)Main.rand.NextDouble()), MathHelper.Lerp(-this.rotater.Z, this.rotater.Z, (float)Main.rand.NextDouble()));
             obj.rotates  = this.setting.rotates;
             obj.fade     = this.fade;
             obj.fadetime = this.setting.fadetime;
             manager.PraticleColleciton.Add(obj);
         }
         this.time = 0;
     }
     if (this.time < this.life)
     {
         return;
     }
     this.die = true;
 }
예제 #2
0
파일: BackGround.cs 프로젝트: THSJF/sjf
        public BackGround(
            ContentManager ct,
            GraphicsDeviceManager gdm,
            GraphicsDevice graphics,
            int stage_i,
            _3DPraticleManager tdpraticle)
        {
            this._3dpraticle = tdpraticle;
            this.stage       = stage_i;
            this.c           = ct;
            this.g           = gdm;
            this.gd          = graphics;
            PresentationParameters presentationParameters = this.g.GraphicsDevice.PresentationParameters;

            this.cameraProjectionMatrix = Matrix.CreatePerspectiveFieldOfView(0.7853982f, 1.333333f, 20f, 600f);
            this.vp  = new Vector3(0.0f, 165.122f, -146.684f);
            this.vtp = new Vector3(0.0f, 30.733f, 0.0f);
            this.vup = new Vector3(0.0f, 1f, 0.0f);
            this.cameraViewMatrix = Matrix.CreateLookAt(this.vp, this.vtp, this.vup);
            this.renderTarget     = new RenderTarget2D(this.g.GraphicsDevice, presentationParameters.BackBufferWidth, presentationParameters.BackBufferHeight, 1, presentationParameters.BackBufferFormat, presentationParameters.MultiSampleType, presentationParameters.MultiSampleQuality);
            this.Anti             = this.g.GraphicsDevice.PresentationParameters.MultiSampleType != MultiSampleType.None;
            this.ModelCollection  = new List <ModelM>();
        }
예제 #3
0
파일: Launcher.cs 프로젝트: THSJF/sjf
 public Launcher(ModelM m, _3DPraticleManager manager)
 {
     this.model   = m;
     this.setting = new _3DPraticle();
     manager?.LauncherCollection.Add(this);
 }