Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <class T>
- struct TArray
- {
- public:
- inline TArray()
- {
- Data = nullptr;
- };
- inline T& operator[](int i)
- {
- return Data[i];
- };
- inline int Count()
- {
- return count;
- }
- inline const T& operator[](int i) const
- {
- return Data[i];
- };
- private:
- T* Data;
- int count;
- int max;
- };
- struct FString
- {
- public:
- inline wchar_t *GetWideString()
- {
- return this->str;
- }
- inline char *GetString()
- {
- char mbs[256] = {};
- wcstombs(mbs, this->str, this->count);
- return mbs;
- }
- private:
- wchar_t *str;
- int count;
- int max;
- };
- class Vector3
- {
- public:
- float x;
- float y;
- float z;
- Vector3()
- {
- x = y = z = 0;
- }
- Vector3(float x, float y, float z)
- {
- this->x = x;
- this->y = y;
- this->z = z;
- }
- float Dot(const Vector3 &vec)
- {
- return this->x * vec.x + this->y * vec.y + this->z * vec.z;
- }
- float Length()
- {
- return (float)sqrt(this->x * this->x + this->y * this->y + this->z * this->z);
- }
- Vector3 operator-(const Vector3 &vec)
- {
- return Vector3(this->x - vec.x, this->y - vec.y, this->z - vec.z);
- }
- Vector3 operator+(const Vector3 &vec)
- {
- return Vector3(this->x + vec.x, this->y + vec.y, this->z + vec.z);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement