org.jagatoo.loaders.models.cal3d.core
Class CalLoader

java.lang.Object
  extended by org.jagatoo.loaders.models.cal3d.core.CalLoader

public class CalLoader
extends java.lang.Object

Provides static methods for loading Cal3d elements from backing store.


Field Summary
static byte[] ANIMATION_FILE_MAGIC
           
static int CURRENT_FILE_VERSION
          File version number
static int EARLIEST_COMPATIBLE_FILE_VERSION
           
static int LIBRARY_VERSION
          Library version number
static int LOADER_ROTATE_X_AXIS
          Flag for the loader to rotate X to Y axis.
protected static int loadingMode
          Flags used by the loader - note this is static so all loads must be consistent.
static byte[] MATERIAL_FILE_MAGIC
           
static byte[] MESH_FILE_MAGIC
           
static byte[] SKELETON_FILE_MAGIC
          File format magic headers
 
Constructor Summary
CalLoader()
           
 
Method Summary
static CalCoreAnimation loadCoreAnimation(java.io.InputStream in, java.lang.String name)
           
static CalCoreAnimation loadCoreAnimation(java.net.URL resource, java.lang.String name)
          Loads a core animation instance.
protected static CalCoreBone loadCoreBones(java.io.DataInput file)
          Loads a core bone instance.
protected static CalCoreKeyframe loadCoreKeyframe(java.io.DataInput file)
          Loads a core keyframe instance.
static CalCoreMaterial loadCoreMaterial(java.io.InputStream in)
           
static CalCoreMaterial loadCoreMaterial(java.net.URL resource)
          Loads a core material instance.
static CalCoreMesh loadCoreMesh(java.io.InputStream in)
           
static CalCoreMesh loadCoreMesh(java.net.URL resource)
          Loads a core mesh instance.
static CalCoreSkeleton loadCoreSkeleton(java.io.InputStream in)
           
static CalCoreSkeleton loadCoreSkeleton(java.net.URL resource)
          Loads a core skeleton instance.
protected static CalCoreSubmesh loadCoreSubmesh(java.io.DataInput file)
          Loads a core submesh instance.
protected static CalCoreTrack loadCoreTrack(java.io.DataInput file)
          Loads a core track instance.
static void setLoadingMode(int flags)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SKELETON_FILE_MAGIC

public static final byte[] SKELETON_FILE_MAGIC
File format magic headers


ANIMATION_FILE_MAGIC

public static final byte[] ANIMATION_FILE_MAGIC

MESH_FILE_MAGIC

public static final byte[] MESH_FILE_MAGIC

MATERIAL_FILE_MAGIC

public static final byte[] MATERIAL_FILE_MAGIC

LIBRARY_VERSION

public static final int LIBRARY_VERSION
Library version number

See Also:
Constant Field Values

CURRENT_FILE_VERSION

public static final int CURRENT_FILE_VERSION
File version number

See Also:
Constant Field Values

EARLIEST_COMPATIBLE_FILE_VERSION

public static final int EARLIEST_COMPATIBLE_FILE_VERSION
See Also:
Constant Field Values

LOADER_ROTATE_X_AXIS

public static final int LOADER_ROTATE_X_AXIS
Flag for the loader to rotate X to Y axis.

See Also:
Constant Field Values

loadingMode

protected static int loadingMode
Flags used by the loader - note this is static so all loads must be consistent.

Constructor Detail

CalLoader

public CalLoader()
Method Detail

setLoadingMode

public static void setLoadingMode(int flags)

loadCoreAnimation

public static CalCoreAnimation loadCoreAnimation(java.net.URL resource,
                                                 java.lang.String name)
                                          throws java.io.IOException
Loads a core animation instance. This function loads a core animation instance from a file.

Parameters:
resource - The name of the file to load the core animation instance from.
name -
Returns:
One of the following values: \li a pointer to the core animation \li \b 0 if an error happend
Throws:
java.io.IOException

loadCoreAnimation

public static CalCoreAnimation loadCoreAnimation(java.io.InputStream in,
                                                 java.lang.String name)
                                          throws java.io.IOException
Throws:
java.io.IOException

loadCoreBones

protected static CalCoreBone loadCoreBones(java.io.DataInput file)
                                    throws java.io.IOException
Loads a core bone instance. This function loads a core bone instance from a file stream.

Parameters:
file - The file stream to load the core bone instance from.
Returns:
One of the following values: \li a pointer to the core bone \li \b 0 if an error happend
Throws:
java.io.IOException

loadCoreKeyframe

protected static CalCoreKeyframe loadCoreKeyframe(java.io.DataInput file)
                                           throws java.io.IOException
Loads a core keyframe instance. This function loads a core keyframe instance from a file stream.

Parameters:
file - The file stream to load the core keyframe instance from.
Returns:
One of the following values: \li a pointer to the core keyframe \li \b 0 if an error happend
Throws:
java.io.IOException

loadCoreMaterial

public static CalCoreMaterial loadCoreMaterial(java.net.URL resource)
                                        throws java.io.IOException
Loads a core material instance. This function loads a core material instance from a file.

Parameters:
resource - The name of the file to load the core material instance from.
Returns:
One of the following values: \li a pointer to the core material \li \b 0 if an error happend
Throws:
java.io.IOException

loadCoreMaterial

public static CalCoreMaterial loadCoreMaterial(java.io.InputStream in)
                                        throws java.io.IOException
Throws:
java.io.IOException

loadCoreMesh

public static CalCoreMesh loadCoreMesh(java.net.URL resource)
                                throws java.io.IOException
Loads a core mesh instance. This function loads a core mesh instance from a file.

Parameters:
resource - The name of the file to load the core mesh instance from.
Returns:
One of the following values: \li a pointer to the core mesh \li \b 0 if an error happend
Throws:
java.io.IOException

loadCoreMesh

public static CalCoreMesh loadCoreMesh(java.io.InputStream in)
                                throws java.io.IOException
Throws:
java.io.IOException

loadCoreSkeleton

public static CalCoreSkeleton loadCoreSkeleton(java.net.URL resource)
                                        throws java.io.IOException
Loads a core skeleton instance. This function loads a core skeleton instance from a file.

Parameters:
resource - The name of the file to load the core skeleton instance from.
Returns:
One of the following values: \li a pointer to the core skeleton \li \b 0 if an error happend
Throws:
java.io.IOException

loadCoreSkeleton

public static CalCoreSkeleton loadCoreSkeleton(java.io.InputStream in)
                                        throws java.io.IOException
Throws:
java.io.IOException

loadCoreSubmesh

protected static CalCoreSubmesh loadCoreSubmesh(java.io.DataInput file)
                                         throws java.io.IOException
Loads a core submesh instance. This function loads a core submesh instance from a file stream.

Parameters:
file - The file stream to load the core submesh instance from.
Returns:
One of the following values: \li a pointer to the core submesh \li \b 0 if an error happend
Throws:
java.io.IOException

loadCoreTrack

protected static CalCoreTrack loadCoreTrack(java.io.DataInput file)
                                     throws java.io.IOException
Loads a core track instance. This function loads a core track instance from a file stream.

Parameters:
file - The file stream to load the core track instance from.
Returns:
One of the following values: \li a pointer to the core track \li \b 0 if an error happend
Throws:
java.io.IOException