geVKFrame

Description: interpolation for keyframes that contain a vector

Source file: …\genesis3d\OpenSource\Source\Actor\vkframe.h

Contents:

Functions: LinearCreate, HermiteCreate, Insert, Query, Modify, LinearInterpolation, HermiteInterpolation, HermiteRecompute, LinearRead, HermiteRead, WriteToFile, CreateFromFile, WriteToBinaryFile, CreateFromBinaryFile

Types: geVKFrame_InterpolationType

Overview: view

Changes for Genesis3D v1.6: None

Overview:

 This module handles interpolation for keyframes that contain a vector (a geVec3d). This is intended to support Path.c

 geTKArray supplies general support for a time-keyed array, and this supplements that support to include the two specific time-keyed arrays:

     An array of geVec3d interpolated linearly

     An array of geVec3d interpolated with hermite blending

 These are phycially separated and have different base structures because:

     linear blending requires less data.

     future blending might require more data.

 The two types of lists are created with different creation calls, interpolated with different calls, but insertion and queries share a call.

 

 Hermite interpolation requires additional computation after changes are made to the keyframe list. Call geVKFrame_HermiteRecompute() to update the calculations.

 

Return to Contents

Types:

geVKFrame_InterpolationType

typedef enum {
   VKFRAME_LINEAR,
   VKFRAME_HERMITE,
   VKFRAME_HERMITE_ZERO_DERIV,
} geVKFrame_InterpolationType;

 

Return to Contents

Functions:

geTKArray* GENESISCC geVKFrame_LinearCreate(void);

  creates a frame list for linear interpolation

 

Return to Contents


geTKArray* GENESISCC geVKFrame_HermiteCreate(void);

  creates a frame list for hermite interpolation

  

Return to Contents


geBoolean GENESISCC geVKFrame_Insert(geTKArray** KeyList,  geTKArray_TimeType Time, const geVec3d* V,  int * Index);     

ARGUMENTS

     KeyList:    keyframe list to insert into

     Time:   time of new keyframe

     V:     vector at new keyframe

     Index:      index of new key

PURPOSE:  inserts a new keyframe with the given time and vector into the list.

 

Return to Contents


void GENESISCC geVKFrame_Query(const geTKArray* KeyList,  int Index, geTKArray_TimeType* Time,  geVec3d* V);      

ARGUMENTS

     KeyList:   keyframe list

     Index:      index of frame to return

     Time: time of the frame is returned

     V:       vector from the frame is returned

PURPOSE:  returns the vector and the time at keyframe[index]

 

Return to Contents


void GENESISCC geVKFrame_Modify(geTKArray* KeyList, int Index, const geVec3d* V);

ARGUMENTS:

     KeyList:    keyframe list

     Index:      index of frame to change

     V:     vector for the key

PURPOSE:  changes the vector at keyframe[index]

 

Return to Contents


void GENESISCC geVKFrame_LinearInterpolation(const void * KF1, const void * KF2, geFloat T, void * Result);   

ARGUMENTS:

     KF1: pointer to first keyframe

     KF2: pointer to second keyframe

     T:    0 <= T <= 1 blending parameter

     Result:    put the result in here (geVec3d)

PURPOSE: Interpolates to get a vector between the two vectors at the two keyframes where T==0 returns the vector for KF1 and T==1 returns the vector for KF2 . Interpolates linearly

 

Return to Contents


void GENESISCC geVKFrame_HermiteInterpolation(const void * KF1, const void * KF2,  geFloat T,  void * Result);   

ARGUMENTS:

     KF1: pointer to first keyframe

     KF2: pointer to second keyframe

     T:    0 <= T <= 1 blending parameter

     Result:    put the result in here (geVec3d)

PURPOSE: Interpolates to get a vector between the two vectors at the two keyframes where T==0 returns the vector for KF1 and T==1 returns the vector for KF2. Interpolates using 'hermite' blending

  

Return to Contents


void GENESISCC geVKFrame_HermiteRecompute(int Looped,   geBoolean ZeroDerivative,  geTKArray* KeyList);  

ARGUMENTS:

     Looped:     if keylist has the first key connected to last key

     ZeroDerivative: if each key should have a zero derivatives (good for 2 point S curves)

     KeyList:  list of keys to recompute hermite values for

PURPOSE: rebuild precomputed data for keyframe list.

  

Return to Contents


geBoolean GENESISCC geVKFrame_LinearRead(geVFile* pFile, void * geVKFrame);

 

Return to Contents


geBoolean GENESISCC geVKFrame_HermiteRead(geVFile* pFile, void * geVKFrame);

 

Return to Contents


geBoolean GENESISCC geVKFrame_WriteToFile(geVFile* pFile, void * geVKFrame, geVKFrame_InterpolationType InterpolationType, int Looping);

Note: #ifdef _BCB, geTKArray* replaces the void * for VKFrame type

 

Return to Contents


geTKArray* GENESISCC geVKFrame_CreateFromFile(geVFile* pFile, geVKFrame_InterpolationType* InterpolationType, int * Looping);

Note: #ifdef _BCB, int * replaces geVKFrame_InterpolationType* for InterpolationType

 

Return to Contents


geBoolean GENESISCC geVKFrame_WriteToBinaryFile(geVFile* pFile, void * geVKFrame, geVKFrame_InterpolationType InterpolationType, int Looping);

Note: #ifdef _BCB, TKArray* replaces void * for geVKFrame

 

Return to Contents


geTKArray* GENESISCC geVKFrame_CreateFromBinaryFile(geVFile* pFile, geVKFrame_InterpolationType* InterpolationType, int * Looping);

Note: #ifdef _BCB, int * replaces geVKFrame_InterpolationType* for InterpolationType

 
Return to Contents