일단 float * float 위에서는 움직이는데 큰 좌표계 구성 안하면 멀티플레이 절대 불가능
This commit is contained in:
39
include/vulkan/coordinate.h
Normal file
39
include/vulkan/coordinate.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "asset/object/model.h"
|
||||
|
||||
namespace std {
|
||||
template <>
|
||||
struct hash<glm::i64vec3> {
|
||||
std::size_t operator()(const glm::i64vec3& v) const noexcept {
|
||||
std::size_t h1 = std::hash<int64_t>()(v.x);
|
||||
std::size_t h2 = std::hash<int64_t>()(v.y);
|
||||
std::size_t h3 = std::hash<int64_t>()(v.z);
|
||||
return h1 ^ (h2 << 1) ^ (h3 << 2);
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
namespace veng {
|
||||
|
||||
class Coord {
|
||||
public:
|
||||
Coord() : seg(glm::i64vec3(0)), pos(glm::vec3(0.f)) {}
|
||||
Coord(glm::vec3 _pos) : seg(glm::i64vec3(0)), pos(_pos) {}
|
||||
Coord(glm::i64vec3 _seg, glm::vec3 _pos) : seg(_seg), pos(_pos) {}
|
||||
|
||||
glm::i64vec3 seg;
|
||||
glm::vec3 pos;
|
||||
|
||||
Coord operator+(const Coord& other) const;
|
||||
Coord operator-(const Coord& other) const;
|
||||
|
||||
std::unordered_map<glm::i64vec3, glm::vec3> coord_system;
|
||||
|
||||
private:
|
||||
const std::float_t border = 1000.f;
|
||||
};
|
||||
|
||||
} // namespace veng
|
||||
Reference in New Issue
Block a user