mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +01:00
260 lines
8.3 KiB
C#
260 lines
8.3 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace Brutal.GltfApi {
|
|
using System.Linq;
|
|
using System.Runtime.Serialization;
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
/// <summary>
|
|
/// Object part of the GLTF file schema
|
|
/// A directional, point, or spot light.
|
|
/// Sourced from the 'KHR_lights_punctual' extension
|
|
/// </summary>
|
|
public partial class LightsPunctualLightProperties {
|
|
|
|
/// <summary>
|
|
/// Backing field for Color.
|
|
/// </summary>
|
|
private float[] m_color = new float[] {
|
|
1F,
|
|
1F,
|
|
1F};
|
|
|
|
/// <summary>
|
|
/// Backing field for Intensity.
|
|
/// </summary>
|
|
private float m_intensity = 1F;
|
|
|
|
/// <summary>
|
|
/// Backing field for Spot.
|
|
/// </summary>
|
|
private LightsPunctualLightSpotProperties m_spot;
|
|
|
|
/// <summary>
|
|
/// Backing field for Type.
|
|
/// </summary>
|
|
private string m_type;
|
|
|
|
/// <summary>
|
|
/// Backing field for Range.
|
|
/// </summary>
|
|
private System.Nullable<float> m_range;
|
|
|
|
/// <summary>
|
|
/// Backing field for Name.
|
|
/// </summary>
|
|
private string m_name;
|
|
|
|
/// <summary>
|
|
/// Backing field for Extensions.
|
|
/// </summary>
|
|
private System.Collections.Generic.Dictionary<string, object> m_extensions;
|
|
|
|
/// <summary>
|
|
/// Backing field for Extras.
|
|
/// </summary>
|
|
private Extras m_extras;
|
|
|
|
/// <summary>
|
|
/// Color of the light source.
|
|
/// </summary>
|
|
[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;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 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)
|
|
/// </summary>
|
|
[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;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyNameAttribute("spot")]
|
|
public LightsPunctualLightSpotProperties Spot {
|
|
get {
|
|
return this.m_spot;
|
|
}
|
|
set {
|
|
this.m_spot = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Specifies the light type.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonRequiredAttribute()]
|
|
[System.Text.Json.Serialization.JsonPropertyNameAttribute("type")]
|
|
public string Type {
|
|
get {
|
|
return this.m_type;
|
|
}
|
|
set {
|
|
this.m_type = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// A distance cutoff at which the light's intensity may be considered to have reached zero.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyNameAttribute("range")]
|
|
public System.Nullable<float> 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;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// The user-defined name of this object.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyNameAttribute("name")]
|
|
public string Name {
|
|
get {
|
|
return this.m_name;
|
|
}
|
|
set {
|
|
this.m_name = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// JSON object with extension-specific objects.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyNameAttribute("extensions")]
|
|
public System.Collections.Generic.Dictionary<string, object> Extensions {
|
|
get {
|
|
return this.m_extensions;
|
|
}
|
|
set {
|
|
this.m_extensions = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Application-specific data.
|
|
/// </summary>
|
|
[System.Text.Json.Serialization.JsonPropertyNameAttribute("extras")]
|
|
public Extras Extras {
|
|
get {
|
|
return this.m_extras;
|
|
}
|
|
set {
|
|
this.m_extras = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// This method is used to determine if the Color property should be serialized.
|
|
/// </summary>
|
|
public bool ShouldSerializeColor() {
|
|
return (m_color.SequenceEqual(new float[] {
|
|
1F,
|
|
1F,
|
|
1F}) == false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// This method is used to determine if the Intensity property should be serialized.
|
|
/// </summary>
|
|
public bool ShouldSerializeIntensity() {
|
|
return ((m_intensity == 1F)
|
|
== false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// This method is used to determine if the Spot property should be serialized.
|
|
/// </summary>
|
|
public bool ShouldSerializeSpot() {
|
|
return ((m_spot == null)
|
|
== false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// This method is used to determine if the Type property should be serialized.
|
|
/// </summary>
|
|
public bool ShouldSerializeType() {
|
|
return ((m_type == null)
|
|
== false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// This method is used to determine if the Range property should be serialized.
|
|
/// </summary>
|
|
public bool ShouldSerializeRange() {
|
|
return ((m_range == null)
|
|
== false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// This method is used to determine if the Name property should be serialized.
|
|
/// </summary>
|
|
public bool ShouldSerializeName() {
|
|
return ((m_name == null)
|
|
== false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// This method is used to determine if the Extensions property should be serialized.
|
|
/// </summary>
|
|
public bool ShouldSerializeExtensions() {
|
|
return ((m_extensions == null)
|
|
== false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// This method is used to determine if the Extras property should be serialized.
|
|
/// </summary>
|
|
public bool ShouldSerializeExtras() {
|
|
return ((m_extras == null)
|
|
== false);
|
|
}
|
|
}
|
|
}
|