script vector3: add to_string and << operator overload (#119)
This commit is contained in:
parent
7b8bfba701
commit
d8304d3e60
@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
#include "../rage/vector.hpp"
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <ostream>
|
||||
|
||||
namespace rage
|
||||
{
|
||||
@ -64,6 +67,19 @@ namespace rage
|
||||
return this->x != other.x || this->y != other.y || this->z != other.z;
|
||||
}
|
||||
|
||||
std::string to_string() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << *this;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const scrVector& vec)
|
||||
{
|
||||
os << "(" << vec.x << ", " << vec.y << ", " << vec.z << ")";
|
||||
return os;
|
||||
}
|
||||
|
||||
alignas(8) float x{};
|
||||
alignas(8) float y{};
|
||||
alignas(8) float z{};
|
||||
|
Loading…
Reference in New Issue
Block a user