summaryrefslogtreecommitdiff
path: root/game/geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-25 16:28:39 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-25 16:28:39 +0000
commit0aa665c3648d788755b00c9e431c872d57fddbb8 (patch)
tree859dba97d3026db485813d808e8180ac94a0ed2a /game/geoData.cpp
parentRemove getTransform (diff)
downloadilt-0aa665c3648d788755b00c9e431c872d57fddbb8.tar.bz2
ilt-0aa665c3648d788755b00c9e431c872d57fddbb8.tar.xz
ilt-0aa665c3648d788755b00c9e431c872d57fddbb8.zip
Model positions as integers
Introduces test failure in arcs due to rounding, but I don't want to create a complicated fix as link positions are still floats and hopefully that'll go away... somehow
Diffstat (limited to 'game/geoData.cpp')
-rw-r--r--game/geoData.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp
index da067f7..ec990ea 100644
--- a/game/geoData.cpp
+++ b/game/geoData.cpp
@@ -73,7 +73,7 @@ GeoData::loadFromImages(const std::filesystem::path & fileName, float scale_)
}
GeoData::Quad
-GeoData::quad(glm::vec2 wcoord) const
+GeoData::quad(Position2D wcoord) const
{
constexpr static const std::array<glm::vec2, 4> corners {{{0, 0}, {0, 1}, {1, 0}, {1, 1}}};
return transform_array(transform_array(corners,
@@ -154,7 +154,7 @@ GeoData::intersectRay(const Ray & ray) const
try {
const auto point = quad(n);
for (auto offset : {0U, 1U}) {
- glm::vec2 bary;
+ BaryPosition bary;
float distance;
if (glm::intersectRayTriangle(ray.start, ray.direction, point[offset], point[offset + 1],
point[offset + 2], bary, distance)) {