BNBAssetManager
Objective-C
@interface BNBAssetManager : NSObject
/**
*create image of given type
*@param name (string): image name
*@param type (image_type): image type
*@return created image (image).
*/
- (nullable BNBImage *)createImage:(nonnull NSString *)name
type:(BNBImageType)type;
/**
*create resource and start async loading in the asset_manager threadpool
*@param name (resource): resource filename
*@return created resource (resource).
*/
- (nullable BNBResource *)createResource:(nonnull NSString *)filename;
- (nullable BNBImage *)createSegmentationMask:(nonnull NSString *)name
type:(BNBSegmentationMaskType)type;
- (nullable BNBImage *)createProceduralTexture:(nonnull NSString *)name
type:(BNBProceduralAlgorithmType)type;
/**
*creates render target
*@param name (string): render target name
*@return created render target (render_target).
*/
- (nullable BNBRenderTarget *)createRenderTarget:(nonnull NSString *)name;
/**
*creates audio_track
*@param name (string): audio track name
*@return created audio track (audio_track).
*/
- (nullable BNBAudioTrack *)createAudioTrack:(nonnull NSString *)name;
/**
*creates face
*@param name (string): face name
*@return created face (face).
*/
- (nullable BNBFace *)createFace:(nonnull NSString *)name;
/**
*creates morphing
*@param name (string): morphing name
*@return created morphing (morphing).
*/
- (nullable BNBMorphing *)createMorph:(nonnull NSString *)name
type:(BNBMorphingType)type;
/**
*creates static mesh
*@param name (string): mesh name
*@return created mesh (mesh).
*/
- (nullable BNBMesh *)createStaticMesh:(nonnull NSString *)name;
/**
*creates dynamicaly updated mesh
*@param name (string): mesh name
*@param path (string): path to mesh
*@return created mesh (mesh).
*/
- (nullable BNBMesh *)createDynamicMesh:(nonnull NSString *)name
path:(nonnull NSString *)path;
/**
*creates hand
*@param name (string): hand name
*@return created hand (hand).
*/
- (nullable BNBHand *)createHand:(nonnull NSString *)name;
/**
*upload mesh file
*@param mesh (mesh): mesh
*@param fileName (string): file to upload
*/
- (void)uploadMeshData:(nullable BNBMesh *)mesh
fileName:(nonnull NSString *)fileName;
/**
*creates material
*@param name (string): material name
*@param path (string): path to shaders
*@return created material (material).
*/
- (nullable BNBMaterial *)createMaterial:(nonnull NSString *)name
path:(nonnull NSString *)path;
/**
*creates material
*@param name (string): material name
*@param vsPath (string): path to vertex shader
*@param fsPath (string): path to fragment shader
*@param instanceCount (i32): instances count
*@param extraDefs (list<string>): defines list for shader
*@return created material (material).
*/
- (nullable BNBMaterial *)createMaterialExt:(nonnull NSString *)name
vsPath:(nonnull NSString *)vsPath
fsPath:(nonnull NSString *)fsPath
instanceCount:(int32_t)instanceCount
extraDefs:(nonnull NSArray<NSString *> *)extraDefs;
/**
*Find image by specified name. Returns null if image not found.
*@param name (string) image name.
*/
- (nullable BNBImage *)findImage:(nonnull NSString *)name;
/**
*Find render target by specified name. Returns null if render target not found.
*@param name (string) render target name.
*/
- (nullable BNBRenderTarget *)findRenderTarget:(nonnull NSString *)name;
/**
*Find audio track by specified name. Returns null if audio track not found.
*@param name (string) audio track name.
*/
- (nullable BNBAudioTrack *)findAudioTrack:(nonnull NSString *)name;
/**
*Find face by specified name. Returns null if face not found.
*@param name (string) face name.
*/
- (nullable BNBFace *)findFace:(nonnull NSString *)name;
/**
*Find hand by specified name. Returns null if hand not found.
*@param name (string) hand name.
*/
- (nullable BNBHand *)findHand:(nonnull NSString *)name;
/**
*Find morph by specified name. Returns null if morph not found.
*@param name (string) morph name.
*/
- (nullable BNBMorphing *)findMorph:(nonnull NSString *)name;
/**
*Find mesh by specified name. Returns null if mesh not found.
*@param name (string) mesh name.
*/
- (nullable BNBMesh *)findMesh:(nonnull NSString *)name;
/**
*Find material by specified name. Returns null if material not found.
*@param name (string) material name.
*/
- (nullable BNBMaterial *)findMaterial:(nonnull NSString *)name;
@end
Swift
class BNBAssetManager : NSObject
Undocumented
-
create image of given type
Declaration
Objective-C
- (nullable BNBImage *)createImage:(nonnull NSString *)name type:(BNBImageType)type;
Swift
func createImage(_ name: String, type: BNBImageType) -> BNBImage?
Parameters
name
(string): image name
type
(image_type): image type
Return Value
created image (image).
-
create resource and start async loading in the asset_manager threadpool
Declaration
Objective-C
- (nullable BNBResource *)createResource:(nonnull NSString *)filename;
Swift
func createResource(_ filename: String) -> BNBResource?
Parameters
name
(resource): resource filename
Return Value
created resource (resource).
-
Undocumented
Declaration
Objective-C
- (nullable BNBImage *)createSegmentationMask:(nonnull NSString *)name type:(BNBSegmentationMaskType)type;
Swift
func createSegmentationMask(_ name: String, type: BNBSegmentationMaskType) -> BNBImage?
-
Undocumented
Declaration
Objective-C
- (nullable BNBImage *)createProceduralTexture:(nonnull NSString *)name type:(BNBProceduralAlgorithmType)type;
Swift
func createProceduralTexture(_ name: String, type: BNBProceduralAlgorithmType) -> BNBImage?
-
creates render target
Declaration
Objective-C
- (nullable BNBRenderTarget *)createRenderTarget:(nonnull NSString *)name;
Swift
func createRenderTarget(_ name: String) -> BNBRenderTarget?
Parameters
name
(string): render target name
Return Value
created render target (render_target).
-
creates audio_track
Declaration
Objective-C
- (nullable BNBAudioTrack *)createAudioTrack:(nonnull NSString *)name;
Swift
func createAudioTrack(_ name: String) -> BNBAudioTrack?
Parameters
name
(string): audio track name
Return Value
created audio track (audio_track).
-
creates morphing
Declaration
Objective-C
- (nullable BNBMorphing *)createMorph:(nonnull NSString *)name type:(BNBMorphingType)type;
Swift
func createMorph(_ name: String, type: BNBMorphingType) -> BNBMorphing?
Parameters
name
(string): morphing name
Return Value
created morphing (morphing).
-
creates dynamicaly updated mesh
Declaration
Objective-C
- (nullable BNBMesh *)createDynamicMesh:(nonnull NSString *)name path:(nonnull NSString *)path;
Swift
func createDynamicMesh(_ name: String, path: String) -> BNBMesh?
Parameters
name
(string): mesh name
path
(string): path to mesh
Return Value
created mesh (mesh).
-
creates material
Declaration
Objective-C
- (nullable BNBMaterial *)createMaterial:(nonnull NSString *)name path:(nonnull NSString *)path;
Swift
func createMaterial(_ name: String, path: String) -> BNBMaterial?
Parameters
name
(string): material name
path
(string): path to shaders
Return Value
created material (material).
-
creates material
Declaration
Objective-C
- (nullable BNBMaterial *)createMaterialExt:(nonnull NSString *)name vsPath:(nonnull NSString *)vsPath fsPath:(nonnull NSString *)fsPath instanceCount:(int32_t)instanceCount extraDefs: (nonnull NSArray<NSString *> *)extraDefs;
Swift
func createMaterialExt(_ name: String, vsPath: String, fsPath: String, instanceCount: Int32, extraDefs: [String]) -> BNBMaterial?
Parameters
name
(string): material name
vsPath
(string): path to vertex shader
fsPath
(string): path to fragment shader
instanceCount
(i32): instances count
extraDefs
(list
): defines list for shader Return Value
created material (material).
-
Find render target by specified name. Returns null if render target not found.
Declaration
Objective-C
- (nullable BNBRenderTarget *)findRenderTarget:(nonnull NSString *)name;
Swift
func findRenderTarget(_ name: String) -> BNBRenderTarget?
Parameters
name
(string) render target name.
-
Find audio track by specified name. Returns null if audio track not found.
Declaration
Objective-C
- (nullable BNBAudioTrack *)findAudioTrack:(nonnull NSString *)name;
Swift
func findAudioTrack(_ name: String) -> BNBAudioTrack?
Parameters
name
(string) audio track name.
-
Find morph by specified name. Returns null if morph not found.
Declaration
Objective-C
- (nullable BNBMorphing *)findMorph:(nonnull NSString *)name;
Swift
func findMorph(_ name: String) -> BNBMorphing?
Parameters
name
(string) morph name.
-
Find material by specified name. Returns null if material not found.
Declaration
Objective-C
- (nullable BNBMaterial *)findMaterial:(nonnull NSString *)name;
Swift
func findMaterial(_ name: String) -> BNBMaterial?
Parameters
name
(string) material name.