core.cpp 655 B

12345678910111213141516171819202122
  1. #include <irrlicht/fast_atof.h>
  2. #include "core.h"
  3. namespace wp
  4. {
  5. irr::core::vector3df core::ato3vf(const char *str)
  6. {
  7. irr::f32 x = irr::core::fast_atof (str, &str); while (*str == ' ') str ++;
  8. irr::f32 y = irr::core::fast_atof (str, &str); while (*str == ' ') str ++;
  9. irr::f32 z = irr::core::fast_atof (str, &str);
  10. return irr::core::vector3df (x, y, z);
  11. }
  12. irr::core::vector2df core::ato2vf (const char *str)
  13. {
  14. irr::f32 x = irr::core::fast_atof (str, &str); while (*str == ' ') str ++;
  15. irr::f32 y = irr::core::fast_atof (str, &str);
  16. return irr::core::vector2df (x, y);
  17. }
  18. }