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


C# Camera.AutoTrack方法代码示例

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


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

示例1: RenderScene

		/// <summary>
		///		Prompts the class to send its contents to the renderer.
		/// </summary>
		/// <remarks>
		///		This method prompts the scene manager to send the
		///		contents of the scene it manages to the rendering
		///		pipeline, possibly preceded by some sorting, culling
		///		or other scene management tasks. Note that this method is not normally called
		///		directly by the user application; it is called automatically
		///		by the engine's rendering loop.
		/// </remarks>
		/// <param name="camera">Pointer to a camera from whose viewpoint the scene is to be rendered.</param>
		/// <param name="viewport">The target viewport</param>
		/// <param name="showOverlays">Whether or not any overlay objects should be rendered</param>
		protected internal void RenderScene( Camera camera, Viewport viewport, bool showOverlays )
		{
			// let the engine know this is the current scene manager
			Root.Instance.SceneManager = this;

			if ( this.IsShadowTechniqueInUse )
			{
				// initialize shadow volume materials
				this.InitShadowVolumeMaterials();
			}

			// Perform a quick pre-check to see whether we should override far distance
			// When using stencil volumes we have to use infinite far distance
			// to prevent dark caps getting clipped
			if ( this.IsShadowTechniqueStencilBased &&
				 camera.Far != 0 &&
				 this.targetRenderSystem.Capabilities.HasCapability( Capabilities.InfiniteFarPlane ) &&
				 this.shadowUseInfiniteFarPlane )
			{
				// infinite far distance
				camera.Far = 0.0f;
			}

			this.cameraInProgress = camera;
			this.hasCameraChanged = true;

			// Update the scene, only do this once per frame
			ulong thisFrameNumber = Root.Instance.CurrentFrameCount;
			if ( thisFrameNumber != this.lastFrameNumber )
			{
				// Update animations
				this.ApplySceneAnimations();
				// Update controllers
				ControllerManager.Instance.UpdateAll();
				this.lastFrameNumber = thisFrameNumber;
			}

			// Update scene graph for this camera (can happen multiple times per frame)
			this.UpdateSceneGraph( camera );

			// Auto-track nodes
			foreach ( SceneNode sn in autoTrackingSceneNodes.Values )
			{
				sn.AutoTrack();
			}

			// ask the camera to auto track if it has a target
			camera.AutoTrack();

			// Are we using any shadows at all?
			if ( this.IsShadowTechniqueInUse && this.illuminationStage != IlluminationRenderStage.RenderToTexture &&
				 viewport.ShowShadows && this.findVisibleObjects )
			{
				// Locate any lights which could be affecting the frustum
				this.FindLightsAffectingFrustum( camera );

				if ( this.IsShadowTechniqueTextureBased )
				{
					// *******
					// WARNING
					// *******
					// This call will result in re-entrant calls to this method
					// therefore anything which comes before this is NOT
					// guaranteed persistent. Make sure that anything which
					// MUST be specific to this camera / target is done
					// AFTER THIS POINT
					this.PrepareShadowTextures( camera, viewport );
					// reset the cameras because of the re-entrant call
					this.cameraInProgress = camera;
					this.hasCameraChanged = true;
				}
			}

			// Invert vertex winding?
			this.targetRenderSystem.InvertVertexWinding = camera.IsReflected;

			// Tell params about viewport
			this.autoParamDataSource.Viewport = viewport;
			// Set the viewport
			this.SetViewport( viewport );

			// set the current camera for use in the auto GPU program params
			this.autoParamDataSource.Camera = camera;

			// Set autoparams for finite dir light extrusion
			this.autoParamDataSource.SetShadowDirLightExtrusionDistance( this.shadowDirLightExtrudeDist );
//.........这里部分代码省略.........
开发者ID:mono-soc-2011,项目名称:axiom,代码行数:101,代码来源:SceneManager.cs

示例2: RenderScene

        /// <summary>
        ///		Prompts the class to send its contents to the renderer.
        /// </summary>
        /// <remarks>
        ///		This method prompts the scene manager to send the
        ///		contents of the scene it manages to the rendering
        ///		pipeline, possibly preceded by some sorting, culling
        ///		or other scene management tasks. Note that this method is not normally called
        ///		directly by the user application; it is called automatically
        ///		by the engine's rendering loop.
        /// </remarks>
        /// <param name="camera">Pointer to a camera from whose viewpoint the scene is to be rendered.</param>
        /// <param name="viewport">The target viewport</param>
        /// <param name="showOverlays">Whether or not any overlay objects should be rendered</param>
        internal void RenderScene(Camera camera, Viewport viewport, bool showOverlays)
        {
            renderSceneMeter.Enter();

            // let the engine know this is the current scene manager
            Root.Instance.SceneManager = this;

            if (IsShadowTechniqueInUse) {
                // initialize shadow volume materials
                InitShadowVolumeMaterials();
            }

            // Perform a quick pre-check to see whether we should override far distance
            // When using stencil volumes we have to use infinite far distance
            // to prevent dark caps getting clipped
            if (IsShadowTechniqueStencilBased &&
                camera.Far != 0 &&
                targetRenderSystem.Caps.CheckCap(Capabilities.InfiniteFarPlane) &&
                shadowUseInfiniteFarPlane) {

                // infinite far distance
                camera.Far = 0.0f;
            }

            cameraInProgress = camera;
            hasCameraChanged = true;

            // Update the scene, only do this once per frame
            ulong thisFrameNumber = Root.Instance.CurrentFrameCount;
            if (thisFrameNumber != lastFrameNumber) {
                // Update animations
                animationsMeter.Enter();
                ApplySceneAnimations();
                animationsMeter.Exit();
                // Update controllers
                ControllerManager.Instance.UpdateAll();
                lastFrameNumber = thisFrameNumber;
            }

            // Update scene graph for this camera (can happen multiple times per frame)
            UpdateSceneGraph(camera);

            // Auto-track nodes
            for(int i = 0; i < autoTrackingSceneNodes.Count; i++) {
                autoTrackingSceneNodes[i].AutoTrack();
            }

            // ask the camera to auto track if it has a target
            camera.AutoTrack();

            // Are we using any shadows at all?
            if (IsShadowTechniqueInUse && illuminationStage != IlluminationRenderStage.RenderToTexture &&
                viewport.ShadowsEnabled && findVisibleObjects) {
                // Locate any lights which could be affecting the frustum
                FindLightsAffectingFrustum(camera);

                if (IsShadowTechniqueTextureBased) {
                    // *******
                    // WARNING
                    // *******
                    // This call will result in re-entrant calls to this method
                    // therefore anything which comes before this is NOT
                    // guaranteed persistent. Make sure that anything which
                    // MUST be specific to this camera / target is done
                    // AFTER THIS POINT
                    PrepareShadowTextures(camera, viewport);
                    // reset the cameras because of the re-entrant call
                    cameraInProgress = camera;
                    hasCameraChanged = true;
                }
            }

            // Invert vertex winding?
            targetRenderSystem.InvertVertexWinding = camera.IsReflected;

            // Tell params about viewport
            autoParamDataSource.Viewport = viewport;
            // Set the viewport
            SetViewport(viewport);

            // set the current camera for use in the auto GPU program params
            autoParamDataSource.Camera = camera;

            // Set autoparams for finite dir light extrusion
            autoParamDataSource.SetShadowDirLightExtrusionDistance(shadowDirLightExtrudeDist);

//.........这里部分代码省略.........
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:101,代码来源:SceneManager.cs


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