示例#1
0
文件: AllyDrawer.cs 项目: himapo/ccm
 public void Draw(IModel model, AffineTransform transform)
 {
     RenderParam.Camera = Camera;
     RenderParam.Transform = transform.WorldMatrix;
     //RenderParam.Alpha = 0.5f;
     RenderManagerAccessor.Instance.RenderModel(model, RenderParam);
 }
示例#2
0
 Matrix GetWorldMatrix(AffineTransform transform)
 {
     var result = Matrix.CreateScale(transform.Scale.X, transform.Scale.Y, transform.Scale.Z);
     result *= Matrix.CreateRotationZ(transform.Rotation.Z);
     result *= Matrix.CreateTranslation(transform.Translation.X, transform.Translation.Y, transform.Translation.Z);
     return result;
 }
示例#3
0
文件: AllyCreator.cs 项目: himapo/ccm
 public Ally Create(
     AllyType type,
     AffineTransform transform)
 {
     return new Ally()
     {
         Model = LoadModel(type),
         Transform = transform,
         Updater = UpdaterCreator(),
         Drawer = DrawerCreator()
     };
 }
示例#4
0
        Matrix CalcWorldMatrix(AffineTransform transform, CameraBase camera)
        {
            var scale = Matrix.CreateScale(transform.Scale);
            var rotat =
                Matrix.CreateRotationZ(transform.Rotation.Z) *
                Matrix.CreateRotationY(transform.Rotation.Y) *
                Matrix.CreateRotationX(transform.Rotation.X) *
                CalcBillboardRotateMatrix(camera);
            var trans = Matrix.CreateTranslation(transform.Translation);

            return scale * rotat * trans;
        }
示例#5
0
文件: Deco_Shock.cs 项目: himapo/ccm
 public Deco_Shock(AffineTransform transform, CameraBase camera)
 {
     for (var i = 0; i < 3; ++i)
     {
         Particles.Add(new ccm.Particle.Particle_Twister(
             transform,
             camera,
             2000.0f,
             120.0f * i,
             360.0f,
             0.0f,
             "Texture/particle001",
             true));
     }
 }
示例#6
0
 public Deco_Twister(AffineTransform transform, CameraBase camera, HimaLib.Math.IRand rand)
 {
     for (var i = 0; i < 16; ++i)
     {
         Particles.Add(new ccm.Particle.Particle_Twister(
             transform,
             camera,
             rand.NextFloat() * 100.0f + 900.0f,
             rand.NextFloat() * 360.0f,
             rand.NextFloat() * 180.0f + 300.0f,
             rand.NextFloat() * 10.0f + 5.0f,
             "Texture/particle000",
             false));
     }
 }
示例#7
0
        void Draw(IModel model, AffineTransform transform)
        {
            toonRenderParam.Camera = Camera;
            toonRenderParam.Transform = transform.WorldMatrix;

            defaultRenderParam.Transform = Matrix.CreateRotationX(MathUtil.ToRadians(-90.0f)) * transform.WorldMatrix;
            defaultRenderParam.ParametersMatrix["World"] = defaultRenderParam.Transform;

            ModelRenderParameter renderParam = defaultRenderParam;

            RenderManagerAccessor.Instance.RenderModel(model, renderParam);

            BillboardRenderParam.Camera = Camera;
            BillboardRenderParam.Alpha = Alpha;
            BillboardRenderParam.AffineTransform = new AffineTransform(
                Vector3.One * 0.004f,
                Vector3.Zero,
                new Vector3(
                    transform.Translation.X + 4.0f,
                    transform.Translation.Y + 8.5f,
                    transform.Translation.Z + 1.0f));
            
            RenderManagerAccessor.Instance.RenderBillboard(Billboard, BillboardRenderParam);
        }
示例#8
0
        public Particle_Twister(
            HimaLib.Math.AffineTransform transform, 
            CameraBase camera,
            float finishMilliSeconds,
            float startDegree,
            float degreeDelta,
            float endHeightDelta,
            string textureName,
            bool loop)
        {
            InitialPosition = new Vector3(transform.Translation);
            Transform = new AffineTransform(transform);

            SimpleBillboardRenderParameter.IsShadowCaster = false;
            SimpleBillboardRenderParameter.IsShadowReceiver = false;
            SimpleBillboardRenderParameter.IsTranslucent = true;
            SimpleBillboardRenderParameter.GBufferEnabled = false;

            SimpleBillboardRenderParameter.Camera = camera;
            SimpleBillboardRenderParameter.Alpha = 0.8f;

            SimpleBillboardRenderParameter.AffineTransform = Transform;
            SimpleBillboardRenderParameter.AffineTransform.Scale = Vector3.One * 0.04f;
            SimpleBillboardRenderParameter.AffineTransform.Rotation = Vector3.Zero;

            SimpleBillboardRenderParameter.Texture = TextureFactory.Instance.CreateFromImage(textureName);

            if (loop)
            {
                CreateUpdater(finishMilliSeconds, startDegree, degreeDelta, endHeightDelta);
            }
            else
            {
                CreateUpdater(finishMilliSeconds, startDegree, degreeDelta, endHeightDelta, () => { Alive = false; });
            }
        }
示例#9
0
 public void CreateEnemy(EnemyType type, AffineTransform transform)
 {
     Enemys.Add(Creator.Create(type, transform));
 }
示例#10
0
 void CreateEnemy(EnemyType type, AffineTransform transform)
 {
     EnemyManager.CreateEnemy(type, transform);
 }
示例#11
0
 /// <summary>
 /// カリングされるか
 /// </summary>
 /// <param name="transform"></param>
 /// <param name="margin"></param>
 /// <returns>視錐台内にあればtrue。残って描画される方がtrue</returns>
 public bool IsCulled(AffineTransform transform, float margin)
 {
     return IsCulled(
         transform.Translation,
         margin);
 }
示例#12
0
        void Update(IModel model, AffineTransform transform)
        {
            Model = model;
            PrevTransform = new AffineTransform(Transform);
            Transform = transform;

            Update();

            Model.Update(TimeKeeper.LastFrameSeconds);

            ComboCounter.Update(TimeKeeper.LastTimeScale);

            IsGround = false;
        }
示例#13
0
 public AffineTransform(AffineTransform src)
     : this(src.Scale, src.Rotation, src.Translation)
 {
 }
示例#14
0
 void CreateShockDeco()
 {
     if (ShockDeco != null)
     {
         return;
     }
     var decoTransform = new AffineTransform(Transform);
     decoTransform.Translation.Y += 12.0f;
     ShockDeco = new Deco_Shock(decoTransform, Camera);
     DecoManager.Add(ShockDeco);
 }
示例#15
0
文件: AllyManager.cs 项目: himapo/ccm
 public void CreateAlly(AllyType type, AffineTransform transform)
 {
     AliveList.Add(Creator.Create(type, transform));
 }
示例#16
0
        void DrawCombo(int count, AffineTransform transform)
        {
            if (count < 2)
            {
                return;
            }

            var screenPosition = MathUtil.Project(
                transform.Translation,
                Camera.View,
                Camera.Projection,
                GameProperty.resolutionWidth,
                GameProperty.resolutionHeight);

            DebugFont.Add(string.Format("{0} Hit", count), 
                screenPosition.X - 20.0f, 
                screenPosition.Y - 120.0f);
        }
示例#17
0
 /// <summary>
 /// 簡易版
 /// </summary>
 /// <param name="transform"></param>
 /// <param name="margin"></param>
 /// <returns></returns>
 public bool IsCulledLight(AffineTransform transform, float margin)
 {
     return IsCulledLight(
         transform.Translation.X,
         transform.Translation.Y,
         transform.Translation.Z,
         margin);
 }
示例#18
0
        public void Update(Ally enemy)
        {
            Ally = enemy;
            PrevTransform = new AffineTransform(Transform);

            Update();
        }
示例#19
0
        public void Update(Enemy enemy)
        {
            Enemy = enemy;
            PrevTransform = new AffineTransform(Transform);

            Update();
        }