Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StarVlist Class Reference

#include <star.h>

Inheritance diagram for StarVlist:
PointStarVlist SpriteStarVlist

Public Member Functions

virtual void Draw (bool, int whichtex)
 
 StarVlist (float spread)
 
void UpdateGraphics ()
 
virtual ~StarVlist ()
 
virtual bool BeginDrawState (const QVector &center, const Vector &vel, const Vector &angular_vel, bool rotate, bool yawpitch, int whichTexture)
 
virtual void EndDrawState (bool, int whichtex)
 
virtual int NumTextures ()
 
void DrawAll (const QVector &center, const Vector &vel, const Vector &ang_vel, bool rot, bool yawpitch)
 

Protected Attributes

float spread
 
Vector newcamr
 
Vector newcamq
 
Vector camr
 
Vector camq
 
double lasttime
 

Detailed Description

Definition at line 9 of file star.h.

Constructor & Destructor Documentation

StarVlist::StarVlist ( float  spread)

Definition at line 131 of file star.cpp.

References _Universe, Universe::AccessCamera(), camq, camr, Camera::GetPQR(), lasttime, newcamq, newcamr, and spread.

132 {
133  lasttime = 0;
135  newcamr = camr;
136  newcamq = camq;
137  this->spread = spread;
138 }
virtual StarVlist::~StarVlist ( )
inlinevirtual

Definition at line 22 of file star.h.

22 {}

Member Function Documentation

virtual bool StarVlist::BeginDrawState ( const QVector center,
const Vector vel,
const Vector angular_vel,
bool  rotate,
bool  yawpitch,
int  whichTexture 
)
inlinevirtual

Reimplemented in SpriteStarVlist, and PointStarVlist.

Definition at line 23 of file star.h.

Referenced by Stars::Draw(), and DrawAll().

29  {
30  return false;
31  }
virtual void StarVlist::Draw ( bool  ,
int  whichtex 
)
inlinevirtual

Reimplemented in SpriteStarVlist, and PointStarVlist.

Definition at line 19 of file star.h.

Referenced by Stars::Draw(), and DrawAll().

19 {}
void StarVlist::DrawAll ( const QVector center,
const Vector vel,
const Vector ang_vel,
bool  rot,
bool  yawpitch 
)
inline

Definition at line 37 of file star.h.

References BeginDrawState(), Draw(), EndDrawState(), and NumTextures().

Referenced by Background::Draw().

38  {
39  int LC = 0, LN = NumTextures();
40  for (LC = 0; LC < LN; ++LC) {
41  bool tmp = this->BeginDrawState( center, vel, ang_vel, rot, yawpitch, LC );
42  this->Draw( tmp, LC );
43  this->EndDrawState( tmp, LC );
44  }
45  }
virtual void StarVlist::EndDrawState ( bool  ,
int  whichtex 
)
inlinevirtual

Reimplemented in SpriteStarVlist, and PointStarVlist.

Definition at line 32 of file star.h.

Referenced by Stars::Draw(), and DrawAll().

32 {}
virtual int StarVlist::NumTextures ( )
inlinevirtual

Reimplemented in SpriteStarVlist.

Definition at line 33 of file star.h.

Referenced by Stars::Draw(), and DrawAll().

34  {
35  return 1;
36  }
void StarVlist::UpdateGraphics ( )

Definition at line 307 of file star.cpp.

References _Universe, Universe::AccessCamera(), camq, camr, getNewTime(), Camera::GetPQR(), lasttime, newcamq, newcamr, and Vector.

Referenced by PointStarVlist::BeginDrawState(), and SpriteStarVlist::BeginDrawState().

308 {
309  double time = getNewTime();
310  if (time != lasttime) {
311  camr = newcamr;
312  camq = newcamq;
313  Vector newcamp;
314  _Universe->AccessCamera()->GetPQR( newcamp, newcamq, newcamr );
315  lasttime = time;
316  }
317 }

Member Data Documentation

Vector StarVlist::camq
protected

Definition at line 16 of file star.h.

Referenced by StarVlist(), and UpdateGraphics().

Vector StarVlist::camr
protected

Definition at line 15 of file star.h.

Referenced by StarVlist(), and UpdateGraphics().

double StarVlist::lasttime
protected

Definition at line 17 of file star.h.

Referenced by StarVlist(), and UpdateGraphics().

Vector StarVlist::newcamq
protected

Definition at line 14 of file star.h.

Referenced by StarVlist(), and UpdateGraphics().

Vector StarVlist::newcamr
protected

Definition at line 13 of file star.h.

Referenced by StarVlist(), and UpdateGraphics().

float StarVlist::spread
protected

Definition at line 12 of file star.h.

Referenced by StarVlist().


The documentation for this class was generated from the following files: