forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelMeshPart.cs
More file actions
129 lines (113 loc) · 4.06 KB
/
Copy pathModelMeshPart.cs
File metadata and controls
129 lines (113 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
using System;
namespace Microsoft.Xna.Framework.Graphics
{
public sealed class ModelMeshPart
{
// Summary:
// Gets or sets the material Effect for this mesh part. Reference page contains
// code sample.
private Effect _effect;
public Effect Effect
{
get
{
return _effect;
}
set
{
if (value == _effect)
return;
if (_effect != null)
{
// First check to see any other parts are also using this effect.
var removeEffect = true;
foreach (var part in parent.MeshParts)
{
if (part != this && part._effect == _effect)
{
removeEffect = false;
break;
}
}
if (removeEffect)
parent.Effects.Remove(_effect);
}
// Set the new effect.
_effect = value;
parent.Effects.Add(value);
}
}
//
// Summary:
// Gets the index buffer for this mesh part.
public IndexBuffer IndexBuffer { get; set; }
//
// Summary:
// Gets the number of vertices used during a draw call.
public int NumVertices { get; set; }
//
// Summary:
// Gets the number of primitives to render.
public int PrimitiveCount { get; set; }
//
// Summary:
// Gets the location in the index array at which to start reading vertices.
public int StartIndex { get; set; }
//
// Summary:
// Gets or sets an object identifying this model mesh part.
public object Tag { get; set; }
//
// Summary:
// Gets the vertex buffer for this mesh part.
public VertexBuffer VertexBuffer { get; set; }
//
// Summary:
// Gets the offset (in vertices) from the top of vertex buffer.
public int VertexOffset { get; set; }
internal int VertexBufferIndex { get; set; }
internal int IndexBufferIndex { get; set; }
internal int EffectIndex { get; set; }
internal ModelMesh parent;
}
//// Summary:
//// Represents a batch of geometry information to submit to the graphics device
//// during rendering. Each ModelMeshPart is a subdivision of a ModelMesh object.
//// The ModelMesh class is split into multiple ModelMeshPart objects, typically
//// based on material information.
//public sealed class ModelMeshPart
//{
// // Summary:
// // Gets or sets the material Effect for this mesh part. Reference page contains
// // code sample.
// public Effect Effect { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } }
// //
// // Summary:
// // Gets the index buffer for this mesh part.
// public IndexBuffer IndexBuffer { get { throw new NotImplementedException(); } }
// //
// // Summary:
// // Gets the number of vertices used during a draw call.
// public int NumVertices { get { throw new NotImplementedException(); } }
// //
// // Summary:
// // Gets the number of primitives to render.
// public int PrimitiveCount { get { throw new NotImplementedException(); } }
// //
// // Summary:
// // Gets the location in the index array at which to start reading vertices.
// public int StartIndex { get { throw new NotImplementedException(); } }
// //
// // Summary:
// // Gets or sets an object identifying this model mesh part.
// public object Tag { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } }
// //
// // Summary:
// // Gets the vertex buffer for this mesh part.
// public VertexBuffer VertexBuffer { get { throw new NotImplementedException(); } }
// //
// // Summary:
// // Gets the offset (in vertices) from the top of vertex buffer.
// public int VertexOffset { get { throw new NotImplementedException(); } }
//}
}