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
BaseInterface::Room::BaseShip Class Reference

#include <base.h>

Inheritance diagram for BaseInterface::Room::BaseShip:
BaseInterface::Room::BaseObj

Public Member Functions

virtual void Draw (::BaseInterface *base)
 
virtual ~BaseShip ()
 
 BaseShip (const std::string &ind)
 
 BaseShip (float r0, float r1, float r2, float r3, float r4, float r5, float r6, float r7, float r8, QVector pos, const std::string &ind)
 
- Public Member Functions inherited from BaseInterface::Room::BaseObj
virtual ~BaseObj ()
 
 BaseObj (const std::string &ind)
 

Public Attributes

Matrix mat
 
- Public Attributes inherited from BaseInterface::Room::BaseObj
const std::string index
 

Detailed Description

Definition at line 211 of file base.h.

Constructor & Destructor Documentation

virtual BaseInterface::Room::BaseShip::~BaseShip ( )
inlinevirtual

Definition at line 216 of file base.h.

216 {}
BaseInterface::Room::BaseShip::BaseShip ( const std::string &  ind)
inlineexplicit

Definition at line 220 of file base.h.

220 : BaseObj( ind ) {}
BaseInterface::Room::BaseShip::BaseShip ( float  r0,
float  r1,
float  r2,
float  r3,
float  r4,
float  r5,
float  r6,
float  r7,
float  r8,
QVector  pos,
const std::string &  ind 
)
inline

Definition at line 221 of file base.h.

References i, j, and k.

231  :
232  BaseObj( ind )
233  , mat( r0, r1, r2, r3, r4, r5, r6, r7, r8, QVector( pos.i/2, pos.j/2, pos.k ) ) {}

Member Function Documentation

void BaseInterface::Room::BaseShip::Draw ( ::BaseInterface base)
virtual

Reimplemented from BaseInterface::Room::BaseObj.

Definition at line 279 of file base_interface.cpp.

References _Universe, Universe::AccessCamera(), BaseInterface::caller, DEPTHTEST, DEPTHWRITE, game_data_t::fov, g_game, Camera::getCockpitOffset(), Camera::GetFov(), Camera::GetOrientation(), Camera::GetPosition(), UnitContainer::GetUnit(), VegaConfig::getVariable(), GFXClear(), GFXCreateLight(), GFXDeleteLight(), GFXDisable(), GFXEnable(), GFXFALSE, GFXHudMode(), GFXTRUE, LIGHTING, MultMatrix(), Matrix::p, XMLSupport::parse_float(), q, QVector, Unit::rSize(), Camera::setCockpitOffset(), Camera::SetFov(), SetupViewport(), TEXTURE0, TEXTURE1, Camera::UpdateGFX(), Vector, vs_config, and game_data_t::znear.

280 {
281  Unit *un = base->caller.GetUnit();
282  if (un) {
283  GFXHudMode( GFXFALSE );
284  float tmp = g_game.fov;
285  static float standard_fov = XMLSupport::parse_float( vs_config->getVariable( "graphics", "base_fov", "90" ) );
286  g_game.fov = standard_fov;
287  float tmp1 = _Universe->AccessCamera()->GetFov();
288  _Universe->AccessCamera()->SetFov( standard_fov );
289  Vector p, q, r;
290  _Universe->AccessCamera()->GetOrientation( p, q, r );
291  float co = _Universe->AccessCamera()->getCockpitOffset();
295  Matrix cam( p.i, p.j, p.k, q.i, q.j, q.k, r.i, r.j, r.k, pos );
296  Matrix final;
297  Matrix newmat = mat;
298  newmat.p.k *= un->rSize();
299  newmat.p += QVector( 0, 0, g_game.znear );
300  newmat.p.i *= newmat.p.k;
301  newmat.p.j *= newmat.p.k;
302  MultMatrix( final, cam, newmat );
303  SetupViewport();
304  GFXClear( GFXFALSE ); //clear the zbuf
305 
306  GFXEnable( DEPTHTEST );
308  GFXEnable( LIGHTING );
309  int light = 0;
310  GFXCreateLight( light,
311  GFXLight( true,
312  GFXColor( 1, 1, 1, 1 ),
313  GFXColor( 1, 1, 1, 1 ),
314  GFXColor( 1, 1, 1, 1 ),
315  GFXColor( 0.1, 0.1, 0.1, 1 ),
316  GFXColor( 1, 0, 0 ),
317  GFXColor( 1, 1, 1, 0 ),
318  24 ),
319  true );
320 
321  (un)->DrawNow( final, FLT_MAX );
322  GFXDeleteLight( light );
325  GFXDisable( LIGHTING );
326  GFXDisable( TEXTURE1 );
327  GFXEnable( TEXTURE0 );
330  SetupViewport();
331  GFXHudMode( GFXTRUE );
332  g_game.fov = tmp;
333  _Universe->AccessCamera()->SetFov( tmp1 );
334  }
335 }

Member Data Documentation

Matrix BaseInterface::Room::BaseShip::mat

Definition at line 215 of file base.h.


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