public final class Loader
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
clearCache()
Empties the file-cache.
|
static Object3D[] |
load3DS(java.io.InputStream stream,
float scale)
Loads a file in 3DS-format into an array of objects. 3DS is a 3D-Studio
format supported by many converter tools.
|
static Object3D |
loadASC(java.io.InputStream stream,
float scale,
boolean swap)
Loads a file in ASC-format into an object.
|
static Object3D |
loadMD2(java.io.InputStream stream,
float newScale)
Loads an object out of a file in MD2-format (Quake2 model format).
|
static Object3D[] |
loadOBJ(java.io.InputStream objStream,
java.io.InputStream mtlStream,
float scale)
Loads a file in OBJ-format into an array of objects.
|
static Object3D |
loadSerializedObject(java.io.InputStream is)
Loads an object in serialized format.
|
static Object3D[] |
loadSerializedObjectArray(java.io.InputStream is)
Loads an object-array in serialized format.
|
static java.lang.String |
loadTextFile(java.io.InputStream stream)
Loads a text-file into a String.
|
static java.lang.String[] |
readTextureNames3DS(java.io.InputStream stream)
Reads the texture names from a 3DS-file.
|
static void |
setVertexOptimization(boolean enabled)
Enables(default)/Disables vertex optimizations for the Loader.
|
public static void setVertexOptimization(boolean enabled)
enabled
- optimize vertex usagepublic static java.lang.String loadTextFile(java.io.InputStream stream)
stream
- the InputStreampublic static Object3D loadSerializedObject(java.io.InputStream is)
is
- the inputstreampublic static Object3D[] loadSerializedObjectArray(java.io.InputStream is)
is
- the inputstreampublic static Object3D loadMD2(java.io.InputStream stream, float newScale)
stream
- the InputStreamnewScale
- a scaling parameter, 1 means no changes to the meshMesh.compress()
public static Object3D[] load3DS(java.io.InputStream stream, float scale)
stream
- the InputStreamscale
- a scaling parameter to scale the object right after loading.
Should be set to 1 to avoid rescalingpublic static java.lang.String[] readTextureNames3DS(java.io.InputStream stream)
stream
- the input stream for the filepublic static Object3D loadASC(java.io.InputStream stream, float scale, boolean swap)
stream
- the InputStreamscale
- a scaling parameter to scale the object right after loading.
Should be set to 1 to avoid rescalingswap
- if set to true, y and z coordinates of the object will be
swaped. This could be helpful for correct backface culling on
some Object3Ds.public static Object3D[] loadOBJ(java.io.InputStream objStream, java.io.InputStream mtlStream, float scale)
objStream
- the InputStream of the actual OBJ-filemtlStream
- the InputStream of the material file. May be null.scale
- a scaling parameter to scale the object right after loading.
Should be set to 1 to avoid rescalingpublic static void clearCache()