Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More Swift means fewer helper methods
- Loading branch information
Showing
9 changed files
with
49 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// GLLItemMesh+Extensions.swift | ||
// GLLara | ||
// | ||
// Created by Torsten Kammer on 05.05.24. | ||
// Copyright © 2024 Torsten Kammer. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
extension GLLItemMesh { | ||
@objc func renderParameter(name: String) -> GLLRenderParameter? { | ||
return renderParameters.first { $0.name == name } | ||
} | ||
|
||
@objc func texture(identifier: String) -> GLLItemMeshTexture? { | ||
return textures.first { $0.identifier == identifier } | ||
} | ||
|
||
@objc var isUsingBlending: Bool { | ||
get { | ||
if isCustomBlending { | ||
return isBlended | ||
} else { | ||
return mesh.usesAlphaBlending | ||
} | ||
} | ||
set { | ||
isCustomBlending = true | ||
isBlended = newValue | ||
} | ||
} | ||
|
||
@objc var mesh: GLLModelMesh { | ||
return item.model.meshes[Int(meshIndex)] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters