Changeset 10157 in orxonox.OLD for branches/playability
- Timestamp:
- Jan 1, 2007, 10:12:43 PM (18 years ago)
- Location:
- branches/playability/src/world_entities/effects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/effects/wobblegrid.cc
r10156 r10157 91 91 this->angularSpeed = M_PI; //180; 92 92 this->setModel(this->grid); 93 94 this->setUpdateFunction((*sinf)); 93 95 } 94 96 … … 139 141 140 142 Vector2D& vec = this->grid->texCoord(z*this->subdivision + x); 141 vec.y = (x * fac + sgn(x-2)* sinf(angle)*fac/2.0);142 vec.x = (z * fac + sgn(z-2)* sinf(angle)*fac/2.0);143 vec.y = (x * fac + sgn(x-2)*updateWobble(angle)*fac/2.0); 144 vec.x = (z * fac + sgn(z-2)*updateWobble(angle)*fac/2.0); 143 145 } 144 146 } 145 147 //this->grid->finalize(); 146 147 Vector view = this->getAbsCoor() - State::getCameraNode()->getAbsCoor(); 148 view.normalize(); 149 150 Vector up = Vector(0, 1, 0); 151 Vector h = up.cross(view); 152 up = h.cross(view); 153 154 Quaternion dir = Quaternion::lookAt( this->getAbsCoor(), this->getAbsCoor() + up, view); 155 this->setAbsDir(dir); 156 148 this->orient(); 157 149 } 158 150 … … 200 192 glPopAttrib(); 201 193 } 194 195 void Wobblegrid::orient() 196 { 197 198 Vector view = this->getAbsCoor() - State::getCameraNode()->getAbsCoor(); 199 view.normalize(); 200 201 Vector up = Vector(0, 1, 0); 202 Vector h = up.cross(view); 203 up = h.cross(view); 204 205 Quaternion dir = Quaternion::lookAt( this->getAbsCoor(), this->getAbsCoor() + up, view); 206 this->setAbsDir(dir); 207 } -
branches/playability/src/world_entities/effects/wobblegrid.h
r10154 r10157 29 29 virtual void draw() const; 30 30 31 inline void setUpdateFunction(float (*updateFct)(float value)) { if( updateFct) this->updateWobble = updateFct;}; 32 31 33 private: 34 float (*updateWobble)(float value); 35 36 void orient(); 37 32 38 Material* material; 33 39 Grid* grid; //!< current projected positions transformed into billboard state
Note: See TracChangeset
for help on using the changeset viewer.