File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Sources/GateEngine/Resources/CollisionMesh Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,13 @@ extension ResourceManager {
175175 }
176176}
177177
178+ public extension RawCollisionMesh {
179+ init ( path: String , options: CollisionMeshImporterOptions = . none) async throws {
180+ let importer : any CollisionMeshImporter = try await Game . unsafeShared. resourceManager. collisionMeshImporterForPath ( path)
181+ self = try await importer. loadCollisionMesh ( options: options)
182+ }
183+ }
184+
178185extension ResourceManager . Cache {
179186 @usableFromInline
180187 struct CollisionMeshKey : Hashable , Sendable , CustomStringConvertible {
@@ -287,8 +294,7 @@ extension ResourceManager {
287294 let path = key. requestedPath
288295
289296 do {
290- let importer : any CollisionMeshImporter = try await Game . unsafeShared. resourceManager. collisionMeshImporterForPath ( path)
291- let rawCollisionMesh = try await importer. loadCollisionMesh ( options: key. collisionMeshOptions)
297+ let rawCollisionMesh = try await RawCollisionMesh ( path: path, options: key. collisionMeshOptions)
292298
293299 Task { @MainActor in
294300 if let cache = cache. collisionMeshes [ key] {
You can’t perform that action at this time.
0 commit comments