Package com.jme3.asset
Interface AssetProcessor
- All Known Implementing Classes:
CloneableAssetProcessor
,MaterialProcessor
,TextureProcessor
public interface AssetProcessor
AssetProcessor
is used to apply processing to assets
after they have been loaded. They are assigned to a particular
asset type (which is represented by a Class
) and any assets
loaded that are of that class will be processed by the assigned
processor.-
Method Summary
Modifier and TypeMethodDescriptioncreateClone
(Object obj) Creates a clone of the given asset.postProcess
(AssetKey key, Object obj) Applies post-processing to an asset.
-
Method Details
-
postProcess
Applies post-processing to an asset. The method may return an object that is not the same instance as the parameter object, and it could be from a different class.- Parameters:
key
- the key used to load the assetobj
- The asset that was loaded from anAssetLoader
.- Returns:
- Either the same object with processing applied, or an instance of a new object.
-
createClone
Creates a clone of the given asset. If no clone is desired, then the same instance can be returned, otherwise, a clone should be created. For example, a clone of aMaterial
should have its own set of unique parameters that can be changed just for that instance, but it may share certain other data if it sees fit (like theShader
).- Parameters:
obj
- The asset to clone- Returns:
- The cloned asset, or the same as the given argument if no clone is needed.
-