Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ModelMesh.cs
Go to the documentation of this file.
1using System;
2
4
5public sealed class ModelMesh
6{
7 private string name;
8
10
12
14
16
17 private object tag;
18
19 public string Name => name;
20
22
24
25 public object Tag
26 {
27 get
28 {
29 return tag;
30 }
31 set
32 {
33 tag = value;
34 }
35 }
36
38
39 public ModelEffectCollection Effects => effects;
40
42 {
43 this.name = name;
44 this.parentBone = parentBone;
45 this.boundingSphere = boundingSphere;
46 this.meshParts = new ModelMeshPartCollection(meshParts);
47 this.tag = tag;
48 int num = meshParts.Length;
49 for (int i = 0; i < num; i++)
50 {
51 ModelMeshPart modelMeshPart = meshParts[i];
52 modelMeshPart.parent = this;
53 }
54 }
55
56 public void Draw()
57 {
58 int count = MeshParts.Count;
59 for (int i = 0; i < count; i++)
60 {
61 ModelMeshPart modelMeshPart = MeshParts[i];
62 Effect effect = modelMeshPart.Effect;
63 if (effect == null)
64 {
66 }
67 int count2 = effect.CurrentTechnique.Passes.Count;
68 for (int j = 0; j < count2; j++)
69 {
70 effect.CurrentTechnique.Passes[j].Apply();
71 modelMeshPart.Draw();
72 }
73 }
74 }
75}
unsafe EffectTechnique CurrentTechnique
Definition Effect.cs:34
ModelMesh(string name, ModelBone parentBone, BoundingSphere boundingSphere, ModelMeshPart[] meshParts, object tag)
Definition ModelMesh.cs:41