OOF documentation where?
Posted: Sun Mar 19, 2006 3:31 pm
The one on descent-network.com might be outdated. I need a current version.
Code: Select all
***** OOF File Format *****
The beginning of every OOF file has a File Header which contains
the file ID and version number of the OOF. After that is a series
if chunks that each begin with a Chunk Header describing the type
of chunk.
// General Data Types
struct vector {
float x;
float y;
float z;
}
struct RGB {
byte red;
byte green;
byte blue;
}
struct FACE_VERT {
int Index; // Index of face vert
float tu; // Texture U mapping coordinate
float tv; // Texture V mapping coordinate
}
struct FACE {
vector normal; // Faces normal
int numVerts; // Number of verts on face
int textured; // Is this face textured? 0-No,
// Anything else, yes
UNION {
int textureID; // Texture index(if textured<>0)
RGB color; // Color of face(if textured=0)
}
FACE_VERT faceVerts[numVerts]; // Face vert data
float x_diff; // Used for lightmaps I believe
float y_diff; // ditto
}
struct SPCL_PT {
int nameLen; // Length of SPCL point Name
char name[nameLen]; // SPCL point name
int propLen; // Length of SPCL point Property name
char prop[propLen]; // Property Name
vector pos; // SPCL point position
float radius; // Radius of SPCL point
}
struct OOF_PT {
int parent; // Parent of Point
vector pos; // Position of Point
vector dir; // Direction of Point
}
struct WBAT_DATA {
int numWBATGPNT; // Number of Gunpoints
int GPNTindex[numWBATGPNT]; // Gunpoint indexes
int numWBATTuuret; // Number of Turrets
int turretIndex[numWBATTurret]; // Sub-Object index
}
struct TXTRdata {
int nameLen; // Length of Texture Name
string name[nameLen]; // Texture name(Imagename)
}
struct PANI_FRAMES {
int startTime; // Start Time of frame
vector pos; // Position
}
struct RANI_FRAMES {
int startTime; // Start Time of frame
vector axis; // Axis of rotation
int angle; // Angle to rotate(0-65535=0-360 degrees)
}
struct RANI_ANIM {
int numKey; // Number of Key frames
int min; // Minimum Key Frame number
int max; // Maximum Key Frame number
RANI_FRAMES RANIFrames[numKey]; // RANI Frames data
}
struct PANI_ANIM {
int numKey; // Number of Key frames
int min; // Minimum Key Frame number
int max; // Maximum Key Frame number
PANI_FRAMES PANIFrames[numKey]; // PANI Frames data
}
// File Header
struct OOFHeader {
char fileID(4); // File ID
int version; // Version number
}
struct OOFChunk {
char chunkID(4); // Chunk ID
int chunkLength; // Length of Chunk
}
// OHDR = Object Data Chunk
struct ObjectData {
int numSOBJ; // Number of Sub-Objects in OOF
float maxRadius; // Max Radius of Model
vector minBounding; // Minimum bounding point for model
vector maxBounding; // Maximum bounding point for model
int numDetailLevels; // Number of detail levels in model
}
struct ObjectDetail {
int detailLevel; // Level of detail
float depth; // Depth in models
}
// SOBJ = Sub-Object Chunk
struct SOBJData {
int Index; // Sub-Objects index
int parent; // Sub-Objects parent index
vector norm; // norm for seperation plane(debugging)
float d; // norm d for seperation plane(debugging)
vector pnt; // pnt for seperation plane(debugging)
vector offset; // 3D offset from parent(pivot point)
float radius; // Radius of Sub-Object
int treeOffset; // Offset of tree data(not used)
int dataOffset; // Offset of the data(not used)
vector geo_center; // geometric center of this subobject.
// In the same Frame Of Reference as
// all other vertices in this submodel.
// (Relative to pivot point)
string Name; // Name of Sub-Object(null terminated)
string Property; // Property Name of Sub-Object
// (null terminated)
int move_type; // -1 if no movement, otherwise
// rotational or positional movement
// Not used
int move_axis; // Movement Axis(Axis to Rotate
// or move around). Not used
int numFSChunks; // Number of freespace chunks
int FSData[numFSChunks]; // Freespace data
int numVerts; // Number of vertices on Sub-Object
vector vertex[numVerts]; // Vertex positions
vector normal[numVerts]; // Vertex normals
float alpha[numVerts]; // Vertex Alpha value. Only present
// if version => 2300
int numFaces; // Number of faces on Sub-Object
FACE faceData[numFaces]; // Face information
}
// SPCL - Special Point Chunk
struct SPCLData {
int numSPCL; // Number of Special Points
SPCL_PT SPCLpoint[numSPCL]; // Special Point data
}
// ATCH - Attach Point Chunk
struct ATCHData {
int numATCH; // Number of Attach points
OOF_PT pntData[numATCH]; // Attach Point data
}
// NATH - Attach Normal Point Chunk
struct NATHData {
int numNATH; // Number of Attach Normals
OOF_PT pntData[numNATH]; // Attach Normal Point data
}
// GRND - Ground Point Chunk
struct GRNDData {
int numGRND; // Number of Ground points
OOF_PT pntData[numGRND]; // Ground Point data
}
// GPNT - Gunpoint Chunk
struct GPNTData {
int numGPNT; // Number of Gunpoints
OOF_PT pntData[numGPNT]; // Gunpoint data
}
// WBAT - Weapons Battery chunk
struct WBSData {
int numWBAT; // Number of Weapons Batteries
WBAT_DATA wbatData[numWBAT]; // Weapon Battery data
}
// TXTR - Texture Chunk
struct textureData {
int numTextures; // Number of textures
TXTRdata textureData[numTextures]; // Texture data
}
// RANI, ANIM - Rotational Animation Chunk
struct RANIData {
RANI_ANIM FrameData[numSOBJ]; // RANI Frames data
}
// PANI - Positional Animation Chunk
struct PANIData {
PANI_ANIM FrameData[numSOBJ]; // PANI Frames data
}
// PINF - Information chunk
struct PINFData {
char info[chunkLength]; // Information chunk data
}
// IDTA - Interpreter Data
??
// GRID - Grid Data
??
Of course we are! It will be the coolest thing since you started the project.Diedel wrote:(Geez, these guys are really pushing me into adding hires models ... )
Yay!! Take as much time as you need to get it right.Diedel wrote:I now have working code to read oof polymodel files.