- add global namespace statement to sqrt.

refactoring:
- include cmath instead of math.h in c++ API.

Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>
pull/251/head
Kim Kulling 2014-03-27 19:19:25 +01:00
parent e97787aa5c
commit f9d5852ef9
4 changed files with 18 additions and 5 deletions

View File

@ -53,7 +53,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <algorithm>
#include <limits>
#include <math.h>
#ifdef __cplusplus
# include <cmath>
#else
# include <math.h>
#endif
// ----------------------------------------------------------------------------------------
template <typename TReal>

View File

@ -44,7 +44,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_VECTOR2D_H_INC
#define AI_VECTOR2D_H_INC
#include <math.h>
#ifdef __cplusplus
# include <cmath>
#else
# include <math.h>
#endif
#include "./Compiler/pushpack1.h"

View File

@ -44,8 +44,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AI_VECTOR3D_H_INC
#define AI_VECTOR3D_H_INC
#include <math.h>
#ifdef __cplusplus
# include <cmath>
#else
# include <math.h>
#endif
#include "./Compiler/pushpack1.h"

View File

@ -90,7 +90,7 @@ AI_FORCE_INLINE TReal aiVector3t<TReal>::SquareLength() const {
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE TReal aiVector3t<TReal>::Length() const {
return sqrt( SquareLength());
return ::sqrt( SquareLength());
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
@ -207,6 +207,7 @@ AI_FORCE_INLINE aiVector3t<TReal> operator - ( const aiVector3t<TReal>& v) {
return aiVector3t<TReal>( -v.x, -v.y, -v.z);
}
// ------------------------------------------------------------------------------------------------
#endif // __cplusplus
#endif // AI_VECTOR3D_INL_INC