mirror of
https://github.com/Mr-X-GTA/GTAV-Classes-1.git
synced 2024-12-22 22:47:32 +08:00
script vector3: add to_string and << operator overload (#119)
This commit is contained in:
parent
9d951d0e32
commit
a7eee8d5cc
@ -1,5 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "../rage/vector.hpp"
|
#include "../rage/vector.hpp"
|
||||||
|
#include <string>
|
||||||
|
#include <sstream>
|
||||||
|
#include <ostream>
|
||||||
|
|
||||||
namespace rage
|
namespace rage
|
||||||
{
|
{
|
||||||
@ -64,6 +67,19 @@ namespace rage
|
|||||||
return this->x != other.x || this->y != other.y || this->z != other.z;
|
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 x{};
|
||||||
alignas(8) float y{};
|
alignas(8) float y{};
|
||||||
alignas(8) float z{};
|
alignas(8) float z{};
|
||||||
|
Loading…
Reference in New Issue
Block a user