core.cpp 818 B

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