Camera Field Of View To Focal Length#
Rendering / Camera / Camera Field Of View To Focal Length
Description#
Compares the Field Of View To Focal Length static method of Camera class to another value
Parameters#
| Name | Description |
|---|---|
| Field Of View | |
| Sensor Size | |
| Compare | |
| Value |
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.Rendering;
namespace VisualScript.Runtime
{
[Title("Camera Field Of View To Focal Length")]
[Category("Rendering/Camera/Field Of View To Focal Length")]
[Description("Compares the Field Of View To Focal Length static method of Camera class to another value")]
[Image(typeof(IconCamera), ColorTheme.Type.Blue)]
[Parameter("Field Of View")]
[Parameter("Sensor Size")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionNumber_Camera_CheckFieldOfViewToFocalLength_2 : Condition
{
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetNumber m_Value = new GetNumber();
[SerializeField] private GetNumber m_FieldOfView = new GetNumber();
[SerializeField] private GetNumber m_SensorSize = new GetNumber();
protected override string GetTitle(GameObject source)
{
string className = TextUtils.ThemeAsKeyword("Camera");
string method = TextUtils.ThemeAsKeyword("Field Of View To Focal Length");
return $"{className} {method} ({this.m_FieldOfView}, {this.m_SensorSize}) {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
float value = Camera.FieldOfViewToFocalLength(
(float) this.m_FieldOfView.Get(args),
(float) this.m_SensorSize.Get(args)
);
return this.m_Compare.Compare(value, (float) this.m_Value.Get(args));
}
}
}