Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __AmbientOcclusionCalculator_H__
00025 #define __AmbientOcclusionCalculator_H__
00026
00027 #include "PolyVoxImpl/RandomUnitVectors.h"
00028 #include "PolyVoxImpl/RandomVectors.h"
00029
00030 #include "PolyVoxCore/Array.h"
00031 #include "PolyVoxCore/Region.h"
00032 #include "PolyVoxCore/Raycast.h"
00033
00034 #include <algorithm>
00035
00036 namespace PolyVox
00037 {
00038 template< template<typename> class VolumeType, typename VoxelType>
00039 class AmbientOcclusionCalculator
00040 {
00041 public:
00042 AmbientOcclusionCalculator(VolumeType<VoxelType>* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement);
00043 ~AmbientOcclusionCalculator();
00044
00045 void execute(void);
00046
00047 private:
00048 Region m_region;
00049 typename VolumeType<VoxelType>::Sampler m_sampVolume;
00050 VolumeType<VoxelType>* m_volInput;
00051 Array<3, uint8_t>* m_arrayResult;
00052 float m_fRayLength;
00053
00054 uint8_t m_uNoOfSamplesPerOutputElement;
00055
00056 uint16_t mRandomUnitVectorIndex;
00057 uint16_t mRandomVectorIndex;
00058 uint16_t mIndexIncreament;
00059 };
00060 }
00061
00062 #include "PolyVoxCore/AmbientOcclusionCalculator.inl"
00063
00064 #endif //__AmbientOcclusionCalculator_H__