Object and Model File Guide

I. Model File Format
II. Creating New PrimitiveObjects
III. Creating New ComplexObjects


I. Model File Format

Base Model Directory
        - ".co" directory contains all ComplexObject files
        - SubModels each have their own file
        - Can have subdirectories within the directory with sub-SubModels

The model files (*.mdl) have the following format:
        Model Name
        modelTransX modelTransY modelTransZ
        modelRotateX modelRotateY modelRotateZ
        modelScaleX modelScaleY modelScaleZ
        Object...
        Object...
        ...

        The translation, rotation, and scaling values are all floats.
        The rotation values are between 0.0 and ~6.28 (2*pi).
        Default values for translation and rotation are 0.0, and 1.0 for scaling.

The properties of each individual object as stored in the model files are very similar,
as seen in this example:
        ObjectType: PrimitiveCube
        brick.bmp brick.bmp brick.bmp brick.bmp brick.bmp brick.bmp 
        Arena Base
        1
        0.6 0.0 0.0 1.0
        0.0 0.0 0.0
        0.0 0.0 0.0
        875.0 875.0 200.0
        EndObject

        ComplexObjects are stored the same way with one difference: they don't have the texture line.
        The single number "1" on its own line represents priority; this can be left alone, as long as
        an integer is included there, and won't do much since priority wasn't fully implemented. After
        that, we have the color of the object (R G B A), translation, rotation, and scaling.


II. Creating New PrimitiveObjects

Note: Creating new PrimitiveObjects requires programming and editing several Java classes. This can be
a tricky process for someone who hasn't used OpenGL or Java, so we recommend it only to those people who
have experience or are prepared to spend some time figuring it out.

To create a new PrimitiveObject, you'll need to make slight adjustments to the ObjectType.java Java class,
as well as creating a new Java class for this new PrimitiveObject.

Creating a new PrimitiveObject class:
        It's probably best to start off by copying the class of the PrimitiveObject most similar to
        your new object. You'll then want to modify the drawToList(...) method and, if changing the
        data stored about your object (such as how many vertices it has) you'll need to modify the
        declarations for those.

Changes that need to be made to ObjectType.java:
        1. Add your object type to the enumeration at the very top of the class.
        2. Add a new case for your object type in the getStringOf(...) method
        3. Add a new case for your object type in the getObjectOf(...) method
        
        All of the above changes that you need to make to ObjectType.java are documented in the class.


III. Creating New ComplexObjects

Creating new ComplexObjects is much easier than creating new PrimitiveObjects because it can be done almost
entirely within the Editor.

        1. Open the Editor and create a new model.
                If you already have a model that you use for creating ComplexObjects,
                you can load that model instead of creating a new one.
        2. Create a submodel within the model and call it the name of your ComplexObject.
        3. Create objects within your submodel such that your submodel represents the
                desired ComplexObject.
        4. Save the model.
        5. Open up the directory in a file browser where your ComplexObject model is stored.
        6. Copy the desired ComplexObject model file into the ".co" subdirectory of the model
                in which you want to use it.
        7. Open up the ComplexObject model file in a text editor and add a line as follows:
        
        Evergreen
   -->  0
        0.0 0.0 0.0
        0.0 0.0 0.0
        1.0 1.0 1.0
        ObjectType: PrimitiveCylinder
        ...
        
        If you want your ComplexObject to retain the colors you set for its objects,
        set this number to 0, as it is in the example. Otherwise, if you want it to
        inherit color for all objects within it as if it were a normal object (but
        without texture capability) then set this number to 1.
        
Great, your ComplexObject should be ready to use! Now if you ever need to use this ComplexObject in
another model file, you can just copy this file over to the ".co" subdirectory of that model. Remember,
if you want to edit the ComplexObject in the future, you will need to remove that extra line before 
opening it with the Editor.