The Skung Cave commit
This commit is contained in:
@ -4,7 +4,7 @@ import OrderedCollections
|
||||
|
||||
class G3DbLoader: LoaderProtocol
|
||||
{
|
||||
typealias T = Mesh
|
||||
typealias T = Mesh<VertexPositionNormalTexcoord>
|
||||
|
||||
func load(url: URL) -> T?
|
||||
{
|
||||
@ -12,6 +12,8 @@ class G3DbLoader: LoaderProtocol
|
||||
else { return Optional.none }
|
||||
return try? reader.read()
|
||||
}
|
||||
|
||||
func load(url: URL, content: inout ContentManager) -> T? { return load(url: url) }
|
||||
}
|
||||
|
||||
|
||||
@ -27,15 +29,15 @@ fileprivate struct G3DbReader
|
||||
self.reader = UBJsonReader(file: file)
|
||||
}
|
||||
|
||||
mutating func read() throws -> Mesh
|
||||
mutating func read() throws -> Mesh<VertexPositionNormalTexcoord>
|
||||
{
|
||||
let model = try readModel()
|
||||
|
||||
let mesh = model.meshes[0]
|
||||
|
||||
var vertices = [Mesh.Vertex]()
|
||||
var vertices = [VertexPositionNormalTexcoord]()
|
||||
var indices = [UInt16]()
|
||||
var subMeshes = OrderedDictionary<String, Mesh.SubMesh>()
|
||||
var subMeshes = OrderedDictionary<String, Mesh<VertexPositionNormalTexcoord>.SubMesh>()
|
||||
|
||||
let attributeSize =
|
||||
{ (attrib: G3DAttribute) in
|
||||
|
Reference in New Issue
Block a user