Changes between Initial Version and Version 1 of PSA_File_Format


Ignore:
Timestamp:
Feb 23, 2008, 4:18:58 AM (16 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PSA_File_Format

    v1 v1  
     1PSA files store a skeletal animation, which consists of bone states at a number of keyframes (see [wiki:PMD_File_Format PMD File Format]). Animations can only be applied to models with the same number of bones in the same order (no bone names are used, only indices). Although PSA contains a name field and a frame length field, these are no longer used in the game since animation variants and total animation lengths (so the same animation can be reused with different lengths) are given in the actor XML files.
     2
     3All types are stored in little-endian format. Text is always ASCII. The following is the version 1 PSA format:
     4
     5{{{
     6 PSA {
     7    char magic[4];  // == "PSSA"
     8    u32 version;  // == 1
     9    u32 data_size;  // == filesize-12
     10 
     11    u32 nameLength;
     12    char name[nameLength];  // no longer used in the game
     13 
     14    float frameLength;  // no longer used in the game, not valid for most of the animations
     15 
     16    u32 numBones;
     17    u32 numFrames;
     18 
     19    BoneState boneStates[numBones * numFrames];
     20 
     21    // the state of bone b at frame f is stored in boneStates[f * numBones + b]
     22 }
     23 
     24 BoneState {
     25    Vector3D translation;
     26    Quaternion rotation;
     27 
     28    // the bone's final transform matrix is translation * rotation, as in PMD
     29 }
     30 
     31 Vector3D {
     32    float x, y, z;
     33 }
     34 
     35 Quaternion {
     36    float x, y, z, w;
     37 }
     38}}}