Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

idCameraFOV Class Reference

#include <splines.h>


Public Member Functions

float getFOV (long t)
float getFOV (long t)
 idCameraFOV (int s, int e, long t)
 idCameraFOV (int v)
 idCameraFOV ()
 idCameraFOV (int s, int e, long t)
 idCameraFOV (int v)
 idCameraFOV ()
void parse (const char *(*text))
void parse (const char *(*text))
void setFOV (float f)
void setFOV (float f)
int start (long t)
void start (long t)
void write (fileHandle_t file, const char *name)
void write (fileHandle_t file, const char *name)
 ~idCameraFOV ()
 ~idCameraFOV ()

Protected Attributes

float endFOV
float fov
float startFOV
int startTime
int time


Constructor & Destructor Documentation

idCameraFOV  )  [inline]
 

Definition at line 683 of file splines.h.

References time().

00683                   {
00684         time = 0;
00685         fov = 90;
00686     }

Here is the call graph for this function:

idCameraFOV int  v  )  [inline]
 

Definition at line 688 of file splines.h.

References time().

00688                        {
00689         time = 0;
00690         fov = v;
00691     }

Here is the call graph for this function:

idCameraFOV int  s,
int  e,
long  t
[inline]
 

Definition at line 693 of file splines.h.

References time().

00693                                       {
00694         startFOV = s;
00695         endFOV = e;
00696         time = t;
00697     }

Here is the call graph for this function:

~idCameraFOV  )  [inline]
 

Definition at line 700 of file splines.h.

00700 {}

idCameraFOV  )  [inline]
 

Definition at line 690 of file splines.h.

References time().

00690                   {
00691         time = 0;
00692         fov = 90;
00693     }

Here is the call graph for this function:

idCameraFOV int  v  )  [inline]
 

Definition at line 695 of file splines.h.

References time().

00695                        {
00696         time = 0;
00697         fov = v;
00698     }

Here is the call graph for this function:

idCameraFOV int  s,
int  e,
long  t
[inline]
 

Definition at line 700 of file splines.h.

References time().

00700                                       {
00701         startFOV = s;
00702         endFOV = e;
00703         time = t;
00704     }

Here is the call graph for this function:

~idCameraFOV  )  [inline]
 

Definition at line 707 of file splines.h.

00707 {}


Member Function Documentation

float getFOV long  t  )  [inline]
 

Definition at line 713 of file splines.h.

References assert, startTime, and t.

00713                          {
00714         if (time) {
00715             assert(startTime);
00716             float percent = t / startTime;
00717             float temp = startFOV - endFOV;
00718             temp *= percent;
00719             fov = startFOV + temp;
00720         }
00721         return fov;
00722     }

float getFOV long  t  )  [inline]
 

Definition at line 706 of file splines.h.

References assert, startTime, and t.

Referenced by idCameraDef::getCameraInfo().

00706                          {
00707         if (time) {
00708             assert(startTime);
00709             float percent = t / startTime;
00710             float temp = startFOV - endFOV;
00711             temp *= percent;
00712             fov = startFOV + temp;
00713         }
00714         return fov;
00715     }

void parse const char **  text  ) 
 

void parse const char **  text  ) 
 

Definition at line 912 of file splines.cpp.

References atof(), atoi, idStr::c_str(), Com_MatchToken(), Com_Parse(), Com_ParseOnLine(), Com_UngetToken(), endFOV, fov, Q_stricmp(), startFOV, strcmp(), time, and token.

Referenced by idCameraDef::parse().

00912                                              {
00913     const char *token;
00914     Com_MatchToken( text, "{" );
00915     do {
00916         token = Com_Parse( text );
00917     
00918         if ( !token[0] ) {
00919             break;
00920         }
00921         if ( !strcmp (token, "}") ) {
00922             break;
00923         }
00924 
00925         // here we may have to jump over brush epairs ( only used in editor )
00926         do {
00927             // if token is not a brace, it is a key for a key/value pair
00928             if ( !token[0] || !strcmp (token, "(") || !strcmp(token, "}")) {
00929                 break;
00930             }
00931 
00932             Com_UngetToken();
00933             idStr key = Com_ParseOnLine(text);
00934             const char *token = Com_Parse(text);
00935             if (Q_stricmp(key.c_str(), "fov") == 0) {
00936                 fov = atof(token);
00937             } else if (Q_stricmp(key.c_str(), "startFOV") == 0) {
00938                 startFOV = atof(token);
00939             } else if (Q_stricmp(key.c_str(), "endFOV") == 0) {
00940                 endFOV = atof(token);
00941             } else if (Q_stricmp(key.c_str(), "time") == 0) {
00942                 time = atoi(token);
00943             }
00944             token = Com_Parse(text);
00945 
00946         } while (1);
00947 
00948         if ( !strcmp (token, "}") ) {
00949             break;
00950         }
00951 
00952     } while (1);
00953  
00954     Com_UngetToken();
00955     Com_MatchToken( text, "}" );
00956 }

Here is the call graph for this function:

void setFOV float  f  )  [inline]
 

Definition at line 709 of file splines.h.

00709                          {
00710         fov = f;
00711     }

void setFOV float  f  )  [inline]
 

Definition at line 702 of file splines.h.

00702                          {
00703         fov = f;
00704     }

int start long  t  )  [inline]
 

Definition at line 724 of file splines.h.

References startTime.

00724                       {
00725         startTime = t;
00726     }

void start long  t  )  [inline]
 

Definition at line 717 of file splines.h.

References startTime.

00717                        {
00718         startTime = t;
00719     }

void write fileHandle_t  file,
const char *  name
 

void write fileHandle_t  file,
const char *  name
 

Definition at line 1130 of file splines.cpp.

References idStr::c_str(), endFOV, fov, FS_Write(), idStr::length(), p, s, startFOV, time, and va().

Referenced by idCameraDef::save().

01130                                                         {
01131     idStr s = va("\t%s {\n", p);
01132     FS_Write(s.c_str(), s.length(), file);
01133     
01134     s = va("\t\tfov %f\n", fov);
01135     FS_Write(s.c_str(), s.length(), file);
01136 
01137     s = va("\t\tstartFOV %f\n", startFOV);
01138     FS_Write(s.c_str(), s.length(), file);
01139 
01140     s = va("\t\tendFOV %f\n", endFOV);
01141     FS_Write(s.c_str(), s.length(), file);
01142 
01143     s = va("\t\ttime %i\n", time);
01144     FS_Write(s.c_str(), s.length(), file);
01145 
01146     s = "\t}\n";
01147     FS_Write(s.c_str(), s.length(), file);
01148 }

Here is the call graph for this function:


Field Documentation

float endFOV [protected]
 

Definition at line 734 of file splines.h.

Referenced by parse(), and write().

float fov [protected]
 

Definition at line 732 of file splines.h.

Referenced by parse(), and write().

float startFOV [protected]
 

Definition at line 733 of file splines.h.

Referenced by parse(), and write().

int startTime [protected]
 

Definition at line 735 of file splines.h.

int time [protected]
 

Definition at line 736 of file splines.h.

Referenced by parse(), and write().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 19:53:21 2005 for Quake III Arena by  doxygen 1.3.9.1