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