home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1992-1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- //////////////////////////////////////////////////////////////////////
- // Cockpit.h - definition of the cockpit class
- //////////////////////////////////////////////////////////////////////
-
- #ifndef COCKPIT_H
- #define COCKPIT_H
-
- #include "Defines.h"
- #include <fmclient.h>
-
- class Car;
- class Engine;
-
- class Cockpit {
-
- public:
-
- Cockpit(Car *);
- ~Cockpit();
-
- // draws dynamics portions of the cockpit
- void draw_indicators(Boolean redraw) const;
-
- // draws static portions of the cockpit
- void draw_cockpit(int window_width);
-
- // called when the window is resized to clear the overlay crap
- void clear_indicators() const;
-
- // the hood is drawn within the out-the-window viewport
- void draw_hood(int display_mode) const;
-
- void set_gas(float p) { _gas = p; };
- void set_brakes(float p) { _brakes = p; };
- void set_clutch(float p) { _clutch = p; };
- void set_steering(float a) { _steering = a; };
-
- float get_gas() const { return _gas; };
- float get_brakes() const { return _brakes; };
- float get_clutch() const { return _clutch; };
- float get_steering() const { return _steering; };
-
- protected:
-
- void draw_gages(float world_per_pixel) const;
- void draw_speedometer(float diam, float world_per_pixel) const;
- void draw_tachometer(float diam, float world_per_pixel) const;
- void draw_gas(float diam, float world_per_pixel) const;
- void draw_temp(float diam, float world_per_pixel) const;
- void draw_oil(float diam, float world_per_pixel) const;
- void draw_fps(float diam, float world_per_pixel) const;
- void draw_gear(float width, float height, float world_per_pixel) const;
- void draw_needles(Boolean redraw) const;
- void draw_overlapping_needles(Boolean redraw) const;
- void draw_messages(Boolean redraw) const;
- void draw_steering_spokes(Boolean draw, float angle) const;
- void draw_steering_wheel() const;
- void draw_dash() const;
- void draw_icons() const;
- void draw_timer(float width, float world_per_pixel) const;
- void draw_times(Boolean redraw, float world_per_pixel) const;
-
- void center_string(
- fmfonthandle font, float world_per_pixel, char *s) const;
-
- Car * _car; // car that this cockpit is in
-
- // locations of cockpit components
- SbVec3f _steering_pos, _tach_pos, _speedo_pos, _gear_pos;
- SbVec3f _gas_pos, _temp_pos, _oil_pos, _fps_pos, _timer_pos;
- float _tach_size, _speedo_size;
- float _gas_size, _temp_size, _oil_size, _fps_size;
- float _gear_width, _gear_height;
- float _timer_width;
-
- float _world_per_pixel;
-
- // 0.0 = not touched, 1.0 = depressed fully
- float _gas;
- float _brakes;
- float _clutch;
-
- // 0 = straight up, positive counter clockwise degrees
- float _steering;
- };
-
- #endif
-
-