Ocular Engine
MortonCode.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_ENGINE_MATH_MORTON_CODE__H__
19 #define __H__OCULAR_ENGINE_MATH_MORTON_CODE__H__
20 
21 #include "MathCommon.hpp"
22 #include <vector>
23 
24 //------------------------------------------------------------------------------------------
25 
30 namespace Ocular
31 {
36  namespace Math
37  {
38  template<typename T> class Vector3;
39 
40  class MortonCode
41  {
42  public:
43 
51  static uint64_t calculate(Vector3<float> vector);
52 
62  static uint64_t calculate(float x, float y, float z);
63 
75  static uint64_t calculate(uint32_t x, uint32_t y, uint32_t z);
76 
92  static void calculate(std::vector<Vector3<float>> const& vectors, std::vector<uint64_t>& mortonCodes, bool areInRange = false, bool sortCodes = true);
93 
94  protected:
95 
106  static void getTransformFactors(std::vector<Vector3<float>> const& vectors, float& scaleFactor, float& offsetFactor);
107 
108  private:
109  };
110  }
114 }
119 //------------------------------------------------------------------------------------------
120 
121 #endif
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
static void getTransformFactors(std::vector< Vector3< float >> const &vectors, float &scaleFactor, float &offsetFactor)
Definition: MortonCode.cpp:208
static uint64_t calculate(Vector3< float > vector)
Definition: MortonCode.cpp:146
Definition: MortonCode.hpp:40