Changeset 1295
- Timestamp:
- May 15, 2008, 7:59:37 PM (17 years ago)
- Location:
- code/branches/hud3/src/orxonox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc
r1292 r1295 39 39 #include <OgreOverlayElement.h> 40 40 #include <OgrePanelOverlayElement.h> 41 42 41 #include <OgreStringConverter.h> 43 #include <math.h>44 #include <string.h>45 46 42 #include "RadarOverlayElement.h" 47 43 … … 51 47 using namespace Ogre; 52 48 53 RadarOverlayElement::RadarOverlayElement(const String& name):Ogre::PanelOverlayElement(name){} 49 RadarOverlayElement::RadarOverlayElement(const String& name):Ogre::PanelOverlayElement(name){ 50 initialDir = Vector3(0.0, 0.0, 1.0); 51 } 54 52 55 53 RadarOverlayElement::~RadarOverlayElement(){} … … 61 59 void RadarOverlayElement::initRadarOverlayElement(Real left, Real top, int dim, Ogre::OverlayContainer* container){ 62 60 63 61 dirX_ = 0; // direction of travel 62 dirY_ = 0; 63 dirZ_ = 1; 64 64 65 dirX_ = 1;66 dirY_ = 0;67 dirZ_ = 0;65 ortX_ = 0; // normal of ship 66 ortY_ = 1; 67 ortZ_ = 0; 68 68 69 ortX_ = 0; 70 ortY_ = 0; 71 ortZ_ = 1; 72 73 dX_ = 0; 69 dX_ = 37; 74 70 dY_ = 0; 75 dZ_ = -1;71 dZ_ = 0; 76 72 77 73 alpha_ = acos((dirX_*dX_+dirY_*dY_+dirZ_*dZ_)/(sqrt(pow(dX_,2)+pow(dY_,2)+pow(dZ_,2))*sqrt(pow(dirX_,2)+pow(dirY_,2)+pow(dirZ_,2)))); -
code/branches/hud3/src/orxonox/hud/RadarOverlayElement.cc~
r1292 r1295 26 26 */ 27 27 28 /* local coordinate system of space ship: 29 30 y 31 + z 32 | + 33 | / 34 |/ 35 x +------O 36 */ 37 28 38 #include <OgreOverlayManager.h> 29 39 #include <OgreOverlayElement.h> 30 40 #include <OgrePanelOverlayElement.h> 31 32 41 #include <OgreStringConverter.h> 33 #include <math.h>34 #include <string.h>35 36 42 #include "RadarOverlayElement.h" 37 43 … … 41 47 using namespace Ogre; 42 48 43 RadarOverlayElement::RadarOverlayElement(const String& name):Ogre::PanelOverlayElement(name){} 49 RadarOverlayElement::RadarOverlayElement(const String& name):Ogre::PanelOverlayElement(name){ 50 initialDir = Vector3(0.0, 0.0, 1.0); 51 } 44 52 45 53 RadarOverlayElement::~RadarOverlayElement(){} … … 51 59 void RadarOverlayElement::initRadarOverlayElement(Real left, Real top, int dim, Ogre::OverlayContainer* container){ 52 60 53 61 dirX_ = 0; // direction of travel 62 dirY_ = 0; 63 dirZ_ = 1; 54 64 55 dirX_ = 1;56 dirY_ = 0;57 dirZ_ = 0;65 ortX_ = 0; // normal of ship 66 ortY_ = 1; 67 ortZ_ = 0; 58 68 59 ortX_ = 0; 60 ortY_ = 0; 61 ortZ_ = 1; 62 63 dX_ = 0; 69 dX_ = 37; 64 70 dY_ = 0; 65 dZ_ = -1;71 dZ_ = 0; 66 72 67 73 alpha_ = acos((dirX_*dX_+dirY_*dY_+dirZ_*dZ_)/(sqrt(pow(dX_,2)+pow(dY_,2)+pow(dZ_,2))*sqrt(pow(dirX_,2)+pow(dirY_,2)+pow(dirZ_,2)))); -
code/branches/hud3/src/orxonox/hud/RadarOverlayElement.h
r1292 r1295 32 32 #include <OgreOverlayElement.h> 33 33 #include <OgrePanelOverlayElement.h> 34 34 #include <math.h> 35 #include <util/Math.h> 36 #include <string.h> 37 #include "core/Tickable.h" 35 38 #include <OgrePrerequisites.h> 36 39 #include "../OrxonoxPrereqs.h" … … 39 42 { 40 43 41 class _OrxonoxExport RadarOverlayElement : public Ogre::PanelOverlayElement 44 class _OrxonoxExport RadarOverlayElement : public Ogre::PanelOverlayElement, public Tickable 42 45 { 43 46 private: … … 45 48 PanelOverlayElement* point[100]; 46 49 47 int dirX_, dirY_, dirZ_; //flying direction 48 int ortX_, ortY_, ortZ_; //orthogonal direction 49 int dX_, dY_, dZ_; //distance between main ship and the object 50 int vecX_, vecY_, vecZ_; //vector product dir X ort 50 Vector3 initialDir; //initial direction 51 int dirX_, dirY_, dirZ_; //flying direction 52 int ortX_, ortY_, ortZ_; //orthogonal direction 53 int dX_, dY_, dZ_; //distance between main ship and the object 54 int vecX_, vecY_, vecZ_; //vector product dir X ort 51 55 double alpha_; //defines the radius in the radar 52 56 double beta_; //defines the angle in the radar 53 57 bool right_; //checks whether the object is on the right side (since cos is not bijective) 54 58 55 //static int ID = 0;59 // static int ID = 0; 56 60 57 61 public: … … 63 67 void initRadarOverlayElement(Real left, Real top, int dim, Ogre::OverlayContainer* container); 64 68 void setMainShipPosition(int dirX, int dirY, int dirZ, int ortX, int ortY, int ortZ); 65 69 void tick(float dt); 66 70 int newShip(int X, int Y, int Z); 67 71 -
code/branches/hud3/src/orxonox/hud/RadarOverlayElement.h~
r1292 r1295 26 26 */ 27 27 28 /* local coordinate system of space ship:29 30 y31 + z32 | +33 | /34 |/35 x +------O36 */37 38 28 #ifndef _RADAR_H__ 39 29 #define _RADAR_H__ … … 42 32 #include <OgreOverlayElement.h> 43 33 #include <OgrePanelOverlayElement.h> 44 34 #include <math.h> 35 #include <util/Math.h> 36 #include <string.h> 37 #include <Tickable.h> 45 38 #include <OgrePrerequisites.h> 46 39 #include "../OrxonoxPrereqs.h" … … 49 42 { 50 43 51 class _OrxonoxExport RadarOverlayElement : public Ogre::PanelOverlayElement 44 class _OrxonoxExport RadarOverlayElement : public Ogre::PanelOverlayElement, public Tickable 52 45 { 53 46 private: … … 55 48 PanelOverlayElement* point[100]; 56 49 57 int dirX_, dirY_, dirZ_; //flying direction 58 int ortX_, ortY_, ortZ_; //orthogonal direction 59 int dX_, dY_, dZ_; //distance between main ship and the object 60 int vecX_, vecY_, vecZ_; //vector product dir X ort 50 Vector3 initialDir; //initial direction 51 int dirX_, dirY_, dirZ_; //flying direction 52 int ortX_, ortY_, ortZ_; //orthogonal direction 53 int dX_, dY_, dZ_; //distance between main ship and the object 54 int vecX_, vecY_, vecZ_; //vector product dir X ort 61 55 double alpha_; //defines the radius in the radar 62 56 double beta_; //defines the angle in the radar 63 57 bool right_; //checks whether the object is on the right side (since cos is not bijective) 64 58 65 //static int ID = 0;59 // static int ID = 0; 66 60 67 61 public: … … 73 67 void initRadarOverlayElement(Real left, Real top, int dim, Ogre::OverlayContainer* container); 74 68 void setMainShipPosition(int dirX, int dirY, int dirZ, int ortX, int ortY, int ortZ); 75 69 void tick(float dt); 76 70 int newShip(int X, int Y, int Z); 77 71 -
code/branches/hud3/src/orxonox/objects/SpaceShip.cc
r1292 r1295 437 437 } 438 438 439 Vector3 SpaceShip::getSPosition() { 440 return SpaceShip::instance_s->getPosition(); 441 } 442 443 Quaternion SpaceShip::getSOrientation() { 444 return SpaceShip::instance_s->getOrientation(); 445 } 446 439 447 void SpaceShip::tick(float dt) 440 448 { -
code/branches/hud3/src/orxonox/objects/SpaceShip.h
r1292 r1295 33 33 #include <OgrePrerequisites.h> 34 34 35 #include "util/Math.h" 35 36 #include "core/InputInterfaces.h" 36 37 #include "Camera.h" … … 64 65 void getFocus(); 65 66 67 static Vector3 getSPosition(); 68 static Quaternion getSOrientation(); 66 69 static std::string whereAmI(); 67 70 static void setMaxSpeedTest(float value)
Note: See TracChangeset
for help on using the changeset viewer.