Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20

Thread: fcache specification

  1. #16
    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 10: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.

  2. #17
    NewTek Developer jameswillmott's Avatar
    Join Date
    Dec 2004
    Location
    Gold Coast
    Posts
    3,171
    Quote Originally Posted by maxim capra View Post
    Hey James,

    thanks again for your help. I've got a few questions:

    4. i still don't get the rotation part in fcache. example: i bake one agent, flying and rotating around. if i zero out the orientation part (matrix), the movement of the agent stays exactly the same. it seems, the orientation part is not needed? can i use just the matrix for orientation of every agent and don't use the velocity? or is it best to use both?
    fcache stores a matrix per 'frame' ( it's not necessarily per frame but that's convenient for now ) so that the orientation of the agent can be independent of the velocity. For example, all the agent's could be made to target a scene item while they fly around.
    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.

  3. #18
    thanks for your help, james!

  4. #19
    Registered User TerryLewis's Avatar
    Join Date
    Nov 2018
    Location
    Corpus Christi
    Posts
    8
    Originally Posted by jameswillmott
    write my essay task
    fcache stores a matrix per 'frame' ( it's not necessarily per frame but that's convenient for now ) so that the orientation of the agent can be independent of the velocity. For example, all the agent's could be made to target a scene item while they fly around.

    Hello James,

    Any examples of the orientation independent of the velocity? I've been looking for the information and found this thread on the forums (in GI cache topics on Unity forums, I guess). Years ago I used to work with Vray.

    Sorry for bumping.
    Last edited by TerryLewis; 06-17-2019 at 11:47 PM. Reason: just a mistake

  5. #20
    NewTek Developer jameswillmott's Avatar
    Join Date
    Dec 2004
    Location
    Gold Coast
    Posts
    3,171
    Hi Terry, if I understand the question correctly, what I meant was simply the format can record an agent moving backwards, or strafing, for example, in both those cases the velocity doesn't align with the orientation.
    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.

Page 2 of 2 FirstFirst 12

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
  •