gwnavgeneration/generator/generatorintegercoords.h Source File

generatorintegercoords.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 #pragma once
8 
10 
11 namespace Kaim
12 {
13 
14 class GeneratorSystem;
15 
16 class GeneratorIntegerCoords
17 {
18  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_NavDataGen)
19 
20 public:
21  GeneratorIntegerCoords();
22 
23  void Init(KyFloat32 normalizedRasterPrecision);
24 
25  bool IsTriangleTooBig(const Vec3i& A, const Vec3i& B, const Vec3i& C) const;
26 
27  bool AreTriangleCoordinatesValid(const Vec3f& A, const Vec3f& B, const Vec3f& C) const;
28 
29  bool IsCoordinateValid(const Vec3f& pos) const;
30 
31  KyFloat32 IntToMeter_Dist(KyUInt32 intValue) const
32  {
33  return IntCoordSystem::IntToNavigation_Dist(intValue, m_normalizedRasterPrecision);
34  }
35 
36  KyUInt32 MeterToInt_Dist(KyFloat32 coordInMeter) const
37  {
38  return IntCoordSystem::NavigationToInt_Dist(coordInMeter, m_normalizedRasterPrecision);
39  }
40 
41  void IntToMeter_Pos(const Vec2i& intPos, Vec2f& pos) const
42  {
43  pos.x = IntToMeter_Dist(intPos.x);
44  pos.y = IntToMeter_Dist(intPos.y);
45  }
46 
47  void IntToMeter_Pos(const Vec3i& intPos, Vec3f& pos) const
48  {
49  pos.x = IntToMeter_Dist(intPos.x);
50  pos.y = IntToMeter_Dist(intPos.y);
51  pos.z = IntToMeter_Dist(intPos.z);
52  }
53 
54  void MeterToInt_Pos(const Vec2f& pos, Vec2i& intPos) const
55  {
56  intPos.x = MeterToInt_Dist(pos.x);
57  intPos.y = MeterToInt_Dist(pos.y);
58  }
59 
60  void MeterToInt_Pos(const Vec3f& pos, Vec3i& intPos) const
61  {
62  intPos.x = MeterToInt_Dist(pos.x);
63  intPos.y = MeterToInt_Dist(pos.y);
64  intPos.z = MeterToInt_Dist(pos.z);
65  }
66 
67 public:
68  KyFloat32 m_normalizedRasterPrecision;
69 };
70 
71 }
72 
73 
74 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
float KyFloat32
float
Definition: types.h:32