KOSMIndoorMap
6#ifndef KOSMINDOORROUTING_NAVMESHTRANSFORM_H
7#define KOSMINDOORROUTING_NAVMESHTRANSFORM_H
9#include "kosmindoorrouting_export.h"
11#include <osm/datatypes.h>
17namespace KOSMIndoorRouting {
21 [[nodiscard]]
inline operator float*() {
return &x; }
22 [[nodiscard]]
inline operator const float*()
const {
return &x; }
29class NavMeshTransform {
34 [[nodiscard]]
inline T mapGeoToNav(
const T &p)
const
36 return m_transform.
map(p);
41 return mapGeoToNav(
QPointF(c.lonF(), c.latF()));
44 [[nodiscard]]
inline float mapHeightToNav(
int floorLevel)
const
47 return (
float)floorLevel;
50 [[nodiscard]]
inline rcVec3 mapGeoHeightToNav(OSM::Coordinate c,
int floorLevel)
const
52 const auto p = mapGeoToNav(c);
53 return { (float)p.x(), mapHeightToNav(floorLevel), (float)p.y() };
56 [[nodiscard]]
inline OSM::Coordinate mapNavToGeo(rcVec3 p)
const
58 const auto c = m_transform.inverted().map(QPointF(p.x, p.z));
59 return OSM::Coordinate(c.y(), c.x());
62 [[nodiscard]]
inline int mapNavHeightToFloorLevel(
float height)
const
64 return (
int)std::round(height);
67 QTransform m_transform;
Coordinate, stored as 1e7 * degree to avoid floating point precision issues, and offset to unsigned v...
3D vector type compatible with the Recast API.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:54:42 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.