Changeset 6424 in orxonox.OLD for trunk/src/world_entities/camera.cc
- Timestamp:
- Jan 7, 2006, 11:07:22 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/camera.cc
r6222 r6424 11 11 ### File Specific: 12 12 main-programmer: Christian Meyer 13 co-programmer: ...13 co-programmer: Benjamin Grauer 14 14 */ 15 15 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY … … 17 17 #include "camera.h" 18 18 19 #include "world.h"20 #include "world_entity.h"21 #include "vector.h"22 #include "event.h"23 19 #include "event_handler.h" 24 20 25 21 using namespace std; 26 22 27 ////////////28 // CAMERA //29 ////////////30 23 31 24 /** … … 58 51 */ 59 52 Camera::~Camera() 60 { 61 } 53 {} 62 54 63 55 /** … … 115 107 currentMode = mode; 116 108 switch (mode) 117 109 { 118 110 default: 119 111 case VIEW_NORMAL: 120 112 this->toFovy = 60.0; 121 /* this->setParentSoft("TrackNode");122 this->target->setParentSoft("TrackNode"); */113 /* this->setParentSoft("TrackNode"); 114 this->target->setParentSoft("TrackNode"); */ 123 115 this->setRelCoorSoft(-10, 5, 0); 124 116 this->target->setRelCoorSoft(0,0,0); 125 117 break; 126 118 case VIEW_BEHIND: 127 // this->toFovy = 120.0;128 // this->setRelCoorSoft(Vector(3.5, 0, 0));129 // this->target->setRelCoorSoft(Vector(10,0,0));130 131 // if (!strcmp(this->target->getParent()->getName(), "Player"))132 // this->target->setParentSoft("TrackNode");133 // else134 // this->target->setParentSoft("Player");135 // this->getParent()->debugNode(0);136 137 // this->setParent("main-Turret");138 // this->setParentMode(PNODE_ALL);139 // this->target->setParentSoft("Player");119 // this->toFovy = 120.0; 120 // this->setRelCoorSoft(Vector(3.5, 0, 0)); 121 // this->target->setRelCoorSoft(Vector(10,0,0)); 122 123 // if (!strcmp(this->target->getParent()->getName(), "Player")) 124 // this->target->setParentSoft("TrackNode"); 125 // else 126 // this->target->setParentSoft("Player"); 127 // this->getParent()->debugNode(0); 128 129 // this->setParent("main-Turret"); 130 // this->setParentMode(PNODE_ALL); 131 // this->target->setParentSoft("Player"); 140 132 141 133 break; 142 134 case VIEW_FRONT: 143 135 this->toFovy = 120.0; 144 /* this->setParentSoft("Player");145 this->target->setParentSoft("Player");*/146 147 148 // this->target->setRelDirSoft(Quaternion(M_PI/4.0, Vector(0,1,0)));136 /* this->setParentSoft("Player"); 137 this->target->setParentSoft("Player");*/ 138 this->setRelCoorSoft(4, 0, 0, 5); 139 this->target->setRelCoorSoft(Vector(10,0,0), 5); 140 // this->target->setRelDirSoft(Quaternion(M_PI/4.0, Vector(0,1,0))); 149 141 break; 150 142 case VIEW_LEFT: 151 143 this->toFovy = 90; 152 /* this->setParentSoft("TrackNode");153 this->target->setParentSoft("TrackNode");*/144 /* this->setParentSoft("TrackNode"); 145 this->target->setParentSoft("TrackNode");*/ 154 146 this->setRelCoorSoft(0, 1, -10, .5); 155 147 this->target->setRelCoorSoft(0,0,0); … … 157 149 case VIEW_RIGHT: 158 150 this->toFovy = 90; 159 /* this->setParentSoft("TrackNode");160 this->target->setParentSoft("TrackNode");*/151 /* this->setParentSoft("TrackNode"); 152 this->target->setParentSoft("TrackNode");*/ 161 153 this->setRelCoorSoft(Vector(0, 1, 10)); 162 154 this->target->setRelCoorSoft(0,0,0); … … 164 156 case VIEW_TOP: 165 157 this->toFovy= 120; 166 /* this->setParentSoft("TrackNode");167 this->target->setParentSoft("TrackNode");*/158 /* this->setParentSoft("TrackNode"); 159 this->target->setParentSoft("TrackNode");*/ 168 160 this->setRelCoorSoft(Vector(30, 50, 0)); 169 161 this->target->setRelCoorSoft(35,0,0); 170 162 } 171 163 } 172 164 … … 216 208 // switching back to Modeling Matrix 217 209 glMatrixMode (GL_MODELVIEW); 218 // this->target->getParent()->getParent()->debugDraw(0, 2, Vector(1,0,0));210 // this->target->getParent()->getParent()->debugDraw(0, 2, Vector(1,0,0)); 219 211 } 220 212 … … 226 218 { 227 219 if( event.type == KeyMapper::PEV_VIEW0) 228 229 230 220 { 221 this->setViewMode(VIEW_NORMAL); 222 } 231 223 else if( event.type == KeyMapper::PEV_VIEW1) 232 233 234 224 { 225 this->setViewMode(VIEW_BEHIND); 226 } 235 227 else if( event.type == KeyMapper::PEV_VIEW2) 236 237 238 228 { 229 this->setViewMode(VIEW_FRONT); 230 } 239 231 else if( event.type == KeyMapper::PEV_VIEW3) 240 241 242 232 { 233 this->setViewMode(VIEW_LEFT); 234 } 243 235 else if( event.type == KeyMapper::PEV_VIEW4) 244 245 246 236 { 237 this->setViewMode(VIEW_RIGHT); 238 } 247 239 else if( event.type == KeyMapper::PEV_VIEW5) 248 249 250 240 { 241 this->setViewMode(VIEW_TOP); 242 } 251 243 } 252 244 … … 260 252 { 261 253 this->setClassID(CL_CAMERA_TARGET, "CameraTarget"); 262 // this->setParentMode(PNODE_MOVEMENT);263 } 264 254 // this->setParentMode(PNODE_MOVEMENT); 255 } 256
Note: See TracChangeset
for help on using the changeset viewer.