//------------------------------------------------------------------------------
//
// 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
/// glTF extension that enables shifting and scaling UV coordinates on a per-texture basis
/// Sourced from the 'KHR_texture_transform' extension
///
public partial class TextureTransformGltfTextureinfoExtension {
///
/// Backing field for Offset.
///
private Brutal.Numerics.float2 m_offset = new Brutal.Numerics.float2(0F, 0F);
///
/// Backing field for Rotation.
///
private float m_rotation = 0F;
///
/// Backing field for Scale.
///
private Brutal.Numerics.float2 m_scale = new Brutal.Numerics.float2(1F, 1F);
///
/// Backing field for TexCoord.
///
private System.Nullable m_texCoord;
///
/// Backing field for Extensions.
///
private System.Collections.Generic.Dictionary m_extensions;
///
/// Backing field for Extras.
///
private Extras m_extras;
///
/// The offset of the UV coordinate origin as a factor of the texture dimensions.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("offset")]
public Brutal.Numerics.float2 Offset {
get {
return this.m_offset;
}
set {
this.m_offset = value;
}
}
///
/// Rotate the UVs by this many radians counter-clockwise around the origin.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("rotation")]
public float Rotation {
get {
return this.m_rotation;
}
set {
this.m_rotation = value;
}
}
///
/// The scale factor applied to the components of the UV coordinates.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("scale")]
public Brutal.Numerics.float2 Scale {
get {
return this.m_scale;
}
set {
this.m_scale = value;
}
}
///
/// Overrides the textureInfo texCoord value if supplied, and if this extension is supported.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("texCoord")]
public System.Nullable TexCoord {
get {
return this.m_texCoord;
}
set {
if ((value < 0)) {
throw new System.ArgumentOutOfRangeException("TexCoord", value, "Expected value to be greater than or equal to 0");
}
this.m_texCoord = 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 Offset property should be serialized.
///
public bool ShouldSerializeOffset() {
return ((m_offset == new Brutal.Numerics.float2(0F, 0F))
== false);
}
///
/// This method is used to determine if the Rotation property should be serialized.
///
public bool ShouldSerializeRotation() {
return ((m_rotation == 0F)
== false);
}
///
/// This method is used to determine if the Scale property should be serialized.
///
public bool ShouldSerializeScale() {
return ((m_scale == new Brutal.Numerics.float2(1F, 1F))
== false);
}
///
/// This method is used to determine if the TexCoord property should be serialized.
///
public bool ShouldSerializeTexCoord() {
return ((m_texCoord == 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);
}
}
}