Version: 2023.1
言語: 日本語

CameraProjectionCache

struct in UnityEditor

マニュアルに切り替える

説明

Project points from world to screen space.

Projection from world to screen space depends on internal camera matrices that Unity must recalculate whenever they are accessed. When accessed in a loop where the camera state does not change, these calculations are not necessary, which results in significant performance improvements.

コンストラクタ

CameraProjectionCacheCreates a CameraProjectionCache with the camera's current state.

Public 関数

GUIToScreenPointConverts a point from GUI position to screen space relative to the cached camera viewport.
ScreenToGUIPointConverts a point from screen space to GUI position relative to the viewport at the time the CameraProjectionCache was created.
WorldToGUIPointConverts a world space point to a 2D GUI position.
WorldToScreenPointTransforms position from world space into screen space using the cached camera projection and viewport.