Class OBJFileLoader
Hierarchy
- OBJFileLoader
Implements
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
Creates loader for .OBJ files
Parameters
-
Optional meshLoadOptions: MeshLoadOptions
options for loading and parsing OBJ/MTL files.
Returns OBJFileLoader
-
Properties
extensionsSearch playground for extensions
Defines the extension the plugin is able to load.
nameSearch playground for name
Defines the name of the plugin.
Static COMPUTE_ NORMALSSearch playground for COMPUTE_NORMALS
Compute the normals for the model, even if normals are present in the file.
Static IMPORT_ VERTEX_ COLORSSearch playground for IMPORT_VERTEX_COLORS
Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.
Static INVERT_ YSearch playground for INVERT_Y
Invert model on y-axis (does a model scaling inversion)
Static MATERIAL_ LOADING_ FAILS_ SILENTLYSearch playground for MATERIAL_LOADING_FAILS_SILENTLY
When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.
Defaults to true for backwards compatibility.
Static OPTIMIZE_ WITH_ UVSearch playground for OPTIMIZE_WITH_UV
Defines if UVs are optimized by default during load.
Static SKIP_ MATERIALSSearch playground for SKIP_MATERIALS
Skip loading the materials even if defined in the OBJ file (materials are ignored).
Static UV_ SCALINGSearch playground for UV_SCALING
Defines custom scaling of UV coordinates of loaded meshes.
Accessors
Static INVERT_ TEXTURE_ Y
-
Invert Y-Axis of referenced textures on load
Returns boolean
-
Invert Y-Axis of referenced textures on load
Parameters
-
value: boolean
Returns any
-
Methods
can Direct LoadSearch playground for canDirectLoad
-
If the data string can be loaded directly.
Parameters
-
data: string
string containing the file data
Returns boolean
if the data can be loaded directly
-
create PluginSearch playground for createPlugin
-
Instantiates a OBJ file loader plugin.
Returns ISceneLoaderPluginAsync | ISceneLoaderPlugin
the created plugin
import Mesh AsyncSearch playground for importMeshAsync
-
Imports one or more meshes from the loaded OBJ data and adds them to the scene
Parameters
-
meshesNames: any
a string or array of strings of the mesh names that should be loaded from the file
-
scene: Scene
the scene the meshes should be added to
-
data: any
the OBJ data to load
-
rootUrl: string
root url to load from
-
Optional onProgress: (event: ISceneLoaderProgressEvent) => void
event that fires when loading progress has occured
-
-
Parameters
-
event: ISceneLoaderProgressEvent
Returns void
-
-
-
-
Optional fileName: string
Defines the name of the file to load
Returns Promise<ISceneLoaderAsyncResult>
a promise containg the loaded meshes, particles, skeletons and animations
-
load Asset Container AsyncSearch playground for loadAssetContainerAsync
-
Load into an asset container.
Parameters
-
scene: Scene
The scene to load into
-
data: string
The data to import
-
rootUrl: string
The root url for scene and resources
-
Optional onProgress: (event: ISceneLoaderProgressEvent) => void
The callback when the load progresses
-
-
Parameters
-
event: ISceneLoaderProgressEvent
Returns void
-
-
-
-
Optional fileName: string
Defines the name of the file to load
Returns Promise<AssetContainer>
The loaded asset container
-
load AsyncSearch playground for loadAsync
-
Imports all objects from the loaded OBJ data and adds them to the scene
Parameters
-
scene: Scene
the scene the objects should be added to
-
data: string
the OBJ data to load
-
rootUrl: string
root url to load from
-
Optional onProgress: (event: ISceneLoaderProgressEvent) => void
event that fires when loading progress has occured
-
-
Parameters
-
event: ISceneLoaderProgressEvent
Returns void
-
-
-
-
Optional fileName: string
Defines the name of the file to load
Returns Promise<void>
a promise which completes when objects have been loaded to the scene
-
OBJ file type loader. This is a babylon scene loader plugin.