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 __PolyVox_RaycastWithCallback_H__
00025 #define __PolyVox_RaycastWithCallback_H__
00026
00027 #include "PolyVoxCore/Vector.h"
00028
00029 namespace PolyVox
00030 {
00031 template< template<typename> class VolumeType, typename VoxelType>
00032 class RaycastWithCallback
00033 {
00034 public:
00036 RaycastWithCallback(VolumeType<VoxelType>* volData, const Vector3DFloat& v3dStart, const Vector3DFloat& v3dDirection, polyvox_function<bool(const Vector3DInt32& position)> funcCallback);
00037
00039 void setStart(const Vector3DFloat& v3dStart);
00041 void setDirection(const Vector3DFloat& v3dDirection);
00042
00044 void execute();
00045
00046 private:
00047 polyvox_function<bool(const Vector3DInt32& position)> m_funcCallback;
00048
00049 void doRaycast(float x1, float y1, float z1, float x2, float y2, float z2);
00050
00051 VolumeType<VoxelType>* m_volData;
00052 typename VolumeType<VoxelType>::Sampler m_sampVolume;
00053
00054 Vector3DFloat m_v3dStart;
00055 Vector3DFloat m_v3dDirection;
00056 float m_fMaxDistance;
00057 };
00058 }
00059
00060 #include "PolyVoxCore/RaycastWithCallback.inl"
00061
00062 #endif //__PolyVox_RaycastWithCallback_H__