Package com.badlogic.gdx.assets.loaders
Class ModelLoader<P extends ModelLoader.ModelParameters>
- java.lang.Object
-
- com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
-
- com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<Model,P>
-
- com.badlogic.gdx.assets.loaders.ModelLoader<P>
-
- Direct Known Subclasses:
G3dModelLoader,ObjLoader
public abstract class ModelLoader<P extends ModelLoader.ModelParameters> extends AsynchronousAssetLoader<Model,P>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classModelLoader.ModelParameters
-
Field Summary
Fields Modifier and Type Field Description protected ModelLoader.ModelParametersdefaultParametersprotected Array<ObjectMap.Entry<java.lang.String,ModelData>>items
-
Constructor Summary
Constructors Constructor Description ModelLoader(FileHandleResolver resolver)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Array<AssetDescriptor>getDependencies(java.lang.String fileName, FileHandle file, P parameters)Returns the assets this asset requires to be loaded first.voidloadAsync(AssetManager manager, java.lang.String fileName, FileHandle file, P parameters)Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.ModelloadModel(FileHandle fileHandle)Directly load the model on the calling thread.ModelloadModel(FileHandle fileHandle, TextureProvider textureProvider)Directly load the model on the calling thread.ModelloadModel(FileHandle fileHandle, TextureProvider textureProvider, P parameters)Directly load the model on the calling thread.ModelloadModel(FileHandle fileHandle, P parameters)Directly load the model on the calling thread.ModelDataloadModelData(FileHandle fileHandle)Directly load the raw model data on the calling thread.abstract ModelDataloadModelData(FileHandle fileHandle, P parameters)Directly load the raw model data on the calling thread.ModelloadSync(AssetManager manager, java.lang.String fileName, FileHandle file, P parameters)Loads the OpenGL part of the asset.-
Methods inherited from class com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader
unloadAsync
-
Methods inherited from class com.badlogic.gdx.assets.loaders.AssetLoader
resolve
-
-
-
-
Field Detail
-
items
protected Array<ObjectMap.Entry<java.lang.String,ModelData>> items
-
defaultParameters
protected ModelLoader.ModelParameters defaultParameters
-
-
Constructor Detail
-
ModelLoader
public ModelLoader(FileHandleResolver resolver)
-
-
Method Detail
-
loadModelData
public abstract ModelData loadModelData(FileHandle fileHandle, P parameters)
Directly load the raw model data on the calling thread.
-
loadModelData
public ModelData loadModelData(FileHandle fileHandle)
Directly load the raw model data on the calling thread.
-
loadModel
public Model loadModel(FileHandle fileHandle, TextureProvider textureProvider, P parameters)
Directly load the model on the calling thread. The model with not be managed by anAssetManager.
-
loadModel
public Model loadModel(FileHandle fileHandle, P parameters)
Directly load the model on the calling thread. The model with not be managed by anAssetManager.
-
loadModel
public Model loadModel(FileHandle fileHandle, TextureProvider textureProvider)
Directly load the model on the calling thread. The model with not be managed by anAssetManager.
-
loadModel
public Model loadModel(FileHandle fileHandle)
Directly load the model on the calling thread. The model with not be managed by anAssetManager.
-
getDependencies
public Array<AssetDescriptor> getDependencies(java.lang.String fileName, FileHandle file, P parameters)
Description copied from class:AssetLoaderReturns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.- Specified by:
getDependenciesin classAssetLoader<Model,P extends ModelLoader.ModelParameters>- Parameters:
fileName- name of the asset to loadfile- the resolved file to loadparameters- parameters for loading the asset- Returns:
- other assets that the asset depends on and need to be loaded first or null if there are no dependencies.
-
loadAsync
public void loadAsync(AssetManager manager, java.lang.String fileName, FileHandle file, P parameters)
Description copied from class:AsynchronousAssetLoaderLoads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.- Specified by:
loadAsyncin classAsynchronousAssetLoader<Model,P extends ModelLoader.ModelParameters>fileName- the name of the asset to loadfile- the resolved file to loadparameters- the parameters to use for loading the asset
-
loadSync
public Model loadSync(AssetManager manager, java.lang.String fileName, FileHandle file, P parameters)
Description copied from class:AsynchronousAssetLoaderLoads the OpenGL part of the asset.- Specified by:
loadSyncin classAsynchronousAssetLoader<Model,P extends ModelLoader.ModelParameters>file- the resolved file to load
-
-