Camera Focal Length To Field Of View#
Rendering / Camera / Camera Focal Length To Field Of View
Description#
Compares the Focal Length To Field Of View static method of Camera class to another value
Parameters#
| Name | Description |
|---|---|
| Focal Length | |
| 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 Focal Length To Field Of View")]
[Category("Rendering/Camera/Focal Length To Field Of View")]
[Description("Compares the Focal Length To Field Of View static method of Camera class to another value")]
[Image(typeof(IconCamera), ColorTheme.Type.Blue)]
[Parameter("Focal Length")]
[Parameter("Sensor Size")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionNumber_Camera_CheckFocalLengthToFieldOfView_2 : Condition
{
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetNumber m_Value = new GetNumber();
[SerializeField] private GetNumber m_FocalLength = new GetNumber();
[SerializeField] private GetNumber m_SensorSize = new GetNumber();
protected override string GetTitle(GameObject source)
{
string className = TextUtils.ThemeAsKeyword("Camera");
string method = TextUtils.ThemeAsKeyword("Focal Length To Field Of View");
return $"{className} {method} ({this.m_FocalLength}, {this.m_SensorSize}) {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
float value = Camera.FocalLengthToFieldOfView(
(float) this.m_FocalLength.Get(args),
(float) this.m_SensorSize.Get(args)
);
return this.m_Compare.Compare(value, (float) this.m_Value.Get(args));
}
}
}