diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h index 840cd37a..341c0cff 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h @@ -39,6 +39,12 @@ freely, subject to the following restrictions: namespace PolyVox { + /** + * \file + * + * Ambient occlusion + */ + template class AmbientOcclusionCalculatorRaycastCallback { diff --git a/library/PolyVoxCore/include/PolyVoxCore/Density.h b/library/PolyVoxCore/include/PolyVoxCore/Density.h index 9f266c37..3a32590d 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Density.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Density.h @@ -92,10 +92,18 @@ namespace PolyVox return *this; } + /// \return The current density of the voxel Type getDensity() const throw() { return m_uDensity; } + /** + * Set the density of the voxel + * + * \param uDensity The density to set to + */ void setDensity(Type uDensity) { m_uDensity = uDensity; } + /// \return The maximum allowed density of the voxel static Type getMaxDensity() throw() { return (std::numeric_limits::max)(); } + /// \return The minimum allowed density of the voxel static Type getMinDensity() throw() { return (std::numeric_limits::min)(); } private: diff --git a/library/PolyVoxCore/include/PolyVoxCore/Material.h b/library/PolyVoxCore/include/PolyVoxCore/Material.h index 7bbf78fb..debec149 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Material.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Material.h @@ -58,7 +58,13 @@ namespace PolyVox return !(*this == rhs); } + /// \return The current material value of the voxel Type getMaterial() const throw() { return m_uMaterial; } + /** + * Set the material value of the voxel + * + * \param uDensity The material to set to + */ void setMaterial(Type uMaterial) { m_uMaterial = uMaterial; } private: diff --git a/library/PolyVoxCore/include/PolyVoxCore/Raycast.h b/library/PolyVoxCore/include/PolyVoxCore/Raycast.h index 3754f563..104792c2 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Raycast.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Raycast.h @@ -30,10 +30,13 @@ namespace PolyVox { namespace RaycastResults { + /** + * The results of a raycast + */ enum RaycastResult { - Completed, - Interupted + Completed, ///< If the ray passed through the volume without being interupted + Interupted ///< If the ray was interupted while travelling }; } typedef RaycastResults::RaycastResult RaycastResult; diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h index 5bbc6b53..8902a47e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h @@ -45,6 +45,7 @@ namespace PolyVox { public: #ifndef SWIG + //Could be made private? class Block { public: @@ -82,24 +83,35 @@ namespace PolyVox #endif { public: + /// Construct a new Sampler Sampler(SimpleVolume* volume); ~Sampler(); Sampler& operator=(const Sampler& rhs) throw(); VoxelType getSubSampledVoxel(uint8_t uLevel) const; - inline VoxelType getVoxel(void) const; - + /// Get the value of the current voxel + inline VoxelType getVoxel(void) const; + + /// Set the current voxel position void setPosition(const Vector3DInt32& v3dNewPos); + /// Set the current voxel position void setPosition(int32_t xPos, int32_t yPos, int32_t zPos); + /// Set the value of the current voxel inline bool setVoxel(VoxelType tValue); + /// Increase the \a x position by \a 1 void movePositiveX(void); + /// Increase the \a y position by \a 1 void movePositiveY(void); + /// Increase the \a z position by \a 1 void movePositiveZ(void); + /// Decrease the \a x position by \a 1 void moveNegativeX(void); + /// Decrease the \a y position by \a 1 void moveNegativeY(void); + /// Decrease the \a z position by \a 1 void moveNegativeZ(void); inline VoxelType peekVoxel1nx1ny1nz(void) const; diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl index 7795e5bc..3dc3ce11 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl @@ -50,7 +50,7 @@ namespace PolyVox } //////////////////////////////////////////////////////////////////////////////// - /// The border value is returned whenever an atempt is made to read a voxel which + /// The border value is returned whenever an attempt is made to read a voxel which /// is outside the extents of the volume. /// \return The value used for voxels outside of the volume //////////////////////////////////////////////////////////////////////////////// @@ -230,7 +230,9 @@ namespace PolyVox } //////////////////////////////////////////////////////////////////////////////// - /// Note: This function needs reviewing for accuracy... + /// \todo This function needs reviewing for accuracy... + /// + /// \return The number of bytes used //////////////////////////////////////////////////////////////////////////////// template uint32_t SimpleVolume::calculateSizeInBytes(void) diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeSampler.inl index 43f6a924..3156c98c 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolumeSampler.inl @@ -28,6 +28,9 @@ freely, subject to the following restrictions: namespace PolyVox { + /** + * \param volume The SimpleVolume you want to sample + */ template SimpleVolume::Sampler::Sampler(SimpleVolume* volume) :BaseVolume::template Sampler< SimpleVolume >(volume) @@ -91,19 +94,30 @@ namespace PolyVox return tValue; } } - + + /** + * \return The current voxel + */ template VoxelType SimpleVolume::Sampler::getVoxel(void) const { return *mCurrentVoxel; } - + + /** + * \param v3dNewPos The position to set to + */ template void SimpleVolume::Sampler::setPosition(const Vector3DInt32& v3dNewPos) { setPosition(v3dNewPos.getX(), v3dNewPos.getY(), v3dNewPos.getZ()); } - + + /** + * \param xPos The \a x position to set to + * \param yPos The \a y position to set to + * \param zPos The \a z position to set to + */ template void SimpleVolume::Sampler::setPosition(int32_t xPos, int32_t yPos, int32_t zPos) { @@ -134,7 +148,16 @@ namespace PolyVox mCurrentVoxel = this->mVolume->m_pUncompressedBorderData + uVoxelIndexInBlock; } } - + + /** + * \details + * + * This function checks that the current voxel position that you're trying + * to set is not outside the volume. If it is, this function returns + * \a false, otherwise it will return \a true. + * + * \param tValue The value to set to voxel to + */ template bool SimpleVolume::Sampler::setVoxel(VoxelType tValue) { diff --git a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl index f550a6ec..347f555a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Vector.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/Vector.inl @@ -516,7 +516,7 @@ namespace PolyVox } /** - NOTE: This function does not make much sense on integer Vectors. + \note This function does not make much sense on integer Vectors. \return Length of the Vector. */ template @@ -543,7 +543,7 @@ namespace PolyVox This function is commutative, such that a.angleTo(b) == b.angleTo(a). The angle returned is in radians and varies between 0 and 3.14(pi). It is always positive. - NOTE: This function does not make much sense on integer Vectors. + \note This function does not make much sense on integer Vectors. \param Vector3D The Vector to find the angle to. \return The angle between them in radians. @@ -597,7 +597,7 @@ namespace PolyVox /** Divides the i, j, and k components by the length to give a Vector of length 1.0. - NOTE: This function does not make much sense on integer Vectors. + \note This function does not make much sense on integer Vectors. */ template inline void Vector::normalise(void) throw()