/[Sims3RigEditor]/trunk/gr2lib_typedefs/typedefs/GrannyMesh.cs
ViewVC logotype

Contents of /trunk/gr2lib_typedefs/typedefs/GrannyMesh.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91 - (show annotations) (download)
Thu Aug 19 08:40:05 2010 UTC (9 years, 6 months ago) by william
File size: 5689 byte(s)
update class definitions to include:
Granny_Model
Granny_Mesh (and associated classes)

1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using gr2lib.core.coretypes.implementation;
5 using gr2lib.core.interfaces;
6
7 namespace gr2lib.core.typedefs
8 {
9 public interface IMaterialBinding
10 {
11 Material Material { get; set; }
12 }
13 public class MaterialBinding : IMaterialBinding
14 {
15 public MaterialBinding()
16 {
17 this.init();
18 }
19 private void init()
20 {
21 this.Material = new Material();
22 }
23 #region IGrannyMaterialBinding Members
24 private Material _Material;
25 public Material Material { get { return _Material; } set { _Material = value; } }
26 #endregion
27 }
28
29
30 public interface IBoneBinding
31 {
32 string BoneName { get; set; }
33 granny_triple OBBMin { get; set; }
34 granny_triple OBBMax { get; set; }
35 int TriangleCount { get; }
36 List<int> TriangleIndices { get; set; }
37 }
38 public class BoneBinding : IBoneBinding
39 {
40 public BoneBinding()
41 {
42 this.init();
43 }
44 private void init()
45 {
46 this.BoneName = "";
47 this.OBBMin = new granny_triple();
48 this.OBBMax = new granny_triple();
49 this.TriangleIndices = new List<int>();
50 }
51 #region IGrannyBoneBinding Members
52 private string _BoneName;
53 public string BoneName { get { return _BoneName; } set { _BoneName = value; } }
54 private granny_triple _OBBMin;
55 public granny_triple OBBMin { get { return _OBBMin; } set { _OBBMin = value; } }
56 private granny_triple _OBBMax;
57 public granny_triple OBBMax { get { return _OBBMax; } set { _OBBMax = value; } }
58 public int TriangleCount { get { return this.TriangleIndices.Count; } }
59 private List<int> _TriangleIndices;
60 public List<int> TriangleIndices { get { return _TriangleIndices; } set { _TriangleIndices = value; } }
61 #endregion
62 }
63
64 public interface IMorphTarget
65 {
66 string ScalarName { get; set; }
67 VertexData VertexData { get; set; }
68 int DataIsDeltas { get; set; }
69 }
70 public class MorphTarget : IMorphTarget
71 {
72 public MorphTarget()
73 {
74 this.init();
75 }
76 private void init()
77 {
78 this.ScalarName = "";
79 this.VertexData = new VertexData();
80 this.DataIsDeltas = 0;
81 }
82 #region IGrannyMorphTarget Members
83 private string _ScalarName;
84 public string ScalarName { get { return _ScalarName; } set { _ScalarName = value; } }
85 private VertexData _VertexData;
86 public VertexData VertexData { get { return _VertexData; } set { _VertexData = value; } }
87 private int _DataIsDeltas;
88 public int DataIsDeltas { get { return _DataIsDeltas; } set { _DataIsDeltas = value; } }
89 #endregion
90 }
91
92 public interface IMesh : IExtendedData
93 {
94 string Name { get; set; }
95 VertexData PrimaryVertexData { get; set; }
96
97 int MorphTargetCount { get; }
98 List<MorphTarget> MorphTargets { get; set; }
99
100 TriTopology PrimaryTopology { get; set; }
101
102 int MaterialBindingCount { get; }
103 List<MaterialBinding> MaterialBindings { get; set; }
104
105 int BoneBindingCount { get; }
106 List<BoneBinding> BoneBindings { get; set; }
107 }
108
109 public class Mesh : IMesh
110 {
111 public Mesh()
112 {
113 this.init();
114 }
115 private void init()
116 {
117 this.Name = "";
118 this.PrimaryVertexData = new VertexData();
119 this.MorphTargets = new List<MorphTarget>();
120 this.PrimaryTopology = new TriTopology();
121 this.MaterialBindings = new List<MaterialBinding>();
122 this.BoneBindings = new List<BoneBinding>();
123 this.ExtendedData = new GrannyExtendedData();
124 }
125
126 #region IGrannyMesh Members
127 private string _Name;
128 public string Name { get { return _Name; } set { _Name = value; } }
129 private VertexData _PrimaryVertexData;
130 public VertexData PrimaryVertexData { get { return _PrimaryVertexData; } set { _PrimaryVertexData = value; } }
131
132 private List<MorphTarget> _MorphTargets;
133 public int MorphTargetCount { get { return this.MorphTargets.Count; } }
134 public List<MorphTarget> MorphTargets { get { return _MorphTargets; } set { _MorphTargets = value; } }
135
136 private TriTopology _PrimaryTopology;
137 public TriTopology PrimaryTopology { get { return _PrimaryTopology; } set { _PrimaryTopology = value; } }
138
139 private List<MaterialBinding> _MaterialBindings;
140 public int MaterialBindingCount { get { return this.MaterialBindings.Count; } }
141 public List<MaterialBinding> MaterialBindings { get { return _MaterialBindings; } set { _MaterialBindings = value; } }
142
143 private List<BoneBinding> _BoneBindings;
144 public int BoneBindingCount { get { return this.BoneBindings.Count; } }
145 public List<BoneBinding> BoneBindings { get { return _BoneBindings; } set { _BoneBindings = value; } }
146 #endregion
147
148 #region IExtendedData Members
149 private GrannyExtendedData _ExtendedData;
150 /// <summary>
151 /// When used in a derived class, gets the ExtendedData pointer for this instance
152 /// </summary>
153 public GrannyExtendedData ExtendedData { get { return _ExtendedData; } set { _ExtendedData = value; } }
154 #endregion
155 }
156 }

  ViewVC Help
Powered by ViewVC 1.1.22