Changeset 10270 in orxonox.OLD for branches/playability/src/world_entities/camera.cc
- Timestamp:
- Jan 17, 2007, 5:52:08 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/camera.cc
r10251 r10270 18 18 #include "key_mapper.h" 19 19 #include "glincl.h" 20 //#include "util/loading/load_param.h" 21 #include "world_entity.h" 20 22 21 23 ObjectListDefinition(Camera); … … 27 29 { 28 30 this->registerObject(this, Camera::_objectList); 31 this->init(); 32 } 33 34 /* 35 Camera::Camera(const TiXmlElement* root) 36 { 37 this->registerObject(this, Camera::_objectList); 38 this->init(); 39 this->loadParams(root); 40 } 41 */ 42 43 /** 44 * default destructor 45 */ 46 Camera::~Camera() 47 {} 48 49 void Camera::init() 50 { 29 51 this->setName("camera"); 30 52 this->target = new CameraTarget(); … … 37 59 this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW5); 38 60 39 this->setFovy(90);61 //this->setFovy(90); 40 62 this->setAspectRatio(1.33f); 41 63 this->setClipRegion(.1, 10000); 64 65 this->viewTopFovy = 60; 66 this->viewNormalFovy = 90; 67 this->viewFrontFovy = 120; 68 this->viewRightFovy = 90; 69 this->viewLeftFovy = 90; 70 71 this->viewTopDistance = 70; 72 this->viewNormalDistance = 10; 73 this->viewFrontDistance = 4; 74 this->viewRightDistance = 10; 75 this->viewLeftDistance = 10; 76 77 //this->loadParams(doc.RootElement()); 42 78 43 79 this->setViewMode(Camera::ViewNormal); … … 45 81 this->setParentMode(PNODE_ALL); 46 82 this->eventHandling = true; 47 48 49 } 50 51 /** 52 * default destructor 53 */ 54 Camera::~Camera() 55 {} 83 } 56 84 57 85 /** … … 104 132 case Camera::ViewNormal: 105 133 { 106 this->toFovy = 60.0; 107 this->setRelCoorSoft(-10, 5, 0); 134 this->fovy = viewNormalFovy; 135 this->toFovy = viewNormalFovy; 136 //this->fovy = 60; 137 //this->toFovy = 60; 138 this->setRelCoorSoft(-2.0/3.0 * this->viewNormalDistance, 1.0/3.0 * this->viewNormalDistance, 0); 108 139 this->target->setRelCoorSoft(0,0,0); 109 140 break; … … 113 144 case Camera::ViewFront: 114 145 { 115 this->toFovy = 120.0; 116 this->setRelCoorSoft(4, 0, 0, 5); 146 this->fovy = viewFrontFovy; 147 this->toFovy = viewFrontFovy; 148 this->setRelCoorSoft(this->viewFrontDistance, 0, 0, 5); 117 149 this->target->setRelCoorSoft(Vector(10,0,0), 5); 118 150 break; … … 120 152 case Camera::ViewLeft: 121 153 { 122 this->toFovy = 90; 123 this->setRelCoorSoft(0, 1, -10, .5); 154 this->fovy = viewLeftFovy; 155 this->toFovy = viewLeftFovy; 156 this->setRelCoorSoft(0, 1, -viewLeftDistance, .5); 124 157 this->target->setRelCoorSoft(0,0,0); 125 158 break; … … 127 160 case Camera::ViewRight: 128 161 { 129 this->toFovy = 90; 130 this->setRelCoorSoft(Vector(0, 1, 10)); 162 this->fovy = viewRightFovy; 163 this->toFovy = viewRightFovy; 164 this->setRelCoorSoft(Vector(0, 1, viewRightDistance), 0.5); 131 165 this->target->setRelCoorSoft(0,0,0); 132 166 break; … … 134 168 case Camera::ViewTop: 135 169 { 136 this->toFovy= 30; 137 this->setRelCoor(Vector(-0.05, 200 , 0)); 170 this->fovy= viewTopFovy; 171 this->toFovy = viewTopFovy; 172 this->setRelCoorSoft(Vector(-0.05, this->viewTopDistance , 0), 0.5); 138 173 this->target->setRelCoor(0,0,0); 139 174 } … … 234 269 } 235 270 271 /* 272 void Camera::loadParams(const TiXmlElement* root) 273 { 274 // Do the PNode loading stuff 275 PNode::loadParams(root); 276 277 LoadParam(root, "viewTopFovy", this, Camera, setViewTopFovy); 278 LoadParam(root, "viewFrontFovy", this, Camera, setViewFrontFovy); 279 LoadParam(root, "viewLeftFovy", this, Camera, setViewLeftFovy); 280 LoadParam(root, "viewRightFovy", this, Camera, setViewRightFovy); 281 LoadParam(root, "viewBehindFovy", this, Camera, setViewBehindFovy); 282 LoadParam(root, "viewNormalFovy", this, Camera, setViewNormalFovy); 283 284 LoadParam(root, "viewTopDistance", this, Camera, setViewTopDistance); 285 LoadParam(root, "viewFrontDistance", this, Camera, setViewFrontDistance); 286 LoadParam(root, "viewLeftDistance", this, Camera, setViewLeftDistance); 287 LoadParam(root, "viewRightDistance", this, Camera, setViewRightDistance); 288 LoadParam(root, "viewBehindDistance", this, Camera, setViewBehindDistance); 289 LoadParam(root, "viewNormalDistance", this, Camera, setViewNormalDistance); 290 } 291 */ 292 293 void Camera::setViewTopFovy(float fovy) 294 { 295 this->viewTopFovy = fovy; 296 } 297 298 void Camera::setViewFrontFovy(float fovy) 299 { 300 this->viewFrontFovy = fovy; 301 } 302 303 void Camera::setViewLeftFovy(float fovy) 304 { 305 this->viewLeftFovy = fovy; 306 } 307 308 void Camera::setViewRightFovy(float fovy) 309 { 310 this->viewRightFovy = fovy; 311 } 312 313 void Camera::setViewBehindFovy(float fovy) 314 { 315 this->viewBehindFovy = fovy; 316 } 317 318 void Camera::setViewNormalFovy(float fovy) 319 { 320 this->viewNormalFovy = fovy; 321 } 322 323 void Camera::setViewTopDistance(float Distance) 324 { 325 this->viewTopDistance = Distance; 326 } 327 328 void Camera::setViewFrontDistance(float Distance) 329 { 330 this->viewFrontDistance = Distance; 331 } 332 333 void Camera::setViewLeftDistance(float Distance) 334 { 335 this->viewLeftDistance = Distance; 336 } 337 338 void Camera::setViewRightDistance(float Distance) 339 { 340 this->viewRightDistance = Distance; 341 } 342 343 void Camera::setViewBehindDistance(float Distance) 344 { 345 this->viewBehindDistance = Distance; 346 } 347 348 void Camera::setViewNormalDistance(float Distance) 349 { 350 this->viewNormalDistance = Distance; 351 } 352 236 353 237 354 ///////////////////
Note: See TracChangeset
for help on using the changeset viewer.