//------------------------------------------------------------------------------ // // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace Brutal.GltfApi { using System.Linq; using System.Runtime.Serialization; using System.Text.Json.Serialization; /// /// Object part of the GLTF file schema /// A directional, point, or spot light. /// Sourced from the 'KHR_lights_punctual' extension /// public partial class LightsPunctualLightProperties { /// /// Backing field for Color. /// private float[] m_color = new float[] { 1F, 1F, 1F}; /// /// Backing field for Intensity. /// private float m_intensity = 1F; /// /// Backing field for Spot. /// private LightsPunctualLightSpotProperties m_spot; /// /// Backing field for Type. /// private string m_type; /// /// Backing field for Range. /// private System.Nullable m_range; /// /// Backing field for Name. /// private string m_name; /// /// Backing field for Extensions. /// private System.Collections.Generic.Dictionary m_extensions; /// /// Backing field for Extras. /// private Extras m_extras; /// /// Color of the light source. /// [System.Text.Json.Serialization.JsonPropertyNameAttribute("color")] public float[] Color { get { return this.m_color; } set { if ((value.Length < 3u)) { throw new System.ArgumentException("Array not long enough"); } if ((value.Length > 3u)) { throw new System.ArgumentException("Array too long"); } int index = 0; for (index = 0; (index < value.Length); index = (index + 1)) { if ((value[index] < 0D)) { throw new System.ArgumentOutOfRangeException(); } } for (index = 0; (index < value.Length); index = (index + 1)) { if ((value[index] > 1D)) { throw new System.ArgumentOutOfRangeException(); } } this.m_color = value; } } /// /// Intensity of the light source. `point` and `spot` lights use luminous intensity in candela (lm/sr) while `directional` lights use illuminance in lux (lm/m^2) /// [System.Text.Json.Serialization.JsonPropertyNameAttribute("intensity")] public float Intensity { get { return this.m_intensity; } set { if ((value < 0)) { throw new System.ArgumentOutOfRangeException("Intensity", value, "Expected value to be greater than or equal to 0"); } this.m_intensity = value; } } /// /// /// [System.Text.Json.Serialization.JsonPropertyNameAttribute("spot")] public LightsPunctualLightSpotProperties Spot { get { return this.m_spot; } set { this.m_spot = value; } } /// /// Specifies the light type. /// [System.Text.Json.Serialization.JsonRequiredAttribute()] [System.Text.Json.Serialization.JsonPropertyNameAttribute("type")] public string Type { get { return this.m_type; } set { this.m_type = value; } } /// /// A distance cutoff at which the light's intensity may be considered to have reached zero. /// [System.Text.Json.Serialization.JsonPropertyNameAttribute("range")] public System.Nullable Range { get { return this.m_range; } set { if ((value <= 0)) { throw new System.ArgumentOutOfRangeException("Range", value, "Expected value to be greater than 0"); } this.m_range = value; } } /// /// The user-defined name of this object. /// [System.Text.Json.Serialization.JsonPropertyNameAttribute("name")] public string Name { get { return this.m_name; } set { this.m_name = value; } } /// /// JSON object with extension-specific objects. /// [System.Text.Json.Serialization.JsonPropertyNameAttribute("extensions")] public System.Collections.Generic.Dictionary Extensions { get { return this.m_extensions; } set { this.m_extensions = value; } } /// /// Application-specific data. /// [System.Text.Json.Serialization.JsonPropertyNameAttribute("extras")] public Extras Extras { get { return this.m_extras; } set { this.m_extras = value; } } /// /// This method is used to determine if the Color property should be serialized. /// public bool ShouldSerializeColor() { return (m_color.SequenceEqual(new float[] { 1F, 1F, 1F}) == false); } /// /// This method is used to determine if the Intensity property should be serialized. /// public bool ShouldSerializeIntensity() { return ((m_intensity == 1F) == false); } /// /// This method is used to determine if the Spot property should be serialized. /// public bool ShouldSerializeSpot() { return ((m_spot == null) == false); } /// /// This method is used to determine if the Type property should be serialized. /// public bool ShouldSerializeType() { return ((m_type == null) == false); } /// /// This method is used to determine if the Range property should be serialized. /// public bool ShouldSerializeRange() { return ((m_range == null) == false); } /// /// This method is used to determine if the Name property should be serialized. /// public bool ShouldSerializeName() { return ((m_name == null) == false); } /// /// This method is used to determine if the Extensions property should be serialized. /// public bool ShouldSerializeExtensions() { return ((m_extensions == null) == false); } /// /// This method is used to determine if the Extras property should be serialized. /// public bool ShouldSerializeExtras() { return ((m_extras == null) == false); } } }