Mostly revert bb87e9e6280b321708f631f286b57a67343c769e to fix crash

Using const references seemed to be causing a crash so have
changed back to just passing the function by value.
This commit is contained in:
Matt Williams 2012-11-17 13:04:12 +00:00
parent 5774285d60
commit 0566645c9e
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ namespace PolyVox
return func;
}
const IsVoxelTransparentCallback& mIsVoxelTransparentCallback;
IsVoxelTransparentCallback mIsVoxelTransparentCallback;
};
// NOTE: The callback needs to be a functor not a function. I haven't been
@ -74,7 +74,7 @@ namespace PolyVox
/// Calculate the ambient occlusion for the volume
template<typename VolumeType, typename IsVoxelTransparentCallback>
void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, const IsVoxelTransparentCallback& isVoxelTransparentCallback);
void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback);
}
#include "PolyVoxCore/AmbientOcclusionCalculator.inl"

View File

@ -32,7 +32,7 @@ namespace PolyVox
* \param isVoxelTransparentCallback A callback which takes a \a VoxelType and returns a \a bool whether the voxel is transparent
*/
template<typename VolumeType, typename IsVoxelTransparentCallback>
void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, const IsVoxelTransparentCallback& isVoxelTransparentCallback)
void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback)
{
typename VolumeType::Sampler m_sampVolume(volInput);