Results 1 to 15 of 20

Thread: fcache specification

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #18
    NewTek Developer jameswillmott's Avatar
    Join Date
    Dec 2004
    Location
    Gold Coast
    Posts
    3,171
    Slightly amended format.

    PFX format:

    PFX is a binary format with the following structure.

    int32: 4 byte integer.
    float: 4 byte floating point value.



    struct PFX{

    int32 version;
    //Version number for the file format, if the version is >=5 , the PFX file has stored rotations.

    int32 number of particles;
    //number of total particles stored, regardless of when they are alive or dead.

    int32 number of frames;
    //This is the sum of the lifetime of each particle plus 1. For example, if you have ten particles from frame 0 to 120, the number of frames becomes 10 * ( ( 120-0 ) +1 ) or 1210.

    struct {
    int32 start_f;
    //The frame that this particle becomes alive.

    int32 end_f;
    //The frame that this particle dies.

    int32 life;
    //The lifetime of the particle in frames.

    float mass;
    //Mass of the particle

    float resistance;
    //Wind resistance of the particle

    float size;
    //Size of the particle.

    struct{
    float x , y , z;
    } positions [ end_f - start_f ];

    } particle_data [ number of particles ];

    //if the file version >= 4
    int32 number_of_recorded_collisions;
    if ( number_of_recorded_collisions ) >0
    struct {
    int32 particle_index;
    int32 frame_collision_occurs;
    int32 ID_of_collision_item;
    float x,y,z; //location of collision
    } collisions [ number_of_recorded_collisions ];
    //if the file version >= 5
    struct {
    float heading;
    float pitch;
    float bank;
    //The heading, pitch and bank angles ( that match LightWave's rotations )

    float scalex;
    float scaley;
    float scalez;

    float spinh;
    float spinp;
    float spinb;

    float dummy[3];
    //Unused data.
    } rotation_data [ number of particles ];
    };
    Last edited by jameswillmott; 07-09-2012 at 09:31 AM.
    LightWave3D training, assets, news and discussion at www.liberty3d.com
    My opinions are my own and do not represent the opinions of any other entity, Liberty3D is not officially endorsed by NewTek.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •