本文整理汇总了C#中IWorld类的典型用法代码示例。如果您正苦于以下问题:C# IWorld类的具体用法?C# IWorld怎么用?C# IWorld使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IWorld类属于命名空间,在下文中一共展示了IWorld类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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) ;
}
示例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;
}
示例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);
}
示例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));
}
示例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;
}
}
}
示例8: SandboxedWorld
internal SandboxedWorld(IWorld world)
{
_world = world;
_accessor = new SandboxedObjectAccessor(_world.Objects);
_chatListener = new OnChatDelegate(TriggerChat);
_newUserListener = new OnNewUserDelegate(TriggerNewUser);
}
示例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);
}
示例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);
}
示例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));
}
示例12: MoveLoop
public MoveLoop(Entity o, Area[] d, IWorld map)
: base(o)
{
WorldMap = map;
Destination = d;
curDest = 0;
}
示例13: Location
public Location(IWorld world, long x, long y, long z)
{
m_World = world;
m_X = x;
m_Y = y;
m_Z = z;
}
示例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);
}
示例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));
}