Changeset 3304 for code/trunk/src/util
- Timestamp:
- Jul 18, 2009, 6:23:31 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/netp6 (added) merged: 3215,3226-3227,3229-3231,3240,3242,3251-3252,3256,3258-3259,3263-3264,3267-3268,3277,3283-3284,3289,3298-3299,3302
- Property svn:mergeinfo changed
-
code/trunk/src/util/Math.cc
r3196 r3304 136 136 return orxonox::Vector2(0, 1); 137 137 } 138 139 float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1)); 140 138 139 float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1); 140 float sin_value = sqrt( 1 - cos_value*cos_value ); 141 141 142 if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0) 142 return orxonox::Vector2( sin(angle), cos(angle));143 else 144 return orxonox::Vector2( -sin(angle), cos(angle));143 return orxonox::Vector2( sin_value, cos_value ); 144 else 145 return orxonox::Vector2( -sin_value, cos_value ); 145 146 } 146 147 … … 175 176 return orxonox::Vector2(0, 1); 176 177 } 177 float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1)); 178 //float angle = acos(clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1)); 179 180 float cos_value = clamp<float>(myorthonormal.dotProduct(projection) / projectionlength, -1, 1); 181 float sin_value = sqrt( 1 - cos_value*cos_value ); 178 182 179 183 float distancelength = distance.length(); … … 182 186 183 187 if ((mydirection.crossProduct(myorthonormal)).dotProduct(distance) > 0) 184 return orxonox::Vector2( sin(angle) * radius, cos(angle)* radius);185 else 186 return orxonox::Vector2( -sin(angle) * radius, cos(angle)* radius);188 return orxonox::Vector2( sin_value * radius, cos_value * radius); 189 else 190 return orxonox::Vector2( -sin_value * radius, cos_value * radius); 187 191 } 188 192 -
code/trunk/src/util/Serialise.h
r3084 r3304 408 408 template <> inline void loadAndIncrease( const std::string& variable, uint8_t*& mem ) 409 409 { 410 *(std::string*)( &variable ) = std::string((const char *)mem);410 *(std::string*)( &variable ) = (const char *)mem; 411 411 mem += variable.length()+1; 412 412 } … … 414 414 template <> inline bool checkEquality( const std::string& variable, uint8_t* mem ) 415 415 { 416 return std::string((const char*)mem)==variable; 416 //return std::string((const char*)mem)==variable; 417 return (const char*)mem==variable; 417 418 } 418 419
Note: See TracChangeset
for help on using the changeset viewer.