Changeset 8120 in orxonox.OLD for branches/network/src/world_entities/spectator.cc
- Timestamp:
- Jun 2, 2006, 4:19:10 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/world_entities/spectator.cc
r8068 r8120 71 71 { 72 72 this->mouseDir = rot; 73 this-> rotY = Quaternion( rot.getHeading(), Vector( 0, 1, 0));74 this-> rotAxis = Quaternion( rot.getAttitude(), Vector( 0, 0, 1 ));73 this->angleY = rot.getHeading(); 74 this->angleX = rot.getAttitude(); 75 75 } 76 76 … … 104 104 yMouse *= time / 10; 105 105 106 this->rotY *= Quaternion(-M_PI/4.0*this->xMouse, Vector(0,1,0)); 107 this->rotAxis *= Quaternion(-M_PI/4.0*this->yMouse, Vector(0,0,1) ); 108 109 this->mouseDir = rotY * rotAxis; 110 //this->mouseDir *= Quaternion(-M_PI/4.0*this->yMouse, Vector(0,0,1)); 106 angleX -= xMouse; 107 angleY -= yMouse; 108 109 if ( angleY > 2.05 ) 110 angleY = 2.05; 111 112 if ( angleY < -1.15 ) 113 angleY = -1.15; 114 115 this->mouseDir = Quaternion( angleX, Vector( 0, 1, 0 ) ) * Quaternion( angleY, Vector( 0, 0, 1 ) ); 116 111 117 xMouse = yMouse = 0; 112 118 } 113 119 114 120 this->setAbsDir( this->mouseDir ); 121 122 Vector velocity; 123 124 if ( this->bForward ) 125 { 126 velocity += this->getAbsDirX(); 127 } 128 129 if ( this->bBackward ) 130 { 131 velocity -= this->getAbsDirX(); 132 } 133 134 if ( this->bRight ) 135 { 136 velocity += this->getAbsDirZ(); 137 } 138 139 if ( this->bLeft ) 140 { 141 velocity -= this->getAbsDirZ(); 142 } 143 144 velocity *= 100; 145 146 this->shiftCoor( velocity*time ); 115 147 } 116 148
Note: See TracChangeset
for help on using the changeset viewer.