当前位置: 首页>>代码示例>>C#>>正文


C# PloobsEngine.ResyncStates方法代码示例

本文整理汇总了C#中PloobsEngine.ResyncStates方法的典型用法代码示例。如果您正苦于以下问题:C# PloobsEngine.ResyncStates方法的具体用法?C# PloobsEngine.ResyncStates怎么用?C# PloobsEngine.ResyncStates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PloobsEngine的用法示例。


在下文中一共展示了PloobsEngine.ResyncStates方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PosWithDepthDraw

        protected override void PosWithDepthDraw(PloobsEngine.SceneControl.RenderHelper render, Microsoft.Xna.Framework.GameTime gt, ref Microsoft.Xna.Framework.Matrix activeView, ref Microsoft.Xna.Framework.Matrix activeProjection)
        {        
            Matrix viewIT = Matrix.Invert(Matrix.Transpose(activeView));
            Vector3 position = new Vector3(viewIT.M14, viewIT.M24, viewIT.M34);

            foreach (var item in Billboards)
            {
                if (item.Enabled)
                {
                    SpriteFont font = item.SpriteFont == null ? SpriteFont : item.SpriteFont;

                    basicEffect.World = Matrix.CreateConstrainedBillboard(item.Position, position, Vector3.Down, null, null);

                    basicEffect.View = activeView;
                    basicEffect.Projection = activeProjection;

                    spriteBatch.Begin(0, null, null, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);

                    Vector2 textOrigin = font.MeasureString(item.Message) / 2;

                    spriteBatch.DrawString(font, item.Message, Vector2.Zero, item.Color, 0, textOrigin, item.Scale, 0, 0);

                    spriteBatch.End();
                }
            }
            render.ResyncStates();
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:27,代码来源:TextCPUCylindricBillboardComponent.cs

示例2: Draw

        protected override void Draw(GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.RenderHelper render, PloobsEngine.Cameras.ICamera cam, IList<PloobsEngine.Light.ILight> lights)
        {
            SpriteAnimated sprite = (obj as ISpriteObject).SpriteAnimated;

            basicEffect.World = Matrix.CreateConstrainedBillboard(obj.PhysicObject.WorldMatrix.Translation, cam.Position, Vector3.Down, null, null);
            basicEffect.View =  cam.View;
            basicEffect.Projection = cam.Projection;

            Vector2 nscale = scale * new Vector2(1f/sprite.NumberAnimations, 1f/sprite.Frame);
            spriteBatch.Begin(0, null, SamplerState.AnisotropicClamp, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);
            spriteBatch.Draw(sprite.Texture, Vector2.Zero, sprite.SourceRectangle, Color.White, sprite.Rotation, sprite.Origin, nscale, SpriteEffects.None, 1);
            spriteBatch.End();
            render.ResyncStates();

            base.Draw(gt, obj, render, cam, lights);
        }
开发者ID:tpastor,项目名称:RandomPrototypes,代码行数:16,代码来源:Sprite3DShader.cs

示例3: PosWithDepthDraw

        protected override void PosWithDepthDraw(PloobsEngine.SceneControl.RenderHelper render, Microsoft.Xna.Framework.GameTime gt, Microsoft.Xna.Framework.Matrix activeView, Microsoft.Xna.Framework.Matrix activeProjection)
        {        
            Matrix viewIT = Matrix.Invert(Matrix.Transpose(activeView));
            Vector3 position = new Vector3(viewIT.M14, viewIT.M24, viewIT.M34);

            foreach (var item in Billboards)
            {
                basicEffect.World = Matrix.CreateConstrainedBillboard(item.Position, position, Vector3.Up, null, null);

                basicEffect.View = activeView;
                basicEffect.Projection = activeProjection;

                spriteBatch.Begin(0, null, null, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);
                spriteBatch.Draw(item.Texture, Vector2.Zero, item.Texture.Bounds, Color.White, 0, new Vector2(item.Texture.Bounds.Center.X, item.Texture.Bounds.Center.Y), item.Scale, SpriteEffects.None, 1);
                spriteBatch.End();
            }
            render.ResyncStates();
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:18,代码来源:CylindricBillboardComponent.cs

示例4: PosWithDepthDraw

        protected override void PosWithDepthDraw(PloobsEngine.SceneControl.RenderHelper render, Microsoft.Xna.Framework.GameTime gt, ref Microsoft.Xna.Framework.Matrix activeView, ref Microsoft.Xna.Framework.Matrix activeProjection)
        {
            Matrix invertY = Matrix.CreateScale(1, -1, 1);

            basicEffect.World = invertY;
            basicEffect.View = Matrix.Identity;
            basicEffect.Projection = activeProjection;

            spriteBatch.Begin(0, null, null, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);

            foreach (var item in Billboards)
            {
                if (item.Enabled)
                {
                    Vector3 viewSpaceTextPosition = Vector3.Transform(item.Position, activeView * invertY);
                    spriteBatch.Draw(item.Texture, new Vector2(viewSpaceTextPosition.X, viewSpaceTextPosition.Y), item.Texture.Bounds, Color.White, 0, new Vector2(item.Texture.Bounds.Center.X, item.Texture.Bounds.Center.Y), item.Scale, SpriteEffects.None, viewSpaceTextPosition.Z);
                }
            }            
    

            spriteBatch.End();
            render.ResyncStates();
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:23,代码来源:CPUSphericalBillboardComponent.cs

示例5: PosWithDepthDraw

        protected override void PosWithDepthDraw(PloobsEngine.SceneControl.RenderHelper render, Microsoft.Xna.Framework.GameTime gt, ref Microsoft.Xna.Framework.Matrix activeView, ref Microsoft.Xna.Framework.Matrix activeProjection)
        {
            Matrix invertY = Matrix.CreateScale(1, -1, 1);

            basicEffect.World = invertY;
            basicEffect.View = Matrix.Identity;
            basicEffect.Projection = activeProjection;

            spriteBatch.Begin(0, null, null, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);

            foreach (var item in Billboards)
            {
                if (item.Enabled)
                {
                    SpriteFont font = item.SpriteFont == null ? SpriteFont : item.SpriteFont;
                    Vector3 viewSpaceTextPosition = Vector3.Transform(item.Position, activeView * invertY);
                    Vector2 textOrigin = font.MeasureString(item.Message) / 2;
                    spriteBatch.DrawString(font, item.Message, new Vector2(viewSpaceTextPosition.X, viewSpaceTextPosition.Y), item.Color, 0, textOrigin, item.Scale, 0, viewSpaceTextPosition.Z);
                }
            }                

            spriteBatch.End();
            render.ResyncStates();
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:24,代码来源:TextCPUSphericalBillboardComponent.cs


注:本文中的PloobsEngine.ResyncStates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。