1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System.Collections.Generic;
- using System.Runtime.Serialization;
- namespace GLTFExport.Entities
- {
- [DataContract]
- public class GLTFNode : GLTFIndexedChildRootProperty
- {
- [DataMember(EmitDefaultValue = false)]
- public int? camera { get; set; }
- [DataMember(EmitDefaultValue = false)]
- public int[] children { get; set; }
- [DataMember(EmitDefaultValue = false)]
- public int? skin { get; set; }
- // Either matrix or Translation+Rotation+Scale
- //[DataMember]
- //public float[] matrix { get; set; }
- [DataMember(EmitDefaultValue = false)]
- public int? mesh { get; set; }
- [DataMember(IsRequired = true)]
- public float[] translation { get; set; }
- [DataMember(IsRequired = true)]
- public float[] rotation { get; set; }
- [DataMember(IsRequired = true)]
- public float[] scale { get; set; }
- [DataMember(EmitDefaultValue = false)]
- public float[] weights { get; set; }
- public List<int> ChildrenList { get; private set; }
- // Used to compute transform world matrix
- public GLTFNode parent;
- public GLTFNode()
- {
- ChildrenList = new List<int>();
- }
- public void Prepare()
- {
- // Do not export empty arrays
- if (ChildrenList.Count > 0)
- {
- children = ChildrenList.ToArray();
- }
- }
- }
- }
|