46 DynamicArray<BlockMeshVertex> vertices = blockMesh.
Vertices;
47 DynamicArray<int> indices = blockMesh.
Indices;
92 for (
int i = bounds.
Left - 1; i <= bounds.
Right; i++) {
94 for (
int j = bounds.
Top - 1; j <= bounds.
Bottom; j++) {
104 Position =
new Vector3(i - 0.01f, num - 0.01f, -1.01f), TextureCoordinates =
new Vector2(i - 1 + 0.01f, num + 0.01f)
108 Position =
new Vector3(i - 0.01f, num - 0.01f, 1.01f), TextureCoordinates =
new Vector2(i - 0.01f, num + 0.01f)
112 Position =
new Vector3(i - 0.01f, j + 0.01f, -1.01f), TextureCoordinates =
new Vector2(i - 1 + 0.01f, j - 0.01f)
116 Position =
new Vector3(i - 0.01f, j + 0.01f, 1.01f), TextureCoordinates =
new Vector2(i - 0.01f, j - 0.01f)
129 for (
int k = bounds.
Left - 1; k <= bounds.
Right; k++) {
131 for (
int l = bounds.
Top - 1; l <= bounds.
Bottom; l++) {
139 else if (num3 >= 0) {
141 Position =
new Vector3(k + 1 + 0.01f, num3 - 0.01f, -1.01f), TextureCoordinates =
new Vector2(k + 1 + 0.01f, num3 + 0.01f)
145 Position =
new Vector3(k + 1 + 0.01f, num3 - 0.01f, 1.01f), TextureCoordinates =
new Vector2(k + 2 - 0.01f, num3 + 0.01f)
149 Position =
new Vector3(k + 1 + 0.01f, l + 0.01f, -1.01f), TextureCoordinates =
new Vector2(k + 1 + 0.01f, l - 0.01f)
153 Position =
new Vector3(k + 1 + 0.01f, l + 0.01f, 1.01f), TextureCoordinates =
new Vector2(k + 2 - 0.01f, l - 0.01f)
166 for (
int m = bounds.
Top - 1; m <= bounds.
Bottom; m++) {
168 for (
int n = bounds.
Left - 1; n <= bounds.
Right; n++) {
176 else if (num5 >= 0) {
178 Position =
new Vector3(num5 - 0.01f, m - 0.01f, -1.01f), TextureCoordinates =
new Vector2(num5 + 0.01f, m - 1 + 0.01f)
182 Position =
new Vector3(num5 - 0.01f, m - 0.01f, 1.01f), TextureCoordinates =
new Vector2(num5 + 0.01f, m - 0.01f)
186 Position =
new Vector3(n + 0.01f, m - 0.01f, -1.01f), TextureCoordinates =
new Vector2(n - 0.01f, m - 1 + 0.01f)
190 Position =
new Vector3(n + 0.01f, m - 0.01f, 1.01f), TextureCoordinates =
new Vector2(n - 0.01f, m - 0.01f)
203 for (
int num7 = bounds.
Top - 1; num7 <= bounds.
Bottom; num7++) {
205 for (
int num9 = bounds.
Left - 1; num9 <= bounds.
Right; num9++) {
213 else if (num8 >= 0) {
216 TextureCoordinates =
new Vector2(num8 + 0.01f, num7 + 1 + 0.01f)
221 TextureCoordinates =
new Vector2(num8 + 0.01f, num7 + 2 - 0.01f)
226 TextureCoordinates =
new Vector2(num9 - 0.01f, num7 + 1 + 0.01f)
231 TextureCoordinates =
new Vector2(num9 - 0.01f, num7 + 2 - 0.01f)
244 for (
int num11 = 0; num11 < vertices.
Count; num11++) {
245 vertices.
Array[num11].Position.X -= bounds.Left + bounds.Width / 2f;
246 vertices.
Array[num11].Position.Y = bounds.Bottom - vertices.
Array[num11].Position.Y - bounds.Height / 2f;
247 vertices.
Array[num11].Position.X *= size.X / bounds.
Width;
248 vertices.
Array[num11].Position.Y *= size.Y / bounds.
Height;
249 vertices.
Array[num11].Position.Z *= size.Z / 2f;
250 vertices.
Array[num11].TextureCoordinates.X /= image.
Width;
251 vertices.
Array[num11].TextureCoordinates.Y /= image.
Height;
252 vertices.
Array[num11].Color = color;
260 bool flipWindingOrder,
264 bool skipVanilla =
false;
266 "OnFirstPersonModelDrawing",
268 loader.OnAppendModelMeshPart(
289 if (vertexElements.
Count != 3
290 || vertexElements[0].Offset != 0
292 || vertexElements[1].Offset != 12
294 || vertexElements[2].Offset != 24
296 throw new InvalidOperationException(
"Wrong vertex format for a block mesh.");
298 InternalVertex[] vertexData = GetVertexData<InternalVertex>(vertexBuffer);
299 int[] indexData = GetIndexData<int>(indexBuffer);
300 Dictionary<int, int> dictionary =
new();
302 int num = indexData[i];
303 if (!dictionary.ContainsKey(num)) {
304 dictionary.Add(num,
Vertices.Count);
312 item.IsEmissive =
true;
317 item.Color.A = color.
A;
323 for (
int j = 0; j < meshPart.IndicesCount / 3; j++) {
332 else if (flipWindingOrder) {