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


C# GameCamera类代码示例

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


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

示例1: DrawReflectionMap

        public void DrawReflectionMap(GameCamera.FreeCamera camera, float time, LightsAndShadows.Shadow shadow, LightsAndShadows.Light light, QuadTree tree)
        {
            Plane reflectionPlane = CreatePlane(waterHeight - 0.5f, new Vector3(0, -1, 0), camera.reflectionViewMatrix, true);
            //device.ClipPlanes[0].Plane = reflectionPlane;
            //device.ClipPlanes[0].IsEnabled = true;
            //device.SetRenderTarget(0, reflectionRenderTarget);

            effect.Parameters["ClipPlane0"].SetValue(new Vector4(reflectionPlane.Normal, reflectionPlane.D));
            //effect.Parameters["ClipPlane0"].SetValue(new Vector4(-reflectionPlane.Normal, -reflectionPlane.D));

            effect.Parameters["Clipping"].SetValue(true);    // Allows the geometry to be clipped for the purpose of creating a refraction map
            device.SetRenderTarget(reflectionRenderTarget);

            device.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.Black, 1.0f, 0);
            sky.DrawSkyDome(camera);
               // tree.Draw(camera, time, shadow, light);

            //device.ClipPlanes[0].IsEnabled = false;
            effect.Parameters["Clipping"].SetValue(false);

            //device.SetRenderTarget(0, null);
            device.SetRenderTarget(null);

            reflectionMap = reflectionRenderTarget;
            //System.IO.Stream ss = System.IO.File.OpenWrite("C:\Test\Reflection.jpg");
            //reflectionRenderTarget.SaveAsJpeg(ss, 500, 500);
            //ss.Close();
        }
开发者ID:MenosGrandes,项目名称:mrowisko-pbl,代码行数:28,代码来源:Water.cs

示例2: Draw

 public virtual void Draw(GameCamera camera)
 {
     foreach (Particle particle in particles)
     {
         particle.Draw(camera);
     }
 }
开发者ID:NatalieWojciechowski,项目名称:Space394,代码行数:7,代码来源:ParticleGenerator.cs

示例3: Draw

 public override void Draw(GameCamera camera)
 {
     if (Active)
     {
         base.Draw(camera);
     }
 }
开发者ID:NatalieWojciechowski,项目名称:Space394,代码行数:7,代码来源:MissileTrailParticle.cs

示例4: GameMap

        public GameMap(GameModelDTO data)
            : base(data)
        {
            Camera = new GameCamera();

            worldMatrix = new WorldMatrix(this);
        }
开发者ID:ZetaTwo,项目名称:Project-Easter-Egg,代码行数:7,代码来源:GameMap.cs

示例5: Draw

        public override void Draw(GameCamera camera)
        {
            generator.Draw(camera);

            foreach (ModelMesh mesh in Model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.Alpha = transparency;
                }
            }

            base.Draw(camera);

            Scale = Scale + OUTER_EXTRA_SIZE;
            foreach (ModelMesh mesh in explosion.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.Alpha = MathHelper.Max(outerAlpha - transparency, 0);
                }
            }
            drawExtraModel(camera, explosion);
            //foreach (ModelMesh mesh in explosion.Meshes)
            //{
            //    foreach (BasicEffect effect in mesh.Effects)
            //    {
            //        effect.Alpha = 1f;
            //    }
            //}
            Scale = Scale - OUTER_EXTRA_SIZE;
        }
开发者ID:NatalieWojciechowski,项目名称:Space394,代码行数:32,代码来源:Explosion.cs

示例6: Scene

 protected Scene()
 {
     camera = new GameCamera(this, new Vector3(0.0f, 50.0f, 0.0f), new Quaternion(), Space394Game.GameInstance.AspectRatio);
     sceneObjects = new Dictionary<int, SceneObject>();
     queuedForAdd = new List<SceneObject>();
     queuedForRemoval = new List<SceneObject>();
 }
开发者ID:NatalieWojciechowski,项目名称:Space394,代码行数:7,代码来源:Scene.cs

示例7: Player

        public Player()
        {
            Camera = new GameCamera();

            Mysz = new MOIS.MouseState_NativePtr();
            InventoryItem = null;
        }
开发者ID:janPierdolnikParda,项目名称:WorldCreator,代码行数:7,代码来源:Player.cs

示例8: InitializeCamera

		//ncrunch: no coverage end

		private void InitializeCamera()
		{
			Camera = new GameCamera(1 / 25.0f, 1 / 10.0f, 0.01f);
			Camera.AllowedMovementRect = Rectangle.FromCenter(Vector2D.Half,
				new Size(Size.Width, Size.Height) * 1.5f);
			Camera.ResetToMinZoom();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:GameLevel.cs

示例9: Start

    // Use this for initialization
    void Start()
    {
        cam = GetComponent<GameCamera>();
        timer = GetComponentInChildren<Timer>();

        PlayerPrefs.SetInt ("playerScore", 0);
        SpawnPlayer ();
    }
开发者ID:upsidedownquestionmark,项目名称:prototype,代码行数:9,代码来源:GameManager.cs

示例10: Start

 // Use this for initialization
 void Start()
 {
     cam = GetComponent<GameCamera> ();
     if (GameObject.FindGameObjectWithTag("Spawn")) {
         checkpoint = GameObject.FindGameObjectWithTag("Spawn").transform.position;
     }
     spawnPlayer (checkpoint);
 }
开发者ID:ksnovak,项目名称:Senior-Year,代码行数:9,代码来源:GameManager.cs

示例11: Start

 // Use this for initialization
 void Start()
 {
     camera = GetComponent<GameCamera>();
     Object clone = Instantiate(player, new Vector3(0, 5, 0), Quaternion.identity);
     Object Enemy1 = Instantiate(enemy, new Vector3(50, 7, 0), Quaternion.identity);
     Object Enemy2 = Instantiate(enemy, new Vector3(118, 3, 0), Quaternion.identity);
     camera.SetTarget((clone as GameObject).transform);
 }
开发者ID:JTReed,项目名称:Not-Battletoads,代码行数:9,代码来源:GameManager.cs

示例12: Initialize

		public override void Initialize()
		{
			base.Initialize();
			camera = new GameCamera(1 / 15.0f);
			var grid = new Grid3D(new Size(10, 10));
			grid.RenderLayer = -10;
			new Player();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:8,代码来源:BossTests.cs

示例13: QuadTree

        /// <summary>
        /// Create terrain at <paramref name="position"/>
        /// </summary>
        /// <param name="position"></param>
        /// <param name="textures"></param>
        /// <param name="device"></param>
        /// <param name="scale"></param>
        /// <param name="Content"></param>
        /// <param name="camera"></param>
        public QuadTree(Vector3 position, List<Texture2D> textures, GraphicsDevice device, int scale, ContentManager Content, GameCamera.FreeCamera camera)
        {
            shadow = new LightsAndShadows.Shadow();
            light = new LightsAndShadows.Light(0.7f, 0.4f, new Vector3(513, 100, 513));

            ViewFrustrum = new BoundingFrustum(camera.View * camera.Projection);
             //  Model model = Content.Load<Model>("Models/stone2");
              //  this.model = new LoadModel(model, Vector3.One, Vector3.Up, new Vector3(1), device);
            this.textures = textures;
            effect = Content.Load<Effect>("Effects/MultiTextured");
            effect2 = Content.Load<Effect>("Effects/Shadows");
            Device = device;

            _position = position;
            _topNodeSize = textures[4].Width - 1;

            _vertices = new MapRender(textures[4],scale);
            _buffers = new BufferManager(_vertices.Vertices, device);
            _rootNode = new QuadNode(NodeType.FullNode, _topNodeSize, 1, null, this, 0);

            //Construct an array large enough to hold all of the indices we'll need.
            Indices = _vertices.indices;

            envBilbList.Add(new EnvBilb(textures[6], textures[5], device, Content, scale));
             foreach (EnvBilb pass in envBilbList)
            {
                pass.GenerateObjPositions(_vertices.Vertices, _vertices.TerrainWidth, _vertices.TerrainLength, _vertices.heightData);
                pass.CreateBillboardVerticesFromList();
            }

            /*
            envModelList.Add(new EnvModel(textures[6], model, device, Content, scale));

               foreach (EnvModel pass1 in envModelList)
            {
                pass1.GenerateObjPositions(_vertices.Vertices, _vertices.TerrainWidth, _vertices.TerrainLength, _vertices.heightData);
                pass1.CreateModelFromList();
            }
             * */

               effect.Parameters["xTexture0"].SetValue(textures[1]);
               effect.Parameters["xTexture1"].SetValue(textures[0]);
               effect.Parameters["xTexture2"].SetValue(textures[2]);
               effect.Parameters["xTexture3"].SetValue(textures[3]);
               effect.Parameters["xTexture5"].SetValue(textures[7]);
               Matrix worldMatrix = Matrix.Identity;
               effect.Parameters["xWorld"].SetValue(worldMatrix);
               effect.Parameters["xEnableLighting"].SetValue(true);
               effect.Parameters["xAmbient"].SetValue(light.Ambient);
               effect.Parameters["xLightPower"].SetValue(light.LightPower);

               effect.Parameters["Ground"].SetValue(textures[7]);
               effect.Parameters["GroundText0"].SetValue(textures[8]);
               effect.Parameters["GroundText1"].SetValue(textures[9]);
               effect.Parameters["GroundText2"].SetValue(textures[10]);

               _rootNode.EnforceMinimumDepth();
        }
开发者ID:MenosGrandes,项目名称:mrowisko-pbl,代码行数:67,代码来源:QuadTree.cs

示例14: Initialize

		public void Initialize()
		{
			Command.Register("ViewPanning", new Trigger[] { new MouseDragTrigger(MouseButton.Middle) });
			Command.Register("ViewZooming", new Trigger[] { new MouseZoomTrigger() });
			Command.Register("TurnViewRight", new Trigger[] { new KeyTrigger(Key.E) });
			Command.Register("TurnViewLeft", new Trigger[] { new KeyTrigger(Key.Q) });
			camera = new GameCamera(1 / 15.0f);
			new Player();
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:TowerTests.cs

示例15: CreateGameCamera

		public void CreateGameCamera()
		{
			Command.Register("ViewPanning", new Trigger[] { new MouseDragTrigger(MouseButton.Middle) });
			Command.Register("ViewZooming", new Trigger[] { new MouseZoomTrigger() });
			Command.Register("TurnViewRight", new Trigger[]{new KeyTrigger(Key.E, State.Pressed)});
			Command.Register("TurnViewLeft", new Trigger[]{new KeyTrigger(Key.Q, State.Pressed)});
			gameCamera = new GameCamera(0.1f, 2.0f);
			new Grid3D(new Size(10.0f, 10.0f));
			gameCamera.AllowedMovementRect = new Rectangle(-4.0f, -4.0f, 8.0f, 8.0f);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:10,代码来源:GameCameraTests.cs


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