本文整理汇总了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();
}
}
示例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();
}
示例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();
}
示例4: ResetState
private void ResetState(Transform cachedTransform, Camera cam)
{
cam.ResetWorldToCameraMatrix();
shakeRect.x = 0;
shakeRect.y = 0;
states[cam].Clear();
}
示例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;
}
}
}