diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2024-04-06 15:36:03 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-06 15:36:03 -0600 |
| commit | 24633ebd7cc6866da3e3d06fddc6f0f49a741f1d (patch) | |
| tree | 357a563fae006b04ded941ee534b1d6522f3fc32 /src/types/Vec3D.cpp | |
| parent | ad667b705dad3476a1ae803f23588c55baab2ee4 (diff) | |
Introduce Metadata and ItemCurve Factories (#27)
* Introduce metadata
* Metadata works now
* Cleanup
* Fixes
* Cleanup 2
* yaml improvement
* Comment update
* Rename tables to metadata
* Update
* Fix warnings
* Implement ItemCurve
* Remove unused enum
* Replace static with const
* Fix bug
* Add const
* More fixes
* Fix quote bug in IncludeFactory
* Fix header in ItemCurve
* Fixes
* Fix texture factory
* updates
* Clearer debug info
* Fixes
* Working ci8 png
* Fix size output
* Fix
* Add gitignore for modding
* Fix precision for mtx
* Remove header exporter from metadata
* Remove hardcoded enum
* Remove tabs
* Remove tabs
* tlut temp fix
---------
Co-authored-by: = <=>
Diffstat (limited to 'src/types/Vec3D.cpp')
| -rw-r--r-- | src/types/Vec3D.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/types/Vec3D.cpp b/src/types/Vec3D.cpp index c70e540..ab263f8 100644 --- a/src/types/Vec3D.cpp +++ b/src/types/Vec3D.cpp @@ -86,6 +86,23 @@ std::ostream& operator<< (std::ostream& stream, const Vec3i& vec) { return stream; } +Vec3iu::Vec3iu(uint32_t xv, uint32_t yv, uint32_t zv) : x(xv), y(yv), z(zv) {} + +int Vec3iu::width() { + auto wx = GetMagnitude(this->x); + auto wy = GetMagnitude(this->y); + auto wz = GetMagnitude(this->z); + + return std::max(wx, std::max(wy, wz)); +} + +std::ostream& operator<< (std::ostream& stream, const Vec3iu& vec) { + int width = stream.width(); + + stream << std::setw(0) << "{" << std::setw(width) << vec.x << ", " << std::setw(width) << vec.y << ", " << std::setw(width) << vec.z << "}"; + return stream; +} + Vec2f::Vec2f(float xv, float zv) : x(xv), z(zv) {} int Vec2f::precision() { |
