• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IWorld类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IWorld的典型用法代码示例。如果您正苦于以下问题:C# IWorld类的具体用法?C# IWorld怎么用?C# IWorld使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IWorld类属于命名空间,在下文中一共展示了IWorld类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Draw

        public override void Draw(Microsoft.Xna.Framework.Graphics.Texture2D ImageToProcess, RenderHelper rHelper, Microsoft.Xna.Framework.GameTime gt, PloobsEngine.Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatBuffer)
        {

            if (firstTime)
            {
                oldViewProjection = world.CameraManager.ActiveCamera.ViewProjection;
                firstTime = false;
            }

            effect.Parameters["attenuation"].SetValue(Attenuation);
            effect.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);
            effect.Parameters["InvertViewProjection"].SetValue(Matrix.Invert(world.CameraManager.ActiveCamera.ViewProjection));
            effect.Parameters["oldViewProjection"].SetValue(oldViewProjection);
            effect.Parameters["numSamples"].SetValue(NumSamples);
            effect.Parameters["depth"].SetValue(rHelper[PrincipalConstants.DephRT]);
            effect.Parameters["extra"].SetValue(rHelper[PrincipalConstants.extra1RT]);
            effect.Parameters["cena"].SetValue(ImageToProcess);

            oldViewProjection = world.CameraManager.ActiveCamera.ViewProjection;

            if (useFloatBuffer)
                rHelper.RenderFullScreenQuadVertexPixel(effect, SamplerState.PointClamp);
            else
                rHelper.RenderFullScreenQuadVertexPixel(effect, GraphicInfo.SamplerState);
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:25,代码来源:MotionBlurPostEffect.cs


示例2: CameraFollowPath

 public CameraFollowPath(CameraPathData data,IWorld world , String nextCam )
 {            
     this.world = world;
     this.nextCam = nextCam;
     this.data = data;            
     _projection = Matrix.CreatePerspectiveFieldOfView(_fieldOdView, _aspectRatio, _nearPlane, _farPlane);
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:CameraFollowPath.cs


示例3: SetWorldAndRenderTechnich

 protected override void SetWorldAndRenderTechnich(out IRenderTechnic renderTech, out IWorld world)
 {
     world = new IWorld(new BepuPhysicWorld(), new SimpleCuller());
     DeferredRenderTechnicInitDescription desc = DeferredRenderTechnicInitDescription.Default();            
     desc.UseFloatingBufferForLightMap = false;
     renderTech = new DeferredRenderTechnic(desc) ;   
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:SpotLightScreen.cs


示例4: ValidPlacement

 public static bool ValidPlacement(BlockDescriptor descriptor, IWorld world)
 {
     var below = world.GetBlockID(descriptor.Coordinates + Coordinates3D.Down);
     if (below != SugarcaneBlock.BlockID && below != GrassBlock.BlockID && below != DirtBlock.BlockID)
         return false;
     var toCheck = new[]
     {
         Coordinates3D.Down + Coordinates3D.Left,
         Coordinates3D.Down + Coordinates3D.Right,
         Coordinates3D.Down + Coordinates3D.Backwards,
         Coordinates3D.Down + Coordinates3D.Forwards
     };
     if (below != BlockID)
     {
         bool foundWater = false;
         for (int i = 0; i < toCheck.Length; i++)
         {
             var id = world.GetBlockID(descriptor.Coordinates + toCheck[i]);
             if (id == WaterBlock.BlockID || id == StationaryWaterBlock.BlockID)
             {
                 foundWater = true;
                 break;
             }
         }
         return foundWater;
     }
     return true;
 }
开发者ID:Luigifan,项目名称:TrueCraft,代码行数:28,代码来源:SugarcaneBlock.cs


示例5: Draw

        public override void Draw(Texture2D ImageToProcess,RenderHelper rHelper, GameTime gt, Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatingBuffer)
        {            
            rHelper.PushRenderTarget(renderTarget1);
            Saturate.Parameters["current"].SetValue(ImageToProcess);
            Saturate.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);
            if(useFloatingBuffer)
                rHelper.RenderFullScreenQuadVertexPixel(Saturate,SamplerState.PointClamp);
            else
                rHelper.RenderFullScreenQuadVertexPixel(Saturate, SamplerState.LinearClamp);

            Texture2D t = rHelper.PopRenderTargetAsSingleRenderTarget2D();

            rHelper.PushRenderTarget(renderTarget0);
            gaussian.Draw(t, rHelper, gt, GraphicInfo, world,useFloatingBuffer);
            Texture2D x = rHelper.PopRenderTargetAsSingleRenderTarget2D();
            rHelper.Clear(Color.Black);

            Combine.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);
            Combine.Parameters["base"].SetValue(ImageToProcess);
            Combine.Parameters["last"].SetValue(x);
            if (useFloatingBuffer)
                rHelper.RenderFullScreenQuadVertexPixel(Combine , SamplerState.PointClamp);
            else
                rHelper.RenderFullScreenQuadVertexPixel(Combine, GraphicInfo.SamplerState);
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:25,代码来源:BloomPostEffect.cs


示例6: BlockLoadedFromChunk

 public override void BlockLoadedFromChunk(Coordinates3D coords, IMultiplayerServer server, IWorld world)
 {
     var chunk = world.FindChunk(coords);
     server.Scheduler.ScheduleEvent("cactus", chunk,
         TimeSpan.FromSeconds(MathHelper.Random.Next(MinGrowthSeconds, MaxGrowthSeconds)),
         s => TryGrowth(s, coords, world));
 }
开发者ID:ComputeLinux,项目名称:TrueCraft,代码行数:7,代码来源:CactusBlock.cs


示例7: Decorate

        public void Decorate(IWorld world, IChunk chunk, IBiomeRepository biomes)
        {
            for (int attempts = 0; attempts < 8; attempts++)
            {
                var noise = new Perlin();
                noise.Seed = world.Seed - (chunk.Coordinates.X + chunk.Coordinates.Z);
                var offsetNoise = new ClampNoise(noise);
                offsetNoise.MaxValue = 3;
                var x = 0;
                var z = 0;
                var offset = 0.0;
                offset += offsetNoise.Value2D(x, z);
                int finalX = (int)Math.Floor(x + offset);
                int finalZ = (int)Math.Floor(z + offset);
                var y = (int)(10 + offset);

                var blockX = MathHelper.ChunkToBlockX(finalX, chunk.Coordinates.X);
                var blockZ = MathHelper.ChunkToBlockZ(finalZ, chunk.Coordinates.Z);
                var spawnValue = offsetNoise.Value2D(blockX, blockZ);
                if (spawnValue > 1.95 && spawnValue < 2.09)
                {
                    var generated = new Dungeon().GenerateAt(world, chunk, new Coordinates3D(blockX, y, blockZ));
                    if (generated)
                        break;
                }
            }
        }
开发者ID:Zoxive,项目名称:TrueCraft,代码行数:27,代码来源:DungeonDecorator.cs


示例8: SandboxedWorld

 internal SandboxedWorld(IWorld world)
 {
     _world = world;
     _accessor = new SandboxedObjectAccessor(_world.Objects);
     _chatListener = new OnChatDelegate(TriggerChat);
     _newUserListener = new OnNewUserDelegate(TriggerNewUser);
 }
开发者ID:JohnMcCaffery,项目名称:XMRM,代码行数:7,代码来源:SandboxedWorld.cs


示例9: BlockUpdate

 public override void BlockUpdate(BlockDescriptor descriptor, BlockDescriptor source, IMultiplayerServer server, IWorld world)
 {
     bool upper = ((DoorItem.DoorFlags)descriptor.Metadata & DoorItem.DoorFlags.Upper) == DoorItem.DoorFlags.Upper;
     var other = upper ? Coordinates3D.Down : Coordinates3D.Up;
     if (world.GetBlockID(descriptor.Coordinates + other) != ID)
         world.SetBlockID(descriptor.Coordinates, 0);
 }
开发者ID:Gbear605,项目名称:TrueCraft,代码行数:7,代码来源:DoorBlock.cs


示例10: Draw

        public override void Draw(Microsoft.Xna.Framework.Graphics.Texture2D ImageToProcess, RenderHelper rHelper, Microsoft.Xna.Framework.GameTime gt, PloobsEngine.Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatBuffer)
        {            
            //mix with last frame downsampled
            if (tex != null)
            {
                rHelper.PushRenderTarget(rtend);
                rHelper.RenderTextureComplete(tex, Color.FromNonPremultiplied(255, 255, 255, 255), GraphicInfo.FullScreenRectangle, Matrix.Identity, null, true, SpriteSortMode.Deferred, SamplerState.LinearClamp);
                rHelper.RenderTextureComplete(ImageToProcess, Color.FromNonPremultiplied(255, 255, 255, Amount), GraphicInfo.FullScreenRectangle, Matrix.Identity, null, true, SpriteSortMode.Deferred, SamplerState.LinearClamp, BlendState.AlphaBlend);                
                end = rHelper.PopRenderTargetAsSingleRenderTarget2D();
            }            

            //DownSample
            rHelper.PushRenderTarget(rt);
            rHelper.Clear(Color.Black);
            if (end == null)
            {
                rHelper.RenderTextureComplete(ImageToProcess, Color.White, rt.Bounds, Matrix.Identity, ImageToProcess.Bounds, true, SpriteSortMode.Deferred, SamplerState.AnisotropicClamp);
            }
            else
            {
                rHelper.RenderTextureComplete(end, Color.White, rt.Bounds, Matrix.Identity, ImageToProcess.Bounds, true, SpriteSortMode.Deferred, SamplerState.AnisotropicClamp);
            }
            tex = rHelper.PopRenderTargetAsSingleRenderTarget2D();                        

            if(end!=null)
                rHelper.RenderTextureComplete(end, Color.White, GraphicInfo.FullScreenRectangle, Matrix.Identity, null, true, SpriteSortMode.Deferred, SamplerState.LinearClamp);
            else
                rHelper.RenderTextureComplete(ImageToProcess, Color.White, GraphicInfo.FullScreenRectangle, Matrix.Identity, null, true, SpriteSortMode.Deferred, SamplerState.LinearClamp);
             
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:30,代码来源:MotionBlurPostEffect.cs


示例11: Initialize

 public override void Initialize()
 {
     this._player = (IPlayer) this.Game.Services.GetService(typeof (IPlayer));
     this._world = (IWorld) this.Game.Services.GetService(typeof (IWorld));
     this._chunkCache = (IChunkCache) this.Game.Services.GetService(typeof (IChunkCache));
     this._blockStorage = (IBlockStorage) this.Game.Services.GetService(typeof (IBlockStorage));
 }
开发者ID:Cyberbanan,项目名称:voxeliq,代码行数:7,代码来源:Shovel.cs


示例12: MoveLoop

 public MoveLoop(Entity o, Area[] d, IWorld map)
     : base(o)
 {
     WorldMap = map;
     Destination = d;
     curDest = 0;
 }
开发者ID:Twistie,项目名称:Tick,代码行数:7,代码来源:MoveLoop.cs


示例13: Location

 public Location(IWorld world, long x, long y, long z)
 {
     m_World = world;
     m_X = x;
     m_Y = y;
     m_Z = z;
 }
开发者ID:Earth2Me,项目名称:Lotu,代码行数:7,代码来源:Location.cs


示例14: Listen

 private void Listen(IWorld source, MRMChatEventArgs args)
 {
     if (args.Channel != 0)
         Host.Object.Say(args.Text + " @ " + args.Channel);
     if (args.Channel == CHAN && args.Text.Equals(PING))
         Host.Object.Say(PING_ACK, CHAN);
 }
开发者ID:JohnMcCaffery,项目名称:RoutingIsland,代码行数:7,代码来源:SimpleButtonScript.cs


示例15: BlockLoadedFromChunk

 public override void BlockLoadedFromChunk(Coordinates3D coords, IMultiplayerServer server, IWorld world)
 {
     var chunk = world.FindChunk(coords);
     server.Scheduler.ScheduleEvent("crops", chunk,
         TimeSpan.FromSeconds(MathHelper.Random.Next(30, 60)),
         (s) => GrowBlock(s, world, coords));
 }
开发者ID:ComputeLinux,项目名称:TrueCraft,代码行数:7,代码来源:CropsBlock.cs


示例16: BlockPlaced

 public override void BlockPlaced(BlockDescriptor descriptor, BlockFace face, IWorld world, IRemoteClient user)
 {
     var chunk = world.FindChunk(descriptor.Coordinates);
     user.Server.Scheduler.ScheduleEvent("crops", chunk,
         TimeSpan.FromSeconds(MathHelper.Random.Next(30, 60)),
         (server) => GrowBlock(server, world, descriptor.Coordinates + MathHelper.BlockFaceToCoordinates(face)));
 }
开发者ID:ComputeLinux,项目名称:TrueCraft,代码行数:7,代码来源:CropsBlock.cs


示例17: PreDrawScene

 public void PreDrawScene(GameTime gameTime, IWorld world, RenderHelper render, GraphicInfo ginfo,List<IObject> objs)
 {
     foreach (IObject item in objs)
     {
         item.Material.PreDrawnPhase(gameTime,world, item,world.CameraManager.ActiveCamera, world.Lights, render);
     }
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:LightPrePassGBuffer.cs


示例18: AlleleManager

 public AlleleManager(IWorld world)
 {
     _controls = new List<IAlleleControl>();
     _alleles = new List<IAllele>();
     _world = world;
     _dominantAlleles = new List<IAllele>();
 }
开发者ID:nheinbaugh,项目名称:PopulationGenetics,代码行数:7,代码来源:AlleleManager.cs


示例19: Draw

 public override void Draw(Texture2D ImageToProcess, RenderHelper rHelper, GameTime gt, Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatingBuffer)
 {        
     if(useFloatingBuffer)
         rHelper.RenderTextureToFullScreenSpriteBatch(ImageToProcess, effect, GraphicInfo.FullScreenRectangle, SamplerState.PointClamp);
     else
         rHelper.RenderTextureToFullScreenSpriteBatch(ImageToProcess, effect, GraphicInfo.FullScreenRectangle, GraphicInfo.SamplerState);            
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:BlackWhitePostEffect.cs


示例20: Wander

        public Wander(Entity o, IWorld map)
            : base(o)
        {
            WorldMap = map;

            curDest = WorldMap.GetArea(random.Next(10), random.Next(10));
        }
开发者ID:Twistie,项目名称:Tick,代码行数:7,代码来源:Wander.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IWpfTextView类代码示例发布时间:2022-05-24
下一篇:
C# IWorkspaceObject类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap