Changeset 6387 for code/branches/presentation2/src/libraries/util
- Timestamp:
- Dec 21, 2009, 1:18:36 PM (15 years ago)
- Location:
- code/branches/presentation2/src/libraries/util
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/util/Clock.cc
r6319 r6387 44 44 delete timer_; 45 45 } 46 46 47 47 /** 48 48 @remarks -
code/branches/presentation2/src/libraries/util/Math.cc
r6137 r6387 138 138 return orxonox::Vector2(0, 1); 139 139 } 140 140 141 141 float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1); 142 142 float sin_value = sqrt( 1 - cos_value*cos_value ); 143 143 144 144 if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0) 145 145 return orxonox::Vector2( sin_value, cos_value ); … … 179 179 } 180 180 //float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1)); 181 181 182 182 float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1); 183 183 float sin_value = sqrt( 1 - cos_value*cos_value ); -
code/branches/presentation2/src/libraries/util/MultiType.h
r5738 r6387 232 232 233 233 virtual void toString(std::ostream& outstream) const = 0; 234 234 235 235 virtual void importData( uint8_t*& mem )=0; 236 236 virtual void exportData( uint8_t*& mem ) const=0; … … 339 339 template <typename T> inline bool isType() const { return false; } // Only works for specialized values - see below 340 340 std::string getTypename() const; 341 341 342 342 /** @brief Saves the value of the MT to a bytestream (pointed at by mem) and increases mem pointer by size of MT */ 343 343 inline void exportData(uint8_t*& mem) const { assert(sizeof(MT_Type::Value)<=8); *static_cast<uint8_t*>(mem) = this->getType(); mem+=sizeof(uint8_t); this->value_->exportData(mem); } -
code/branches/presentation2/src/libraries/util/MultiTypeValue.h
r5738 r6387 150 150 /** @brief Puts the current value on the stream */ 151 151 inline void toString(std::ostream& outstream) const { outstream << this->value_; } 152 152 153 153 /** @brief loads data from the bytestream (mem) into the MT and increases the bytestream pointer by the size of the data */ 154 154 inline void importData( uint8_t*& mem ) { loadAndIncrease( /*(const T&)*/this->value_, mem ); } … … 160 160 T value_; //!< The stored value 161 161 }; 162 162 163 163 // Import / Export specialisation 164 164 // ColourValue -
code/branches/presentation2/src/libraries/util/Serialise.h
r6320 r6387 40 40 41 41 namespace orxonox{ 42 42 43 43 /** @brief returns the size of the variable in a datastream */ 44 44 template <class T> inline uint32_t returnSize( const T& variable ); … … 202 202 return sizeof(uint32_t); 203 203 } 204 204 205 205 template <> inline void loadAndIncrease( const unsigned int& variable, uint8_t*& mem ) 206 206 { … … 470 470 return variable==Degree(*r); 471 471 } 472 472 473 473 // =========== Vector2 474 474 … … 494 494 return checkEquality(variable.x, mem) && checkEquality(variable.y, mem+returnSize(variable.x)); 495 495 } 496 496 497 497 // =========== Vector3 498 498 … … 521 521 checkEquality(variable.z, mem+returnSize(variable.x)+returnSize(variable.y)); 522 522 } 523 523 524 524 // =========== Vector4 525 525 … … 551 551 checkEquality(variable.z, mem+returnSize(variable.w)+returnSize(variable.x)+returnSize(variable.y)); 552 552 } 553 553 554 554 // =========== Quaternion 555 555 … … 581 581 checkEquality(variable.z, mem+returnSize(variable.w)+returnSize(variable.x)+returnSize(variable.y)); 582 582 } 583 583 584 584 // =========== ColourValue 585 585 … … 611 611 checkEquality(variable.a, mem+returnSize(variable.r)+returnSize(variable.g)+returnSize(variable.b)); 612 612 } 613 613 614 614 // =========== mbool 615 615 -
code/branches/presentation2/src/libraries/util/mbool.h
r5738 r6387 67 67 inline bool operator!() const 68 68 { return (!this->value_.bool_); } 69 69 70 70 inline unsigned char& getMemory(){ return value_.memory_; } 71 71
Note: See TracChangeset
for help on using the changeset viewer.