AcTools.Render.Base.Cameras.BaseCamera.SetLens C# (CSharp) Method

SetLens() public method

public SetLens ( float aspect ) : void
aspect float
return void
        public virtual void SetLens(float aspect) {
            Aspect = aspect;

            NearWindowHeight = 2.0f * NearZ * MathF.Tan(0.5f * FovY);
            FarWindowHeight = 2.0f * FarZ * MathF.Tan(0.5f * FovY);

            Proj = Matrix.PerspectiveFovLH(FovY, Aspect, NearZ, FarZ);
        }
        

Usage Example

コード例 #1
0
ファイル: TrackMapRenderer.cs プロジェクト: gro-ove/actools
 protected virtual void ResetCamera() {
     Camera = GetCamera();
     Camera.SetLens(AspectRatio);
 }