Update of /cvsroot/gcblue/gcb_wx/include/graphics
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32418/include/graphics
Modified Files:
tc3DModel.h tc3DViewer.h
Log Message:
New feature to display 3D models for sensor tracks based on track position (only generic models for now)
Index: tc3DModel.h
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** tc3DModel.h 21 Feb 2005 18:26:04 -0000 1.14
--- tc3DModel.h 17 May 2005 00:20:39 -0000 1.15
***************
*** 33,36 ****
--- 33,37 ----
#include <osg/MatrixTransform>
+ class tc3DViewer;
class tcGameObject;
class tcParticleEffect;
***************
*** 46,49 ****
--- 47,56 ----
//}
+ namespace Sensor
+ {
+ class tcSensorMapTrack;
+ }
+ using Sensor::tcSensorMapTrack;
+
/**
* animation description stored in CSV database entry
***************
*** 84,87 ****
--- 91,105 ----
{
public:
+ /// info needed to locate and orient model within world
+ struct LocationParams
+ {
+ float x;
+ float y;
+ float z;
+ float yaw;
+ float pitch;
+ float roll;
+ bool isVisible;
+ };
enum
{
***************
*** 98,107 ****
void DetachFromParent();
! tcGameObject* GetGameObj() {return gameObj;}
void GetLauncherInfo(unsigned int idx, osg::Vec3& pos, float& az);
osg::ref_ptr<osg::Node> GetNode();
unsigned int GetNumParents();
float GetRadius();
float GetRadiusGeneric();
bool IsSmokeEnabled() const;
--- 116,127 ----
void DetachFromParent();
! tcGameObject* GetGameObj() const {return gameObj;}
void GetLauncherInfo(unsigned int idx, osg::Vec3& pos, float& az);
+ void GetLocationParams(LocationParams& p);
osg::ref_ptr<osg::Node> GetNode();
unsigned int GetNumParents();
float GetRadius();
float GetRadiusGeneric();
+ tcSensorMapTrack* GetSensorTrack() const;
bool IsSmokeEnabled() const;
***************
*** 113,116 ****
--- 133,137 ----
void SetSmokeMode(int mode) {smokeMode = mode;}
void SetupUpdate(tcGameObject *obj);
+ void SetupUpdate(tcSensorMapTrack* track);
void UpdateEffects();
void UpdateSmokePosition(float x, float y, float z);
***************
*** 120,127 ****
~tc3DModel();
static void LoadUnknowns();
static void SetWorldFrame(osg::Group* worldFrame);
-
private:
struct LauncherMountInfo
--- 141,148 ----
~tc3DModel();
+ static void AttachViewer(tc3DViewer* v) {viewer = v;}
static void LoadUnknowns();
static void SetWorldFrame(osg::Group* worldFrame);
private:
struct LauncherMountInfo
***************
*** 147,150 ****
--- 168,172 ----
static osg::ref_ptr<osg::Group> world;
+ static tc3DViewer* viewer; ///< to allow model to calculate its own location
/// models for unidentified platforms
***************
*** 154,160 ****
static osg::ref_ptr<osg::Node> unknownSurface;
static bool useSmoothing;
!
! tcGameObject *gameObj; ///< game object to use to update model state
float distanceFromCamera;
--- 176,183 ----
static osg::ref_ptr<osg::Node> unknownSurface;
static bool useSmoothing;
+
! tcGameObject* gameObj; ///< game object to use to update model state
! tcSensorMapTrack* sensorTrack; ///< sensor track to update model state
float distanceFromCamera;
Index: tc3DViewer.h
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** tc3DViewer.h 5 Mar 2005 22:37:51 -0000 1.7
--- tc3DViewer.h 17 May 2005 00:20:39 -0000 1.8
***************
*** 220,223 ****
--- 220,225 ----
bool isMouseDown;
std::map<int, osgText::Text*> textMap;
+ tc3DModel* defaultSensorModel; ///< default sensor model for non-ID'd tracks
+
void InitLight();
***************
*** 233,236 ****
--- 235,239 ----
void UpdateModels();
void UpdateProjectionMatrix(const wxSize& windowSize);
+ void UpdateSensorModels(unsigned int alliance);
void UpdateSky(DateZulu& dateZulu);
|