Repository navigation
GEO
ProgSys edited this page May 10, 2020
·
51 revisions
The GEO file contains geometry and animations organized as a scene graph. Similar to a GLTF file format.
The file starts with a header:
struct geofileHeader
{
int unk1;
int number_of_nodes; // Total number of scene nodes
int unk3;
int number_of_transformations; // Total number of transformations
int number_of_keyframes; // Total number of keframes
int offset_to_first_model; // Offset to first model (geometry) data
int number_of_models; // Total number of models (geometry)
int unk6;
}The header is followed by a list of transformations (total number is in header):
struct geofileTransformation
{
glm::vec3 position; // (xyz-float) All values are multiplied by 10.
float unk7;
glm::vec3 rotation; // (xyz-float) Euler angles YXZ. All values are multiplied by 10.
float unk8;
glm::vec3 scale; // (xyz-float) All values are multiplied by 100.
float unk9;
float unk10, unk11, unk12, unk13;
}I use OpenGl so my axes are different, here are my conversion functions:
glm::vec3 fromDisaPosition(const glm::vec3& postion) { return glm::vec3(-postion.x, -postion.y, postion.z) / 10.0f; }
glm::quat fromDisaRotation(const glm::vec3& rotation){
const glm::vec3 eulerRotation = glm::radians(glm::vec3(
-rotation.z / 10.0f,
-rotation.y / 10.0f,
rotation.x / 10.0f
));
return glm::quat(glm::eulerAngleYXZ(
eulerRotation.y, eulerRotation.z, eulerRotation.x
));
}
glm::vec3 fromDisaScale(const glm::vec3& scale) { return scale / 100.0f; }
Next are the keyframes (total number is in header):
struct geofileKeyframe{
unsigned short value;
unsigned short time;
};
What exactly they do must be discovered.
Next are the nodes of the scene tree (total number is in header):
struct geofileTreeNode
{
short parent_index; // The index of the parent node. 0 is root so 1 is first entry
short transformation_index;
short number_of_transformations; // Must be at least 1.
short model_index; // If -1, then node is a pure transformation node.
short transformation_mode; // 2 or 3 is a Billboard, rest ist normal?
short keyframe_index; // Is 0, if node is not animated
short number_of_keyframes; // Is 0, if node is not animated
}Buffer (geometry and texure) data starts at the given offset inside the header.
Each Model consists out of a header, surface data, triangle data, uv data and textures.
struct geofileModelHeader
{
int number_of_triangles; // Each trianlge has 3 vertices
int unk9;
int number_of_surfaces;
int number_of_textures;
int start_offset_texture; // Offset starts from the model header location
int end_offset_model; // Offset starts from the model header location
int size_of_triangles;
int unk12;
}The model header is followed by a surface list (total number is in model header):
struct geofileModelHeader {
unsigned char unk1a, unk1b, unk1c, unk1d; //somekind of blend mode or alpha values?
unsigned short texture_index; // Can be 0, then this surface has no texture. (Default texture is Black?)
unsigned short lenght; // Number of vertices inside surface (start is the sum of previous lenghts)
int unk4, unk5; //somekind of texture effects?
}