 |
ReaderObj Class |
ReaderObj can read 3D models from obj files.
Inheritance Hierarchy Namespace: Ab4d.SharpEngine.UtilitiesAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
SyntaxThe ReaderObj type exposes the following members.
Constructors | Name | Description |
---|
 | ReaderObj(IBitmapIO) |
Constructor that only takes an optional bitmapIO and will not create the textures immediately.
Also the no cache is used to read and store the textures.
|
 | ReaderObj(IBitmapIO, Scene) |
Constructor with optional Scene object that when specified is used to cache the loaded textures.
When Scene.GpuDevice is initialized, then the textures are immediately created. Otherwise the textures are created when materials with textures are initialized.
|
 | ReaderObj(IBitmapIO, VulkanDevice) |
Constructor with optional gpuDevice object that when specified is used to create and cache the loaded textures.
When gpuDevice is null, then the textures are created when materials with textures are initialized.
|
Top
Properties | Name | Description |
---|
 | DetectEncodingFromByteOrderMarks |
Indicates whether to look for byte order marks at the beginning of the file to detect the text encoding (using in StreamReader constructor). Default value is true.
|
 | Errors |
Gets a list of errors that occur during obj file loading.
|
 | IgnoreErrors |
Gets or sets a Boolean that specifies if errors are ignored and reader tries to read as much data as possible.
The error texts are written to Errors list.
|
 | NamedObjects |
Gets a dictionary that can be used to get a 3D object by its name (key = name, value = MeshModelNode)
|
 | ResolveResourceFunc |
Gets or sets a Func that returns stream from the specified resource name. This can be used to read resources from stream.
The returned stream will be closed by the ReaderObj.
|
Top
Methods | Name | Description |
---|
 | ReadObjFileData(Stream) |
Reads the obj file from specified stream and returns the ObjFileData object.
|
 | ReadObjFileData(String) |
Reads the objFileName file and returns the ObjFileData object.
|
 | ReadSceneNodes(String) |
Reads the 3D models from objFileName file and returns the 3D model(s) as a GroupNode that contains MeshModelNodes and other GroupNodes.
The method will not return null but an empty GroupNode in case no model is read.
Textures directory is the same as obj file directory.
|
 | ReadSceneNodes(Stream, FuncString, Stream) |
Reads the 3D models from stream and returns the 3D model(s) as a GroupNode that contains MeshModelNodes and other GroupNodes.
When the obj file have any additional resources (materials and textures), the resolveResourceFunc must be set to a method that converts resource names into Streams.
The method will not return null but an empty GroupNode in case no model is read.
|
 | ReadSceneNodes(Stream, FuncString, Stream, Material) |
Reads the 3D models from stream and returns the 3D model(s) as a GroupNode that contains MeshModelNodes and other GroupNodes.
When the obj file have any additional resources (materials and textures), the resolveResourceFunc must be set a method that converts the resource name into Stream.
The method will not return null but an empty GroupNode in case no model is read.
|
 | ReadSceneNodes(String, String, StandardMaterial) |
Reads the 3D models from objFileName file and returns the 3D model(s) as a GroupNode that contains MeshModelNodes and other GroupNodes.
The method will not return null but an empty GroupNode in case no model is read.
|
Top
See Also