brutal/brutal.gltf/Brutal.Gltf/GltfApi/GeneratedSchema/Node.gen.cs
2026-10-15 14:12:02 +13:00

363 lines
13 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 node in the node hierarchy. When the node contains `skin`, all `mesh.primitives` **MUST** contain `JOINTS_0` and `WEIGHTS_0` attributes. A node **MAY** have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), `matrix` **MUST NOT** be present.
/// </summary>
public partial class Node {
/// <summary>
/// Backing field for Camera.
/// </summary>
private System.Nullable<int> m_camera;
/// <summary>
/// Backing field for Children.
/// </summary>
private int[] m_children;
/// <summary>
/// Backing field for Skin.
/// </summary>
private System.Nullable<int> m_skin;
/// <summary>
/// Backing field for Matrix.
/// </summary>
private Brutal.Numerics.float4x4 m_matrix = new Brutal.Numerics.float4x4(1F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 1F);
/// <summary>
/// Backing field for Mesh.
/// </summary>
private System.Nullable<int> m_mesh;
/// <summary>
/// Backing field for Rotation.
/// </summary>
private Brutal.Numerics.floatQuat m_rotation = new Brutal.Numerics.floatQuat(0F, 0F, 0F, 1F);
/// <summary>
/// Backing field for Scale.
/// </summary>
private Brutal.Numerics.float3 m_scale = new Brutal.Numerics.float3(1F, 1F, 1F);
/// <summary>
/// Backing field for Translation.
/// </summary>
private Brutal.Numerics.float3 m_translation = new Brutal.Numerics.float3(0F, 0F, 0F);
/// <summary>
/// Backing field for Weights.
/// </summary>
private float[] m_weights;
/// <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>
/// The index of the camera referenced by this node.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyNameAttribute("camera")]
public System.Nullable<int> Camera {
get {
return this.m_camera;
}
set {
if ((value < 0)) {
throw new System.ArgumentOutOfRangeException("Camera", value, "Expected value to be greater than or equal to 0");
}
this.m_camera = value;
}
}
/// <summary>
/// The indices of this node's children.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyNameAttribute("children")]
public int[] Children {
get {
return this.m_children;
}
set {
if ((value == null)) {
this.m_children = value;
return;
}
if ((value.Length < 1u)) {
throw new System.ArgumentException("Array not long enough");
}
int index = 0;
for (index = 0; (index < value.Length); index = (index + 1)) {
if ((value[index] < 0)) {
throw new System.ArgumentOutOfRangeException();
}
}
this.m_children = value;
}
}
/// <summary>
/// The index of the skin referenced by this node.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyNameAttribute("skin")]
public System.Nullable<int> Skin {
get {
return this.m_skin;
}
set {
if ((value < 0)) {
throw new System.ArgumentOutOfRangeException("Skin", value, "Expected value to be greater than or equal to 0");
}
this.m_skin = value;
}
}
/// <summary>
/// A floating-point 4x4 transformation matrix stored in column-major order.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyNameAttribute("matrix")]
public Brutal.Numerics.float4x4 Matrix {
get {
return this.m_matrix;
}
set {
this.m_matrix = value;
}
}
/// <summary>
/// The index of the mesh in this node.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyNameAttribute("mesh")]
public System.Nullable<int> Mesh {
get {
return this.m_mesh;
}
set {
if ((value < 0)) {
throw new System.ArgumentOutOfRangeException("Mesh", value, "Expected value to be greater than or equal to 0");
}
this.m_mesh = value;
}
}
/// <summary>
/// The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyNameAttribute("rotation")]
public Brutal.Numerics.floatQuat Rotation {
get {
return this.m_rotation;
}
set {
this.m_rotation = value;
}
}
/// <summary>
/// The node's non-uniform scale, given as the scaling factors along the x, y, and z axes.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyNameAttribute("scale")]
public Brutal.Numerics.float3 Scale {
get {
return this.m_scale;
}
set {
this.m_scale = value;
}
}
/// <summary>
/// The node's translation along the x, y, and z axes.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyNameAttribute("translation")]
public Brutal.Numerics.float3 Translation {
get {
return this.m_translation;
}
set {
this.m_translation = value;
}
}
/// <summary>
/// The weights of the instantiated morph target. The number of array elements **MUST** match the number of morph targets of the referenced mesh. When defined, `mesh` **MUST** also be defined.
/// </summary>
[System.Text.Json.Serialization.JsonPropertyNameAttribute("weights")]
public float[] Weights {
get {
return this.m_weights;
}
set {
if ((value == null)) {
this.m_weights = value;
return;
}
if ((value.Length < 1u)) {
throw new System.ArgumentException("Array not long enough");
}
this.m_weights = 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 Camera property should be serialized.
/// </summary>
public bool ShouldSerializeCamera() {
return ((m_camera == null)
== false);
}
/// <summary>
/// This method is used to determine if the Children property should be serialized.
/// </summary>
public bool ShouldSerializeChildren() {
return ((m_children == null)
== false);
}
/// <summary>
/// This method is used to determine if the Skin property should be serialized.
/// </summary>
public bool ShouldSerializeSkin() {
return ((m_skin == null)
== false);
}
/// <summary>
/// This method is used to determine if the Matrix property should be serialized.
/// </summary>
public bool ShouldSerializeMatrix() {
return ((m_matrix == new Brutal.Numerics.float4x4(1F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 1F))
== false);
}
/// <summary>
/// This method is used to determine if the Mesh property should be serialized.
/// </summary>
public bool ShouldSerializeMesh() {
return ((m_mesh == null)
== false);
}
/// <summary>
/// This method is used to determine if the Rotation property should be serialized.
/// </summary>
public bool ShouldSerializeRotation() {
return ((m_rotation == new Brutal.Numerics.floatQuat(0F, 0F, 0F, 1F))
== false);
}
/// <summary>
/// This method is used to determine if the Scale property should be serialized.
/// </summary>
public bool ShouldSerializeScale() {
return ((m_scale == new Brutal.Numerics.float3(1F, 1F, 1F))
== false);
}
/// <summary>
/// This method is used to determine if the Translation property should be serialized.
/// </summary>
public bool ShouldSerializeTranslation() {
return ((m_translation == new Brutal.Numerics.float3(0F, 0F, 0F))
== false);
}
/// <summary>
/// This method is used to determine if the Weights property should be serialized.
/// </summary>
public bool ShouldSerializeWeights() {
return ((m_weights == 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);
}
}
}