store vertices on MeshPart

main
Evan Hemsley 2020-07-28 02:36:20 -07:00
parent 47a98f8fc5
commit 597e0b59f4
2 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,6 @@
using System.Collections.Generic;
using System.IO;
using System.Numerics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Smuggler
@ -72,9 +72,9 @@ namespace Smuggler
indices[indexCounter] = index;
vertices[index] = new VertexPositionNormalTexture(
new Microsoft.Xna.Framework.Vector3(position.X, position.Y, position.Z),
new Microsoft.Xna.Framework.Vector3(normal.X, normal.Y, normal.Z),
new Microsoft.Xna.Framework.Vector2(texcoord.X, texcoord.Y)
new Vector3(position.X, position.Y, position.Z),
new Vector3(normal.X, normal.Y, normal.Z),
new Vector2(texcoord.X, texcoord.Y)
);
indexCounter++;
@ -87,6 +87,7 @@ namespace Smuggler
new MeshPart(
vertexBuffer,
indexBuffer,
positions,
triangles.ToArray(),
new BasicEffect(graphicsDevice)
)

View File

@ -7,13 +7,15 @@ namespace Smuggler
{
public IndexBuffer IndexBuffer { get; }
public VertexBuffer VertexBuffer { get; }
public Vector3[] Vertices { get; }
public Triangle[] Triangles { get; }
public BasicEffect Effect { get; }
public MeshPart(VertexBuffer vertexBuffer, IndexBuffer indexBuffer, Triangle[] triangles, BasicEffect effect)
public MeshPart(VertexBuffer vertexBuffer, IndexBuffer indexBuffer, Vector3[] vertices, Triangle[] triangles, BasicEffect effect)
{
VertexBuffer = vertexBuffer;
IndexBuffer = indexBuffer;
Vertices = vertices;
Triangles = triangles;
Effect = effect;
}