Changeset 1319 for code/branches/console/src/util/MultiTypeMath.cc
- Timestamp:
- May 19, 2008, 12:55:41 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/util/MultiTypeMath.cc
r1056 r1319 37 37 else if (type == MT_vector3) 38 38 this->vector3_ = orxonox::Vector3(0, 0, 0); 39 else if (type == MT_vector4) 40 this->vector4_ = orxonox::Vector4(0, 0, 0, 0); 39 41 else if (type == MT_colourvalue) 40 42 this->colourvalue_ = orxonox::ColourValue(0, 0, 0, 0); … … 55 57 else if (this->type_ == MT_vector3) 56 58 return (this->vector3_ == mtm.vector3_); 59 else if (this->type_ == MT_vector4) 60 return (this->vector4_ == mtm.vector4_); 57 61 else if (this->type_ == MT_colourvalue) 58 62 return (this->colourvalue_ == mtm.colourvalue_); … … 76 80 else if (this->type_ == MT_vector3) 77 81 return (this->vector3_ != mtm.vector3_); 82 else if (this->type_ == MT_vector4) 83 return (this->vector4_ != mtm.vector4_); 78 84 else if (this->type_ == MT_colourvalue) 79 85 return (this->colourvalue_ != mtm.colourvalue_); … … 123 129 MultiTypeMath::operator orxonox::Vector3() const 124 130 { return (this->type_ == MT_vector3) ? this->vector3_ : getConvertedValue<MultiTypeMath, orxonox::Vector3>(*this); } 131 MultiTypeMath::operator orxonox::Vector4() const 132 { return (this->type_ == MT_vector4) ? this->vector4_ : getConvertedValue<MultiTypeMath, orxonox::Vector4>(*this); } 125 133 MultiTypeMath::operator orxonox::Quaternion() const 126 134 { return (this->type_ == MT_quaternion) ? this->quaternion_ : getConvertedValue<MultiTypeMath, orxonox::Quaternion>(*this); } … … 137 145 this->vector2_ = mtm.vector2_; 138 146 this->vector3_ = mtm.vector3_; 147 this->vector4_ = mtm.vector4_; 139 148 this->quaternion_ = mtm.quaternion_; 140 149 this->colourvalue_ = mtm.colourvalue_; … … 149 158 else if (this->type_ == MT_vector3) 150 159 return "Vector3"; 160 else if (this->type_ == MT_vector4) 161 return "Vector4"; 151 162 else if (this->type_ == MT_colourvalue) 152 163 return "ColourValue"; … … 169 180 else if (this->type_ == MT_vector3) 170 181 ConvertValue(&output, this->vector3_); 182 else if (this->type_ == MT_vector4) 183 ConvertValue(&output, this->vector4_); 171 184 else if (this->type_ == MT_colourvalue) 172 185 ConvertValue(&output, this->colourvalue_); … … 189 202 else if (this->type_ == MT_vector3) 190 203 return ConvertValue(&this->vector3_, value, orxonox::Vector3(0, 0, 0)); 204 else if (this->type_ == MT_vector4) 205 return ConvertValue(&this->vector4_, value, orxonox::Vector4(0, 0, 0, 0)); 191 206 else if (this->type_ == MT_colourvalue) 192 207 return ConvertValue(&this->colourvalue_, value, orxonox::ColourValue(0, 0, 0, 0)); … … 199 214 else 200 215 return MultiTypeString::fromString(value); 216 } 217 218 void MultiTypeMath::assimilate(const MultiTypeMath& mtm) 219 { 220 if (this->type_ == MT_vector2) 221 this->vector2_ = mtm.operator orxonox::Vector2(); 222 else if (this->type_ == MT_vector3) 223 this->vector3_ = mtm.operator orxonox::Vector3(); 224 else if (this->type_ == MT_vector4) 225 this->vector4_ = mtm.operator orxonox::Vector4(); 226 else if (this->type_ == MT_colourvalue) 227 this->colourvalue_ = mtm; 228 else if (this->type_ == MT_quaternion) 229 this->quaternion_ = mtm; 230 else if (this->type_ == MT_radian) 231 this->radian_ = mtm.operator orxonox::Radian(); 232 else if (this->type_ == MT_degree) 233 this->degree_ = mtm.operator orxonox::Degree(); 234 else 235 MultiTypeString::assimilate(mtm); 201 236 } 202 237
Note: See TracChangeset
for help on using the changeset viewer.