Changeset 10460 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 28, 2007, 9:26:08 PM (18 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/camera.cc
r10458 r10460 24 24 #include "track/track.h" 25 25 #include "script_class.h" 26 #include "state.h" 26 27 27 28 … … 100 101 //add to track 101 102 if(this->entityTrack) 102 {103 103 this->setParent(this->entityTrack->getTrackNode()); 104 this->setRelCoor(0,0,0);105 }106 104 } 107 105 … … 112 110 void Camera::lookAt(PNode* target) 113 111 { 112 State::setCamera(this, dynamic_cast<CameraTarget*>(target)); 114 113 this->target->setParentSoft(target,0.2); 115 114 } -
trunk/src/world_entities/scrolling_screen.cc
r10457 r10460 102 102 void ScrollingScreen::setTexture(const std::string& texture) 103 103 { 104 this->material->setDiffuseMap( texture); 104 this->material->setDiffuseMap(texture); 105 106 Texture t = this->material->diffuseTexture(); 107 this->ratio = t.getWidth() / t.getHeight(); 105 108 } 106 109 … … 126 129 this->material->select(); 127 130 128 float resize = -(1. - (this->viewHeight + this->offset));129 if( resize <0.)130 resize = 1.;131 else resize = 1 - resize; 132 133 float texRes = 1 131 float resize = (1. - (this->viewHeight + this->offset)); 132 if( resize > 0.) 133 resize = 0.; 134 135 136 float texRes = 1- resize; 134 137 135 138 136 139 glBegin(GL_QUADS); 137 140 138 glTexCoord2f(this->offset, 0.); 141 // unten links 142 glTexCoord2f(0., 1.); 139 143 glVertex3f(0., -this->xSize*0.5, -this->ySize*0.5); 140 144 141 glTexCoord2f(this->offset, 1.); 145 // unten rechts 146 glTexCoord2f(1., 1.); 142 147 glVertex3f(0., -this->xSize*0.5, this->ySize*0.5); 143 148 144 glTexCoord2f(this->offset + this->viewHeight - texRes, 1.); 145 glVertex3f(0., this->xSize*0.5 - (resize*this->xSize*0.5), this->ySize*0.5); 146 147 glTexCoord2f(this->offset + this->viewHeight - texRes, 0.); 148 glVertex3f(0., this->xSize*0.5 - (resize*this->xSize*0.5), -this->ySize*0.5); 149 // oben rechts 150 glTexCoord2f(1., 0.); 151 glVertex3f(0., this->xSize*0.5, this->ySize*0.5); 152 153 // oben links 154 glTexCoord2f(0., 0.); 155 glVertex3f(0., this->xSize*0.5, -this->ySize*0.5); 149 156 150 157 glEnd(); … … 173 180 174 181 Vector ddir = dir.cross( cam->getAbsDirV()); 175 Quaternion q(ddir, cam->getAbsDir V());182 Quaternion q(ddir, cam->getAbsDirY()); 176 183 this->setAbsDir( q); 177 184 -
trunk/src/world_entities/scrolling_screen.h
r10457 r10460 44 44 float viewHeight; 45 45 float offset; 46 float ratio; 46 47 47 48 float xSize;
Note: See TracChangeset
for help on using the changeset viewer.