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


C# Axis.Initialize方法代码示例

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


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

示例1: LoadContent

        /// <summary>
        ///     LoadContent will be called once per game and is the place to load
        ///     all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            GameFont = Content.Load<SpriteFont>("munro");

            MainCamera = new FirstPersonCamera(GraphicsDevice.Viewport, DefaultFieldOfView, DefaultAspectRatio, 1.0f, 10000.0f);
            SpectatorCamera = new FirstPersonCamera(GraphicsDevice.Viewport, DefaultFieldOfView, DefaultAspectRatio, 1.0f, 10000.0f);

            Axis = new Axis(GraphicsDevice)
            {
                Scale = 0.5f
            };

            Axis.Initialize(MainCamera);

            DebugHud = new DebugHud(GraphicsDevice);

            DebugStringPanel gameStateInformation = new DebugStringPanel
            {
                Padding = new Vector2(0.0f, 35.0f),
                Position = new Vector2(35.0f, 35.0f),
                SpriteFont = GameFont
            };

            gameStateInformation.Add("fps", "FPS: ", Color.Yellow, 0.8f);
            gameStateInformation.Add("delta_time", "Delta Time: ", Color.Yellow, 0.8f);
            gameStateInformation.Add("toggle_debug", "Debug Mode (F1): " + Debugging, Color.White, 1.0f);
            gameStateInformation.Add("spectate_info", "Spectator Camera (P): " + spectating, Color.White, 1.0f);

            DebugHud.DebugStringPanels.Add(gameStateInformation);

            map = new Map.Map();
            map.CreateFromHeightmap(GraphicsDevice, Content.Load<Texture2D>("heightmap"), 1, 10.0f, 0.1f);
            map.InitDebug(GraphicsDevice);

            MainCamera.Position = new Vector3(0, 0, 0);

            DefaultSamplerState = new SamplerState
            {
                Filter = TextureFilter.Anisotropic,
                MaxAnisotropy = 16,
                AddressU = TextureAddressMode.Wrap,
                AddressV = TextureAddressMode.Wrap
            };

            DefaultRasterizerState = new RasterizerState
            {
                CullMode = CullMode.CullClockwiseFace,
                MultiSampleAntiAlias = true,
                FillMode = FillMode.Solid
            };

            ground = Content.Load<Texture2D>("dirt");

            effect = new BasicEffect(GraphicsDevice)
            {
                LightingEnabled = true,
                VertexColorEnabled = false,
                TextureEnabled = true,
                Texture = ground,
                PreferPerPixelLighting = true,
                FogEnabled = false,
                FogColor = Color.SkyBlue.ToVector3(),
                FogStart = 350.0f,
                FogEnd = 2000.0f,
                EmissiveColor = Color.Black.ToVector3(),
                SpecularColor = new Vector3(0.0f, 0.0f, 0.0f),
                SpecularPower = 24,
                AmbientLightColor = Color.Green.ToVector3()
            };

            effect.EnableDefaultLighting();

            particleEffect = new BasicEffect(GraphicsDevice);
            particleEffect.VertexColorEnabled = true;
            particleEffect.TextureEnabled = false;
            particleEffect.LightingEnabled = false;
            particleEffect.Projection = MainCamera.Projection;

            BasicEffect tankEffect = new BasicEffect(GraphicsDevice)
            {
                LightingEnabled = true,
                VertexColorEnabled = false,
                TextureEnabled = true,
                PreferPerPixelLighting = true,
                SpecularPower = 24,
                SpecularColor = new Vector3(0.1f, 0.1f, 0.1f)
            };

            tankEffect.EnableDefaultLighting();

            aiTank = new AiTank(Content);
            aiTank.Position = new Vector3(60.0f, 0.0f, 60.0f);

            tank = new Tank(Content)
            {
                RasterizerState = new RasterizerState(),
//.........这里部分代码省略.........
开发者ID:ruicaridade,项目名称:IP3D,代码行数:101,代码来源:TankSim.cs


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