RROBJLoader

Objective-C

@interface RROBJLoader : NSObject

Swift

class RROBJLoader : NSObject

A loader class for 3d meshes based on the OBJ file format

See

RRMesh3D
  • Default initializer

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • Load OBJ file from file data

    Declaration

    Objective-C

    - (BOOL)fromData:(nonnull NSData *)data
        didFailWithError:(NSError *_Nullable *_Nullable)error;

    Swift

    func fromData(_ data: Data) throws

    Parameters

    data

    An NSData instance containing the file data of an OBJ file

    error

    An optional pointer to an NSError pointer. When this method fails, it will set an NSError instance to this pointer if provided.

    Return Value

    YES if successful, NO otherwise.

  • Load OBJ file from file

    Declaration

    Objective-C

    - (BOOL)fromFile:(nonnull NSString *)filePath
        didFailWithError:(NSError *_Nullable *_Nullable)error;

    Swift

    func fromFile(_ filePath: String) throws

    Parameters

    filePath

    The file path of an OBJ file

    error

    An optional pointer to an NSError pointer. When this method fails, it will set an NSError instance to this pointer if provided.

    Return Value

    YES if successful, NO otherwise.

  • Save loaded data to OBJ file

    Declaration

    Objective-C

    - (BOOL)saveToFile:(nonnull NSString *)filePath
        didFailWithError:(NSError *_Nullable *_Nullable)error;

    Swift

    func save(toFile filePath: String) throws

    Parameters

    filePath

    The file path to save the OBJ file at

    error

    An optional pointer to an NSError pointer. When this method fails, it will set an NSError instance to this pointer if provided.

    Return Value

    YES if successful, NO otherwise.

  • Create an RRMesh3D instance based on the loaded OBJ data

    See

    RRMesh3D

    Declaration

    Objective-C

    - (nonnull RRMesh3D *)toMesh3D;

    Swift

    func toMesh3D() -> RRMesh3D

    Return Value

    The loaded RRMesh3D instance