mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-02 21:00:57 +00:00
24 lines
609 B
Swift
24 lines
609 B
Swift
public struct Mesh<VertexType: Vertex, IndexType: UnsignedInteger>: Equatable {
|
|
public let vertices: [VertexType]
|
|
public let indices: [IndexType]
|
|
}
|
|
|
|
public extension Mesh {
|
|
static var empty: Self { .init(vertices: .init(), indices: .init()) }
|
|
}
|
|
|
|
public protocol Vertex: Equatable {}
|
|
|
|
public struct VertexPositionNormalTexcoord: Vertex {
|
|
var position: SIMD3<Float>
|
|
var normal: SIMD3<Float>
|
|
var texCoord: SIMD2<Float>
|
|
}
|
|
|
|
public struct VertexPositionNormalColorTexcoord: Vertex {
|
|
var position: SIMD3<Float>
|
|
var normal: SIMD3<Float>
|
|
var color: SIMD4<Float>
|
|
var texCoord: SIMD2<Float>
|
|
}
|