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


C# Camera.ResetWorldToCameraMatrix方法代码示例

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


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

示例1: PreCullAdjustFOV

 // callback to be called before any culling
 public void PreCullAdjustFOV(Camera cam)
 {
     if (cam == thisCamera)
     {
         cam.fieldOfView = 70;
         //These are needed for the FOV change to take effect.
         cam.ResetWorldToCameraMatrix();
         cam.ResetProjectionMatrix();
     }
 }
开发者ID:DerjenigeWelche,项目名称:Medienprojekt2.0,代码行数:11,代码来源:CullingDisabler.cs

示例2: EndCubeFaceRender

    void EndCubeFaceRender(Cubemap target, CubemapFace f, int mipLevel, Camera cam, bool aa)
    {
        // read pixels into destination
        int size = target.width >> mipLevel;
        Texture2D tempTex = new Texture2D (size, size);
        tempTex.ReadPixels(new Rect(0,0,size,size), 0,0, false);
        //Debug.Log (mipLevel);
        target.SetPixels(tempTex.GetPixels(), f, mipLevel);
        Object.DestroyImmediate(tempTex);

        // cleanup camera
        RenderTexture.ReleaseTemporary(cam.targetTexture);
        cam.targetTexture = null;
        cam.ResetWorldToCameraMatrix();
    }
开发者ID:imclab,项目名称:CubeMapRenderer,代码行数:15,代码来源:CubeMapper.cs

示例3: RenderText

    void RenderText(Camera cam)
    {
        // don't render if no GUILayer
        var guiLayer = cam.GetComponent<GUILayer>();
        if (guiLayer == null || !guiLayer.enabled)
            return;
        // our layer is culled
        if ((cam.cullingMask & (1<<gameObject.layer)) == 0)
            return;

        UpdateMesh();
        if (mesh == null)
            return;
        UpdateMaterial();

        GL.PushMatrix();
        GL.LoadPixelMatrix();
        mat.SetPass(0);

        var camRect = cam.pixelRect;
        var pos = transform.position;
        pos.x = camRect.x + pos.x * camRect.width + pixelOffset.x;
        pos.y = camRect.y + pos.y * camRect.height + pixelOffset.y;
        pos.z = 0;
        pos += EasyFontUtilities.CalcAnchorOffset(mesh, anchor);
        pos.x = Mathf.Round(pos.x);
        pos.y = Mathf.Round(pos.y);

        var scale = characterSize;
        var mtx = Matrix4x4.TRS(pos, Quaternion.identity, new Vector3(scale,-scale,scale));

        // Note: DrawMeshNow sets up current camera's view matrix;
        // so make sure that's identity and reset it afterwards
        cam.worldToCameraMatrix = Matrix4x4.identity;
        Graphics.DrawMeshNow(mesh, mtx);
        cam.ResetWorldToCameraMatrix();
        GL.PopMatrix();
    }
开发者ID:aras-p,项目名称:UnityStbEasyFont,代码行数:38,代码来源:SimpleGUIText.cs

示例4: ResetState

		private void ResetState(Transform cachedTransform, Camera cam)
		{
			cam.ResetWorldToCameraMatrix();
			
			shakeRect.x = 0;
			shakeRect.y = 0;
			
			states[cam].Clear();
		}
开发者ID:xiatianjin,项目名称:Tank,代码行数:9,代码来源:_CameraShake.cs

示例5: ApplyTransitionAlterations

 internal static void ApplyTransitionAlterations(Camera camera, CameraFX fx, bool useFX)
 {
     Matrix4x4G matrix4x4G;
     Matrix4x4G matrix4x4G1;
     if (!useFX)
     {
         camera.ExtractCameraMatrixWorldToCamera(out matrix4x4G);
         camera.ExtractCameraMatrixProjection(out matrix4x4G1);
         int num = CameraFX.g_trans.Update(ref matrix4x4G, ref matrix4x4G1);
         if ((num & 1) == 1)
         {
             camera.ResetWorldToCameraMatrix();
             camera.worldToCameraMatrix = matrix4x4G.f;
         }
         if ((num & 2) == 2)
         {
             camera.ResetProjectionMatrix();
             camera.projectionMatrix = matrix4x4G1.f;
         }
     }
     else
     {
         int num1 = CameraFX.g_trans.Update(ref fx.worldToCameraMatrix, ref fx.projectionMatrix);
         if ((num1 & 1) == 1)
         {
             camera.worldToCameraMatrix = fx.worldToCameraMatrix.f;
             Matrix4x4G.Inverse(ref fx.worldToCameraMatrix, out fx.cameraToWorldMatrix);
         }
         if ((num1 & 2) == 2)
         {
             camera.projectionMatrix = fx.projectionMatrix.f;
         }
     }
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:34,代码来源:CameraFX.cs


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