doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Camera.cpp
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #include "../idlib/precompiled.h"
30 #pragma hdrstop
31 
32 #include "Game_local.h"
33 
34 /*
35 ===============================================================================
36 
37  idCamera
38 
39  Base class for cameras
40 
41 ===============================================================================
42 */
43 
46 
47 /*
48 =====================
49 idCamera::Spawn
50 =====================
51 */
52 void idCamera::Spawn( void ) {
53 }
54 
55 /*
56 =====================
57 idCamera::GetRenderView
58 =====================
59 */
62  GetViewParms( rv );
63  return rv;
64 }
65 
66 /***********************************************************************
67 
68  idCameraView
69 
70 ***********************************************************************/
71 const idEventDef EV_Camera_SetAttachments( "<getattachments>", NULL );
72 
74  EVENT( EV_Activate, idCameraView::Event_Activate )
75  EVENT( EV_Camera_SetAttachments, idCameraView::Event_SetAttachments )
77 
78 
79 /*
80 ===============
81 idCameraView::idCameraView
82 ================
83 */
85  fov = 90.0f;
86  attachedTo = NULL;
87  attachedView = NULL;
88 }
89 
90 /*
91 ===============
92 idCameraView::Save
93 ================
94 */
95 void idCameraView::Save( idSaveGame *savefile ) const {
96  savefile->WriteFloat( fov );
97  savefile->WriteObject( attachedTo );
98  savefile->WriteObject( attachedView );
99 }
100 
101 /*
102 ===============
103 idCameraView::Restore
104 ================
105 */
107  savefile->ReadFloat( fov );
108  savefile->ReadObject( reinterpret_cast<idClass *&>( attachedTo ) );
109  savefile->ReadObject( reinterpret_cast<idClass *&>( attachedView ) );
110 }
111 
112 /*
113 ===============
114 idCameraView::Event_SetAttachments
115 ================
116 */
118  SetAttachment( &attachedTo, "attachedTo" );
119  SetAttachment( &attachedView, "attachedView" );
120 }
121 
122 /*
123 ===============
124 idCameraView::Event_Activate
125 ================
126 */
128  if (spawnArgs.GetBool("trigger")) {
129  if (gameLocal.GetCamera() != this) {
130  if ( g_debugCinematic.GetBool() ) {
131  gameLocal.Printf( "%d: '%s' start\n", gameLocal.framenum, GetName() );
132  }
133 
134  gameLocal.SetCamera(this);
135  } else {
136  if ( g_debugCinematic.GetBool() ) {
137  gameLocal.Printf( "%d: '%s' stop\n", gameLocal.framenum, GetName() );
138  }
140  }
141  }
142 }
143 
144 /*
145 =====================
146 idCameraView::Stop
147 =====================
148 */
149 void idCameraView::Stop( void ) {
150  if ( g_debugCinematic.GetBool() ) {
151  gameLocal.Printf( "%d: '%s' stop\n", gameLocal.framenum, GetName() );
152  }
155 }
156 
157 
158 /*
159 =====================
160 idCameraView::Spawn
161 =====================
162 */
163 void idCameraView::SetAttachment( idEntity **e, const char *p ) {
164  const char *cam = spawnArgs.GetString( p );
165  if ( strlen ( cam ) ) {
166  *e = gameLocal.FindEntity( cam );
167  }
168 }
169 
170 
171 /*
172 =====================
173 idCameraView::Spawn
174 =====================
175 */
176 void idCameraView::Spawn( void ) {
177  // if no target specified use ourself
178  const char *cam = spawnArgs.GetString("cameraTarget");
179  if ( strlen ( cam ) == 0) {
180  spawnArgs.Set("cameraTarget", spawnArgs.GetString("name"));
181  }
182  fov = spawnArgs.GetFloat("fov", "90");
183 
185 
187 }
188 
189 /*
190 =====================
191 idCameraView::GetViewParms
192 =====================
193 */
195  assert( view );
196 
197  if (view == NULL) {
198  return;
199  }
200 
201  idVec3 dir;
202  idEntity *ent;
203 
204  if ( attachedTo ) {
205  ent = attachedTo;
206  } else {
207  ent = this;
208  }
209 
210  view->vieworg = ent->GetPhysics()->GetOrigin();
211  if ( attachedView ) {
212  dir = attachedView->GetPhysics()->GetOrigin() - view->vieworg;
213  dir.Normalize();
214  view->viewaxis = dir.ToMat3();
215  } else {
216  view->viewaxis = ent->GetPhysics()->GetAxis();
217  }
218 
219  gameLocal.CalcFov( fov, view->fov_x, view->fov_y );
220 }
221 
222 /*
223 ===============================================================================
224 
225  idCameraAnim
226 
227 ===============================================================================
228 */
229 
230 const idEventDef EV_Camera_Start( "start", NULL );
231 const idEventDef EV_Camera_Stop( "stop", NULL );
232 
234  EVENT( EV_Thread_SetCallback, idCameraAnim::Event_SetCallback )
235  EVENT( EV_Camera_Stop, idCameraAnim::Event_Stop )
236  EVENT( EV_Camera_Start, idCameraAnim::Event_Start )
237  EVENT( EV_Activate, idCameraAnim::Event_Activate )
238 END_CLASS
239 
240 
241 /*
242 =====================
243 idCameraAnim::idCameraAnim
244 =====================
245 */
247  threadNum = 0;
248  offset.Zero();
249  frameRate = 0;
250  cycle = 1;
251  starttime = 0;
252  activator = NULL;
253 
254 }
255 
256 /*
257 =====================
258 idCameraAnim::~idCameraAnim
259 =====================
260 */
262  if ( gameLocal.GetCamera() == this ) {
264  }
265 }
266 
267 /*
268 ===============
269 idCameraAnim::Save
270 ================
271 */
272 void idCameraAnim::Save( idSaveGame *savefile ) const {
273  savefile->WriteInt( threadNum );
274  savefile->WriteVec3( offset );
275  savefile->WriteInt( frameRate );
276  savefile->WriteInt( starttime );
277  savefile->WriteInt( cycle );
278  activator.Save( savefile );
279 }
280 
281 /*
282 ===============
283 idCameraAnim::Restore
284 ================
285 */
287  savefile->ReadInt( threadNum );
288  savefile->ReadVec3( offset );
289  savefile->ReadInt( frameRate );
290  savefile->ReadInt( starttime );
291  savefile->ReadInt( cycle );
292  activator.Restore( savefile );
293 
294  LoadAnim();
295 }
296 
297 /*
298 =====================
299 idCameraAnim::Spawn
300 =====================
301 */
302 void idCameraAnim::Spawn( void ) {
303  if ( spawnArgs.GetVector( "old_origin", "0 0 0", offset ) ) {
305  } else {
306  offset.Zero();
307  }
308 
309  // always think during cinematics
310  cinematic = true;
311 
312  LoadAnim();
313 }
314 
315 /*
316 ================
317 idCameraAnim::Load
318 ================
319 */
321  int version;
323  idToken token;
324  int numFrames;
325  int numCuts;
326  int i;
327  idStr filename;
328  const char *key;
329 
330  key = spawnArgs.GetString( "anim" );
331  if ( !key ) {
332  gameLocal.Error( "Missing 'anim' key on '%s'", name.c_str() );
333  }
334 
335  filename = spawnArgs.GetString( va( "anim %s", key ) );
336  if ( !filename.Length() ) {
337  gameLocal.Error( "Missing 'anim %s' key on '%s'", key, name.c_str() );
338  }
339 
340  filename.SetFileExtension( MD5_CAMERA_EXT );
341  if ( !parser.LoadFile( filename ) ) {
342  gameLocal.Error( "Unable to load '%s' on '%s'", filename.c_str(), name.c_str() );
343  }
344 
345  cameraCuts.Clear();
347  camera.Clear();
348  camera.SetGranularity( 1 );
349 
351  version = parser.ParseInt();
352  if ( version != MD5_VERSION ) {
353  parser.Error( "Invalid version %d. Should be version %d\n", version, MD5_VERSION );
354  }
355 
356  // skip the commandline
357  parser.ExpectTokenString( "commandline" );
358  parser.ReadToken( &token );
359 
360  // parse num frames
361  parser.ExpectTokenString( "numFrames" );
362  numFrames = parser.ParseInt();
363  if ( numFrames <= 0 ) {
364  parser.Error( "Invalid number of frames: %d", numFrames );
365  }
366 
367  // parse framerate
368  parser.ExpectTokenString( "frameRate" );
369  frameRate = parser.ParseInt();
370  if ( frameRate <= 0 ) {
371  parser.Error( "Invalid framerate: %d", frameRate );
372  }
373 
374  // parse num cuts
375  parser.ExpectTokenString( "numCuts" );
376  numCuts = parser.ParseInt();
377  if ( ( numCuts < 0 ) || ( numCuts > numFrames ) ) {
378  parser.Error( "Invalid number of camera cuts: %d", numCuts );
379  }
380 
381  // parse the camera cuts
382  parser.ExpectTokenString( "cuts" );
383  parser.ExpectTokenString( "{" );
384  cameraCuts.SetNum( numCuts );
385  for( i = 0; i < numCuts; i++ ) {
386  cameraCuts[ i ] = parser.ParseInt();
387  if ( ( cameraCuts[ i ] < 1 ) || ( cameraCuts[ i ] >= numFrames ) ) {
388  parser.Error( "Invalid camera cut" );
389  }
390  }
391  parser.ExpectTokenString( "}" );
392 
393  // parse the camera frames
394  parser.ExpectTokenString( "camera" );
395  parser.ExpectTokenString( "{" );
396  camera.SetNum( numFrames );
397  for( i = 0; i < numFrames; i++ ) {
398  parser.Parse1DMatrix( 3, camera[ i ].t.ToFloatPtr() );
399  parser.Parse1DMatrix( 3, camera[ i ].q.ToFloatPtr() );
400  camera[ i ].fov = parser.ParseFloat();
401  }
402  parser.ExpectTokenString( "}" );
403 
404 #if 0
405  if ( !gameLocal.GetLocalPlayer() ) {
406  return;
407  }
408 
409  idDebugGraph gGraph;
410  idDebugGraph tGraph;
411  idDebugGraph qGraph;
412  idDebugGraph dtGraph;
413  idDebugGraph dqGraph;
414  gGraph.SetNumSamples( numFrames );
415  tGraph.SetNumSamples( numFrames );
416  qGraph.SetNumSamples( numFrames );
417  dtGraph.SetNumSamples( numFrames );
418  dqGraph.SetNumSamples( numFrames );
419 
420  gameLocal.Printf( "\n\ndelta vec:\n" );
421  float diff_t, last_t, t;
422  float diff_q, last_q, q;
423  diff_t = last_t = 0.0f;
424  diff_q = last_q = 0.0f;
425  for( i = 1; i < numFrames; i++ ) {
426  t = ( camera[ i ].t - camera[ i - 1 ].t ).Length();
427  q = ( camera[ i ].q.ToQuat() - camera[ i - 1 ].q.ToQuat() ).Length();
428  diff_t = t - last_t;
429  diff_q = q - last_q;
430  gGraph.AddValue( ( i % 10 ) == 0 );
431  tGraph.AddValue( t );
432  qGraph.AddValue( q );
433  dtGraph.AddValue( diff_t );
434  dqGraph.AddValue( diff_q );
435 
436  gameLocal.Printf( "%d: %.8f : %.8f, %.8f : %.8f\n", i, t, diff_t, q, diff_q );
437  last_t = t;
438  last_q = q;
439  }
440 
441  gGraph.Draw( colorBlue, 300.0f );
442  tGraph.Draw( colorOrange, 60.0f );
443  dtGraph.Draw( colorYellow, 6000.0f );
444  qGraph.Draw( colorGreen, 60.0f );
445  dqGraph.Draw( colorCyan, 6000.0f );
446 #endif
447 }
448 
449 /*
450 ===============
451 idCameraAnim::Start
452 ================
453 */
454 void idCameraAnim::Start( void ) {
455  cycle = spawnArgs.GetInt( "cycle" );
456  if ( !cycle ) {
457  cycle = 1;
458  }
459 
460  if ( g_debugCinematic.GetBool() ) {
461  gameLocal.Printf( "%d: '%s' start\n", gameLocal.framenum, GetName() );
462  }
463 
465  gameLocal.SetCamera( this );
467 
468  // if the player has already created the renderview for this frame, have him update it again so that the camera starts this frame
471  }
472 }
473 
474 /*
475 =====================
476 idCameraAnim::Stop
477 =====================
478 */
479 void idCameraAnim::Stop( void ) {
480  if ( gameLocal.GetCamera() == this ) {
481  if ( g_debugCinematic.GetBool() ) {
482  gameLocal.Printf( "%d: '%s' stop\n", gameLocal.framenum, GetName() );
483  }
484 
487  if ( threadNum ) {
489  threadNum = 0;
490  }
492  }
493 }
494 
495 /*
496 =====================
497 idCameraAnim::Think
498 =====================
499 */
500 void idCameraAnim::Think( void ) {
501  int frame;
502  int frameTime;
503 
504  if ( thinkFlags & TH_THINK ) {
505  // check if we're done in the Think function when the cinematic is being skipped (idCameraAnim::GetViewParms isn't called when skipping cinematics).
506  if ( !gameLocal.skipCinematic ) {
507  return;
508  }
509 
510  if ( camera.Num() < 2 ) {
511  // 1 frame anims never end
512  return;
513  }
514 
515  if ( frameRate == USERCMD_HZ ) {
516  frameTime = gameLocal.time - starttime;
517  frame = frameTime / gameLocal.msec;
518  } else {
519  frameTime = ( gameLocal.time - starttime ) * frameRate;
520  frame = frameTime / 1000;
521  }
522 
523  if ( frame > camera.Num() + cameraCuts.Num() - 2 ) {
524  if ( cycle > 0 ) {
525  cycle--;
526  }
527 
528  if ( cycle != 0 ) {
529  // advance start time so that we loop
530  starttime += ( ( camera.Num() - cameraCuts.Num() ) * 1000 ) / frameRate;
531  } else {
532  Stop();
533  }
534  }
535  }
536 }
537 
538 /*
539 =====================
540 idCameraAnim::GetViewParms
541 =====================
542 */
544  int realFrame;
545  int frame;
546  int frameTime;
547  float lerp;
548  float invlerp;
549  cameraFrame_t *camFrame;
550  int i;
551  int cut;
552  idQuat q1, q2, q3;
553 
554  assert( view );
555  if ( !view ) {
556  return;
557  }
558 
559  if ( camera.Num() == 0 ) {
560  // we most likely are in the middle of a restore
561  // FIXME: it would be better to fix it so this doesn't get called during a restore
562  return;
563  }
564 
565 #ifdef _D3XP
566  SetTimeState ts( timeGroup );
567 #endif
568 
569  if ( frameRate == USERCMD_HZ ) {
570  frameTime = gameLocal.time - starttime;
571  frame = frameTime / gameLocal.msec;
572  lerp = 0.0f;
573  } else {
574  frameTime = ( gameLocal.time - starttime ) * frameRate;
575  frame = frameTime / 1000;
576  lerp = ( frameTime % 1000 ) * 0.001f;
577  }
578 
579  // skip any frames where camera cuts occur
580  realFrame = frame;
581  cut = 0;
582  for( i = 0; i < cameraCuts.Num(); i++ ) {
583  if ( frame < cameraCuts[ i ] ) {
584  break;
585  }
586  frame++;
587  cut++;
588  }
589 
590  if ( g_debugCinematic.GetBool() ) {
591  int prevFrameTime = ( gameLocal.time - starttime - gameLocal.msec ) * frameRate;
592  int prevFrame = prevFrameTime / 1000;
593  int prevCut;
594 
595  prevCut = 0;
596  for( i = 0; i < cameraCuts.Num(); i++ ) {
597  if ( prevFrame < cameraCuts[ i ] ) {
598  break;
599  }
600  prevFrame++;
601  prevCut++;
602  }
603 
604  if ( prevCut != cut ) {
605  gameLocal.Printf( "%d: '%s' cut %d\n", gameLocal.framenum, GetName(), cut );
606  }
607  }
608 
609  // clamp to the first frame. also check if this is a one frame anim. one frame anims would end immediately,
610  // but since they're mainly used for static cams anyway, just stay on it infinitely.
611  if ( ( frame < 0 ) || ( camera.Num() < 2 ) ) {
612  view->viewaxis = camera[ 0 ].q.ToQuat().ToMat3();
613  view->vieworg = camera[ 0 ].t + offset;
614  view->fov_x = camera[ 0 ].fov;
615  } else if ( frame > camera.Num() - 2 ) {
616  if ( cycle > 0 ) {
617  cycle--;
618  }
619 
620  if ( cycle != 0 ) {
621  // advance start time so that we loop
622  starttime += ( ( camera.Num() - cameraCuts.Num() ) * 1000 ) / frameRate;
623  GetViewParms( view );
624  return;
625  }
626 
627  Stop();
628  if ( gameLocal.GetCamera() != NULL ) {
629  // we activated another camera when we stopped, so get it's viewparms instead
630  gameLocal.GetCamera()->GetViewParms( view );
631  return;
632  } else {
633  // just use our last frame
634  camFrame = &camera[ camera.Num() - 1 ];
635  view->viewaxis = camFrame->q.ToQuat().ToMat3();
636  view->vieworg = camFrame->t + offset;
637  view->fov_x = camFrame->fov;
638  }
639  } else if ( lerp == 0.0f ) {
640  camFrame = &camera[ frame ];
641  view->viewaxis = camFrame[ 0 ].q.ToMat3();
642  view->vieworg = camFrame[ 0 ].t + offset;
643  view->fov_x = camFrame[ 0 ].fov;
644  } else {
645  camFrame = &camera[ frame ];
646  invlerp = 1.0f - lerp;
647  q1 = camFrame[ 0 ].q.ToQuat();
648  q2 = camFrame[ 1 ].q.ToQuat();
649  q3.Slerp( q1, q2, lerp );
650  view->viewaxis = q3.ToMat3();
651  view->vieworg = camFrame[ 0 ].t * invlerp + camFrame[ 1 ].t * lerp + offset;
652  view->fov_x = camFrame[ 0 ].fov * invlerp + camFrame[ 1 ].fov * lerp;
653  }
654 
655  gameLocal.CalcFov( view->fov_x, view->fov_x, view->fov_y );
656 
657  // setup the pvs for this frame
658  UpdatePVSAreas( view->vieworg );
659 
660 #if 0
661  static int lastFrame = 0;
662  static idVec3 lastFrameVec( 0.0f, 0.0f, 0.0f );
663  if ( gameLocal.time != lastFrame ) {
665  gameRenderWorld->DebugLine( colorRed, view->vieworg, view->vieworg + idVec3( 0.0f, 0.0f, 2.0f ), 10000, false );
666  gameRenderWorld->DebugLine( colorCyan, lastFrameVec, view->vieworg, 10000, false );
667  gameRenderWorld->DebugLine( colorYellow, view->vieworg + view->viewaxis[ 0 ] * 64.0f, view->vieworg + view->viewaxis[ 0 ] * 66.0f, 10000, false );
668  gameRenderWorld->DebugLine( colorOrange, view->vieworg + view->viewaxis[ 0 ] * 64.0f, view->vieworg + view->viewaxis[ 0 ] * 64.0f + idVec3( 0.0f, 0.0f, 2.0f ), 10000, false );
669  lastFrameVec = view->vieworg;
670  lastFrame = gameLocal.time;
671  }
672 #endif
673 
674  if ( g_showcamerainfo.GetBool() ) {
675  gameLocal.Printf( "^5Frame: ^7%d/%d\n\n\n", realFrame + 1, camera.Num() - cameraCuts.Num() );
676  }
677 }
678 
679 /*
680 ===============
681 idCameraAnim::Event_Activate
682 ================
683 */
685  activator = _activator;
686  if ( thinkFlags & TH_THINK ) {
687  Stop();
688  } else {
689  Start();
690  }
691 }
692 
693 /*
694 ===============
695 idCameraAnim::Event_Start
696 ================
697 */
699  Start();
700 }
701 
702 /*
703 ===============
704 idCameraAnim::Event_Stop
705 ================
706 */
708  Stop();
709 }
710 
711 /*
712 ================
713 idCameraAnim::Event_SetCallback
714 ================
715 */
717  if ( ( gameLocal.GetCamera() == this ) && !threadNum ) {
719  idThread::ReturnInt( true );
720  } else {
721  idThread::ReturnInt( false );
722  }
723 }
virtual const idVec3 & GetOrigin(int id=0) const =0
GLdouble GLdouble GLdouble GLdouble q
Definition: glext.h:2959
idPlayer * GetLocalPlayer() const
float GetFloat(const char *key, const char *defaultString="0") const
Definition: Dict.h:248
idMat3 ToMat3(void) const
Definition: Vector.cpp:195
int frameRate
Definition: Camera.h:114
void Start(void)
Definition: Camera.cpp:454
float Normalize(void)
Definition: Vector.h:646
idVec4 colorGreen
Definition: Lib.cpp:118
int GetInt(const char *key, const char *defaultString="0") const
Definition: Dict.h:252
const idEventDef EV_Camera_SetAttachments("<getattachments>", NULL)
idStr & SetFileExtension(const char *extension)
Definition: Str.cpp:743
assert(prefInfo.fullscreenBtn)
void Restore(idRestoreGame *savefile)
Definition: Game_local.h:661
void WriteObject(const idClass *obj)
Definition: SaveGame.cpp:329
void Save(idSaveGame *savefile) const
Definition: Camera.cpp:272
void Printf(const char *fmt,...) const id_attribute((format(printf
Definition: Game_local.cpp:699
type * GetEntity(void) const
Definition: Game_local.h:695
void SetNum(int newnum, bool resize=true)
Definition: List.h:289
idMat3 ToMat3(void) const
Definition: Quat.cpp:70
const idEventDef EV_Activate("activate","e")
void Spawn()
Definition: Camera.cpp:176
idList< cameraFrame_t > camera
Definition: Camera.h:118
int Length(void) const
Definition: Str.h:702
void void void void void Error(const char *fmt,...) const id_attribute((format(printf
Definition: Game_local.cpp:783
bool skipCinematic
Definition: Game_local.h:314
void Spawn(void)
Definition: Camera.cpp:302
static int CurrentThreadNum(void)
int Parse1DMatrix(int x, float *m)
Definition: Lexer.cpp:1300
idEntity * FindEntity(const char *name) const
void Event_SetAttachments()
Definition: Camera.cpp:117
void UpdatePVSAreas(void)
Definition: Entity.cpp:1320
void Think(void)
Definition: Camera.cpp:500
void SetGranularity(int newgranularity)
Definition: List.h:305
#define MD5_VERSION_STRING
Definition: Model.h:41
Definition: Vector.h:316
virtual void Stop(void)
Definition: Camera.cpp:149
void Draw(const idVec4 &color, float scale) const
Definition: DebugGraph.cpp:72
const idEventDef EV_Camera_Stop("stop", NULL)
Definition: Token.h:71
float ParseFloat(bool *errorFlag=NULL)
Definition: Lexer.cpp:1264
void Set(const char *key, const char *value)
Definition: Dict.cpp:275
#define MD5_CAMERA_EXT
Definition: Model.h:44
bool cinematic
Definition: Entity.h:127
idDict spawnArgs
Definition: Entity.h:122
idQuat & Slerp(const idQuat &from, const idQuat &to, float t)
Definition: Quat.cpp:160
int i
Definition: process.py:33
GLintptr offset
Definition: glext.h:3113
idList< int > cameraCuts
Definition: Camera.h:117
int ParseInt(void)
Definition: Lexer.cpp:1227
void Event_Activate(idEntity *activator)
Definition: Camera.cpp:684
void WriteVec3(const idVec3 &vec)
Definition: SaveGame.cpp:253
void SetNumSamples(int num)
Definition: DebugGraph.cpp:47
void Restore(idRestoreGame *savefile)
Definition: Camera.cpp:106
void Event_SetCallback(void)
Definition: Camera.cpp:716
#define EVENT(event, function)
Definition: Class.h:53
#define ABSTRACT_DECLARATION(nameofsuperclass, nameofclass)
Definition: Class.h:156
virtual void GetViewParms(renderView_t *view)
Definition: Camera.cpp:194
void LoadAnim(void)
Definition: Camera.cpp:320
idVec4 colorRed
Definition: Lib.cpp:117
virtual renderView_t * GetRenderView()
Definition: Entity.cpp:1577
idVec3 t
Definition: Camera.h:93
int starttime
Definition: Camera.h:115
void Event_Stop(void)
Definition: Camera.cpp:707
struct version_s version
idCVar g_showcamerainfo("g_showcamerainfo","0", CVAR_GAME|CVAR_ARCHIVE,"displays the current frame # for the camera when playing cinematics")
Definition: Lexer.h:137
void Error(const char *str,...) id_attribute((format(printf
Definition: Lexer.cpp:215
virtual void GetViewParms(renderView_t *view)
Definition: Camera.cpp:543
idEntityPtr< idEntity > activator
Definition: Camera.h:119
idVec4 colorYellow
Definition: Lib.cpp:120
idCVar g_debugCinematic("g_debugCinematic","0", CVAR_GAME|CVAR_BOOL,"")
idPhysics * GetPhysics(void) const
Definition: Entity.cpp:2607
virtual void DebugLine(const idVec4 &color, const idVec3 &start, const idVec3 &end, const int lifetime=0, const bool depthTest=false)=0
virtual renderView_t * GetRenderView()
Definition: Camera.cpp:60
const char * GetString(const char *key, const char *defaultString="") const
Definition: Dict.h:240
void ReadFloat(float &value)
Definition: SaveGame.cpp:967
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
void Stop(void)
Definition: Camera.cpp:479
void WriteFloat(const float value)
Definition: SaveGame.cpp:213
idCamera * GetCamera(void) const
bool GetBool(const char *key, const char *defaultString="0") const
Definition: Dict.h:256
virtual void UpdateChangeableSpawnArgs(const idDict *source)
Definition: Entity.cpp:377
int cycle
Definition: Camera.h:116
#define NULL
Definition: Lib.h:88
void CalculateRenderView(void)
renderView_t * GetRenderView(void)
idVec3 GetVector(const char *key, const char *defaultString=NULL) const
Definition: Dict.h:260
virtual const idMat3 & GetAxis(int id=0) const =0
static void ObjectMoveDone(int threadnum, idEntity *obj)
idCQuat q
Definition: Camera.h:92
idGameLocal gameLocal
Definition: Game_local.cpp:64
#define END_CLASS
Definition: Class.h:54
idBounds Expand(const float d) const
Definition: Bounds.h:317
void WriteInt(const int value)
Definition: SaveGame.cpp:168
float fov
Definition: Camera.h:76
Definition: Quat.h:48
int threadNum
Definition: Camera.h:112
void Event_Activate(idEntity *activator)
Definition: Camera.cpp:127
int ExpectTokenString(const char *string)
Definition: Lexer.cpp:919
void CalcFov(float base_fov, float &fov_x, float &fov_y) const
idVec3 vieworg
Definition: RenderWorld.h:215
idVec4 colorCyan
Definition: Lib.cpp:122
idVec4 colorOrange
Definition: Lib.cpp:123
void AddValue(float value)
Definition: DebugGraph.cpp:59
void SetCamera(idCamera *cam)
bool GetBool(void) const
Definition: CVarSystem.h:142
idVec3 offset
Definition: Camera.h:113
tuple f
Definition: idal.py:89
idMat3 ToMat3(void) const
Definition: Quat.cpp:232
int Num(void) const
Definition: List.h:265
const GLcharARB * name
Definition: glext.h:3629
idQuat ToQuat(void) const
Definition: Quat.h:391
#define CLASS_DECLARATION(nameofsuperclass, nameofclass)
Definition: Class.h:110
Definition: Str.h:116
const char * GetName(void) const
Definition: Entity.cpp:875
void Save(idSaveGame *savefile) const
Definition: Game_local.h:656
void ReadVec3(idVec3 &vec)
Definition: SaveGame.cpp:1011
void Restore(idRestoreGame *savefile)
Definition: Camera.cpp:286
const char * c_str(void) const
Definition: Str.h:487
void Event_Start(void)
Definition: Camera.cpp:698
void BecomeActive(int flags)
Definition: Entity.cpp:995
const int USERCMD_HZ
Definition: UsercmdGen.h:40
const idEventDef EV_Thread_SetCallback("<script_setcallback>", NULL)
idEntity * attachedTo
Definition: Camera.h:77
virtual void DebugBounds(const idVec4 &color, const idBounds &bounds, const idVec3 &org=vec3_origin, const int lifetime=0)=0
float fov
Definition: Camera.h:94
void SetAttachment(idEntity **e, const char *p)
Definition: Camera.cpp:163
idRenderWorld * gameRenderWorld
Definition: Game_local.cpp:55
char * va(const char *fmt,...)
Definition: Str.cpp:1568
void Save(idSaveGame *savefile) const
Definition: Camera.cpp:95
bool PostEventMS(const idEventDef *ev, int time)
Definition: Class.cpp:666
GLfloat GLfloat p
Definition: glext.h:4674
idMat3 viewaxis
Definition: RenderWorld.h:216
int thinkFlags
Definition: Entity.h:125
virtual void GetViewParms(renderView_t *view)=0
#define MD5_VERSION
Definition: Model.h:45
void Zero(void)
Definition: Vector.h:415
const idEventDef EV_Camera_Start("start", NULL)
void BecomeInactive(int flags)
Definition: Entity.cpp:1025
static void ReturnInt(int value)
int ReadToken(idToken *token)
Definition: Lexer.cpp:820
void ReadInt(int &value)
Definition: SaveGame.cpp:922
void ActivateTargets(idEntity *activator) const
Definition: Entity.cpp:3650
idVec4 colorBlue
Definition: Lib.cpp:119
void ReadObject(idClass *&obj)
Definition: SaveGame.cpp:1083
idEntity * attachedView
Definition: Camera.h:78
int LoadFile(const char *filename, bool OSPath=false)
Definition: Lexer.cpp:1591
GLdouble GLdouble t
Definition: glext.h:2943
void Clear(void)
Definition: List.h:184