Moved some code to .inl
This commit is contained in:
parent
f4ebd4c6a9
commit
6a12a3dc7f
@ -34,48 +34,6 @@
|
|||||||
|
|
||||||
namespace PolyVox
|
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
|
/// This function provides the default method for checking whether a given voxel
|
||||||
/// is valid for the path computed by the AStarPathfinder.
|
/// is valid for the path computed by the AStarPathfinder.
|
||||||
template<typename VolumeType>
|
template<typename VolumeType>
|
||||||
|
@ -26,6 +26,51 @@
|
|||||||
|
|
||||||
namespace PolyVox
|
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
|
/// 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.
|
/// volume and if its density is below that returned by the voxel's getDensity() function.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user