From 6a12a3dc7f2a85c867428f480f6db0b049963337 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 3 Jan 2016 22:20:14 +0000 Subject: [PATCH] Moved some code to .inl --- include/PolyVox/AStarPathfinder.h | 42 --------------------------- include/PolyVox/AStarPathfinder.inl | 45 +++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/include/PolyVox/AStarPathfinder.h b/include/PolyVox/AStarPathfinder.h index 73749d57..ef698ae8 100644 --- a/include/PolyVox/AStarPathfinder.h +++ b/include/PolyVox/AStarPathfinder.h @@ -34,48 +34,6 @@ namespace PolyVox { - const float sqrt_1 = 1.0f; - const float sqrt_2 = 1.4143f; - const float sqrt_3 = 1.7321f; - - const Vector3DInt32 arrayPathfinderFaces[6] = - { - Vector3DInt32(0, 0, -1), - Vector3DInt32(0, 0, +1), - Vector3DInt32(0, -1, 0), - Vector3DInt32(0, +1, 0), - Vector3DInt32(-1, 0, 0), - Vector3DInt32(+1, 0, 0) - }; - - const Vector3DInt32 arrayPathfinderEdges[12] = - { - Vector3DInt32(0, -1, -1), - Vector3DInt32(0, -1, +1), - Vector3DInt32(0, +1, -1), - Vector3DInt32(0, +1, +1), - Vector3DInt32(-1, 0, -1), - Vector3DInt32(-1, 0, +1), - Vector3DInt32(+1, 0, -1), - Vector3DInt32(+1, 0, +1), - Vector3DInt32(-1, -1, 0), - Vector3DInt32(-1, +1, 0), - Vector3DInt32(+1, -1, 0), - Vector3DInt32(+1, +1, 0) - }; - - const Vector3DInt32 arrayPathfinderCorners[8] = - { - Vector3DInt32(-1, -1, -1), - Vector3DInt32(-1, -1, +1), - Vector3DInt32(-1, +1, -1), - Vector3DInt32(-1, +1, +1), - Vector3DInt32(+1, -1, -1), - Vector3DInt32(+1, -1, +1), - Vector3DInt32(+1, +1, -1), - Vector3DInt32(+1, +1, +1) - }; - /// This function provides the default method for checking whether a given voxel /// is valid for the path computed by the AStarPathfinder. template diff --git a/include/PolyVox/AStarPathfinder.inl b/include/PolyVox/AStarPathfinder.inl index 03b1f521..93ec5e44 100644 --- a/include/PolyVox/AStarPathfinder.inl +++ b/include/PolyVox/AStarPathfinder.inl @@ -26,6 +26,51 @@ namespace PolyVox { + //////////////////////////////////////////////////////////////////////////////// + // Useful constants + //////////////////////////////////////////////////////////////////////////////// + const float sqrt_1 = 1.0f; + const float sqrt_2 = 1.4143f; + const float sqrt_3 = 1.7321f; + + const Vector3DInt32 arrayPathfinderFaces[6] = + { + Vector3DInt32(0, 0, -1), + Vector3DInt32(0, 0, +1), + Vector3DInt32(0, -1, 0), + Vector3DInt32(0, +1, 0), + Vector3DInt32(-1, 0, 0), + Vector3DInt32(+1, 0, 0) + }; + + const Vector3DInt32 arrayPathfinderEdges[12] = + { + Vector3DInt32(0, -1, -1), + Vector3DInt32(0, -1, +1), + Vector3DInt32(0, +1, -1), + Vector3DInt32(0, +1, +1), + Vector3DInt32(-1, 0, -1), + Vector3DInt32(-1, 0, +1), + Vector3DInt32(+1, 0, -1), + Vector3DInt32(+1, 0, +1), + Vector3DInt32(-1, -1, 0), + Vector3DInt32(-1, +1, 0), + Vector3DInt32(+1, -1, 0), + Vector3DInt32(+1, +1, 0) + }; + + const Vector3DInt32 arrayPathfinderCorners[8] = + { + Vector3DInt32(-1, -1, -1), + Vector3DInt32(-1, -1, +1), + Vector3DInt32(-1, +1, -1), + Vector3DInt32(-1, +1, +1), + Vector3DInt32(+1, -1, -1), + Vector3DInt32(+1, -1, +1), + Vector3DInt32(+1, +1, -1), + Vector3DInt32(+1, +1, +1) + }; + //////////////////////////////////////////////////////////////////////////////// /// Using this function, a voxel is considered valid for the path if it is inside the /// volume and if its density is below that returned by the voxel's getDensity() function.