Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ModelMesh.cs
Go to the documentation of this file.
1
using
System
;
2
3
namespace
Microsoft.Xna.Framework.Graphics
;
4
5
public
sealed
class
ModelMesh
6
{
7
private
string
name
;
8
9
private
ModelBone
parentBone
;
10
11
private
BoundingSphere
boundingSphere
=
default
(
BoundingSphere
);
12
13
private
ModelMeshPartCollection
meshParts
;
14
15
private
ModelEffectCollection
effects
=
new
ModelEffectCollection
();
16
17
private
object
tag
;
18
19
public
string
Name
=>
name
;
20
21
public
ModelBone
ParentBone
=>
parentBone
;
22
23
public
BoundingSphere
BoundingSphere
=>
boundingSphere
;
24
25
public
object
Tag
26
{
27
get
28
{
29
return
tag
;
30
}
31
set
32
{
33
tag
=
value
;
34
}
35
}
36
37
public
ModelMeshPartCollection
MeshParts
=>
meshParts
;
38
39
public
ModelEffectCollection
Effects =>
effects
;
40
41
internal
ModelMesh
(
string
name
,
ModelBone
parentBone
,
BoundingSphere
boundingSphere
,
ModelMeshPart
[]
meshParts
,
object
tag
)
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
{
65
throw
new
InvalidOperationException
(
FrameworkResources
.
ModelHasNoEffect
);
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
}
Microsoft.Xna.Framework.FrameworkResources.ModelHasNoEffect
static string ModelHasNoEffect
Definition
FrameworkResources.cs:331
Microsoft.Xna.Framework.FrameworkResources
Definition
FrameworkResources.cs:15
Microsoft.Xna.Framework.Graphics.EffectPassCollection.Count
int Count
Definition
EffectPassCollection.cs:46
Microsoft.Xna.Framework.Graphics.EffectTechnique.Passes
EffectPassCollection Passes
Definition
EffectTechnique.cs:23
Microsoft.Xna.Framework.Graphics.Effect.CurrentTechnique
unsafe EffectTechnique CurrentTechnique
Definition
Effect.cs:34
Microsoft.Xna.Framework.Graphics.Effect
Definition
Effect.cs:12
Microsoft.Xna.Framework.Graphics.ModelBone
Definition
ModelBone.cs:4
Microsoft.Xna.Framework.Graphics.ModelEffectCollection
Definition
ModelEffectCollection.cs:9
Microsoft.Xna.Framework.Graphics.ModelMeshPartCollection
Definition
ModelMeshPartCollection.cs:9
Microsoft.Xna.Framework.Graphics.ModelMeshPart.Draw
void Draw()
Definition
ModelMeshPart.cs:99
Microsoft.Xna.Framework.Graphics.ModelMeshPart.Effect
Effect Effect
Definition
ModelMeshPart.cs:36
Microsoft.Xna.Framework.Graphics.ModelMeshPart
Definition
ModelMeshPart.cs:4
Microsoft.Xna.Framework.Graphics.ModelMesh.boundingSphere
BoundingSphere boundingSphere
Definition
ModelMesh.cs:11
Microsoft.Xna.Framework.Graphics.ModelMesh.parentBone
ModelBone parentBone
Definition
ModelMesh.cs:9
Microsoft.Xna.Framework.Graphics.ModelMesh.tag
object tag
Definition
ModelMesh.cs:17
Microsoft.Xna.Framework.Graphics.ModelMesh.name
string name
Definition
ModelMesh.cs:7
Microsoft.Xna.Framework.Graphics.ModelMesh.MeshParts
ModelMeshPartCollection MeshParts
Definition
ModelMesh.cs:37
Microsoft.Xna.Framework.Graphics.ModelMesh.Draw
void Draw()
Definition
ModelMesh.cs:56
Microsoft.Xna.Framework.Graphics.ModelMesh.Tag
object Tag
Definition
ModelMesh.cs:26
Microsoft.Xna.Framework.Graphics.ModelMesh.Name
string Name
Definition
ModelMesh.cs:19
Microsoft.Xna.Framework.Graphics.ModelMesh.ParentBone
ModelBone ParentBone
Definition
ModelMesh.cs:21
Microsoft.Xna.Framework.Graphics.ModelMesh.meshParts
ModelMeshPartCollection meshParts
Definition
ModelMesh.cs:13
Microsoft.Xna.Framework.Graphics.ModelMesh.effects
ModelEffectCollection effects
Definition
ModelMesh.cs:15
Microsoft.Xna.Framework.Graphics.ModelMesh.ModelMesh
ModelMesh(string name, ModelBone parentBone, BoundingSphere boundingSphere, ModelMeshPart[] meshParts, object tag)
Definition
ModelMesh.cs:41
Microsoft.Xna.Framework.Graphics.ModelMesh
Definition
ModelMesh.cs:6
System.Collections.ObjectModel.ReadOnlyCollection.Count
int Count
Definition
ReadOnlyCollection.cs:15
System.InvalidOperationException
Definition
InvalidOperationException.cs:9
Microsoft.Xna.Framework.Graphics
Definition
AlphaTestEffect.cs:1
System.ExceptionArgument.value
@ value
System.ExceptionArgument.count
@ count
System
Definition
BlockingCollection.cs:8
Microsoft.Xna.Framework.BoundingSphere
Definition
BoundingSphere.cs:13
source
Microsoft.Xna.Framework.Graphics
ModelMesh.cs
Generated by
1.10.0