|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--yaarq.sys.yrqRepository
This class serves as a repository for all ressources used during an engine session. It provides functionallity for loading and managing textures, images, sounds and geometry. For each of the object types that can be stored in the repository, various loading options allow to do adjust the objects to the needs of the 3D world to be build.
Applications should fill the repository during the engineLoadCallback callback function. All necessary internal objects have been allocated at that time, while no rendering is being done during this call. Typically, applications would start a thread displaying some kind of loader screen, then fill the repository by using the load calls, and terminate the loader screen afterwards, doing all this within the engineLoadCallback. Applications can store frames not immediately needed in the eninge within the repository. Only root frames can be attached and detached during runtime, so applications need to make sure that frames retrieved from the repository are only added to the engine, using the addFrame method, at runtime.
TODO: Provide more options for geometry, Implement support for visuals, complete documentation
| Field Summary | |
static int |
OPTION_GEOMETRY_DEFAULT
Mesh load option: Use default settings |
static int |
OPTION_IMAGE_DEFAULT
Image load option: Use default settings. |
static int |
OPTION_SOUND_BUFFER
Sound load option: Use buffer (looping) |
static int |
OPTION_SOUND_DEFAULT
Sound load option: Use default settings |
static int |
OPTION_TEXTURE_ALPHABLEND
Texture load option: Generate an alphachannel by averaging the rgb color values in the texture |
static int |
OPTION_TEXTURE_ALPHAMASK
Texture load option: Generate an alphachannel for masking if r, g and b <8 then alpha will be set to translucent else alpha will be fully opaque |
static int |
OPTION_TEXTURE_BUMPMAP
Texture load option: Process the texture into a dot3 bumpmap after loading This includes rescaling texture values and filtering the map by replacing each pixel value (x/y) with ((x+1)-(x))/((y+1)-(y) |
static int |
OPTION_TEXTURE_DEFAULT
Texture load option: Use default settings |
static int |
OPTION_TEXTURE_LIGHTMAP
Texture load option: Process the texture into a lightmap by averaging all rgb values in the image into a single alpha channel |
| Constructor Summary | |
yrqRepository(yrqEngine a_engine)
Constructs a new repository instance. |
|
| Method Summary | |
void |
addFrame(java.lang.String a_name,
yrqFrame a_frame)
This method adds a frame to the repository under a given name. |
void |
addGeometry(java.lang.String a_name,
java.lang.String a_file,
int a_options)
This method adds a geomtry to the repository under a given name, loading it from the given file and processing it according to the options provided. |
void |
addImage(java.lang.String a_name,
java.lang.String a_file,
int a_options)
This method adds an image to the repository under a given name, loading it from the given file and processing it according to the options provided. |
void |
addSound(java.lang.String a_name,
java.lang.String a_file,
int a_options)
This method adds a sound to the repository under a given name, loading it from the given file and processing it according to the options provided. |
void |
addTexture(java.lang.String a_name,
java.lang.String a_file,
int a_options)
This method adds a texture to the repository under a given name, loading it from the given file and processing it according to the options provided. |
yrqFrame |
getFrame(java.lang.String a_name)
This function retrieves a frame stored in the repository by name |
javax.media.j3d.Geometry |
getGeometry(java.lang.String a_name)
This function retrieves a geometry stored in the repository by name |
java.awt.image.BufferedImage |
getImage(java.lang.String a_name)
This function retrieves an image stored in the repository by name |
javax.media.j3d.MediaContainer |
getSound(java.lang.String a_name)
This function retrieves a sound stored in the repository by name |
javax.media.j3d.Texture2D |
getTexture(java.lang.String a_name)
This function retrieves a texture stored in the repository by name |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int OPTION_GEOMETRY_DEFAULT
public static final int OPTION_IMAGE_DEFAULT
public static final int OPTION_SOUND_BUFFER
public static final int OPTION_SOUND_DEFAULT
public static final int OPTION_TEXTURE_ALPHABLEND
public static final int OPTION_TEXTURE_ALPHAMASK
public static final int OPTION_TEXTURE_BUMPMAP
public static final int OPTION_TEXTURE_DEFAULT
public static final int OPTION_TEXTURE_LIGHTMAP
| Constructor Detail |
public yrqRepository(yrqEngine a_engine)
a_engine - The class instance owning this instance| Method Detail |
public void addFrame(java.lang.String a_name,
yrqFrame a_frame)
a_name - The name of the object within the repository, must be uniquea_frame - The frame to add
public void addGeometry(java.lang.String a_name,
java.lang.String a_file,
int a_options)
a_name - The name of the object within the repository, must be uniquea_file - The file, with path relative to application, from which to load the objecta_options - Options for loading this object, one of the OPTION_MESH_xxx constants
public void addImage(java.lang.String a_name,
java.lang.String a_file,
int a_options)
This method is currently not implemented
a_name - The name of the object within the repository, must be uniquea_file - The file, with path relative to application, from which to load the objecta_options - Options for loading this object, one of the OPTION_IMAGE_xxx constants
public void addSound(java.lang.String a_name,
java.lang.String a_file,
int a_options)
a_name - The name of the object within the repository, must be uniquea_file - The file, with path relative to application, from which to load the objecta_options - Options for loading this object, one of the OPTION_SOUND_xxx constants
public void addTexture(java.lang.String a_name,
java.lang.String a_file,
int a_options)
a_name - The name of the object within the repository, must be uniquea_file - The file, with path relative to application, from which to load the objecta_options - Options for loading this object, one of the OPTION_TEXTURE_xxx constantspublic yrqFrame getFrame(java.lang.String a_name)
a_name - The name of the object within the repository
public javax.media.j3d.Geometry getGeometry(java.lang.String a_name)
a_name - The name of the object within the repository
public java.awt.image.BufferedImage getImage(java.lang.String a_name)
a_name - The name of the object within the repository
public javax.media.j3d.MediaContainer getSound(java.lang.String a_name)
a_name - The name of the object within the repository
public javax.media.j3d.Texture2D getTexture(java.lang.String a_name)
a_name - The name of the object within the repository
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||