Passing parameter as const ref.

This commit is contained in:
David Williams 2015-03-30 11:01:08 +02:00
parent 1c17a7147b
commit 413bb95b1a
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ namespace PolyVox
/// Calculate the ambient occlusion for the volume /// Calculate the ambient occlusion for the volume
template<typename VolumeType, typename IsVoxelTransparentCallback> template<typename VolumeType, typename IsVoxelTransparentCallback>
void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback); void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, const Region& region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback);
} }
#include "PolyVox/AmbientOcclusionCalculator.inl" #include "PolyVox/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 * \param isVoxelTransparentCallback A callback which takes a \a VoxelType and returns a \a bool whether the voxel is transparent
*/ */
template<typename VolumeType, typename IsVoxelTransparentCallback> template<typename VolumeType, typename IsVoxelTransparentCallback>
void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback) void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, const Region& region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback)
{ {
//Make sure that the size of the volume is an exact multiple of the size of the array. //Make sure that the size of the volume is an exact multiple of the size of the array.
if(volInput->getWidth() % arrayResult->getDimension(0) != 0) if(volInput->getWidth() % arrayResult->getDimension(0) != 0)