[DEV] correct the Vector2D dependency with cxx
This commit is contained in:
parent
59bbfffc64
commit
75fba23b73
@ -88,12 +88,12 @@ std::ostream& etk::operator <<(std::ostream& _os, const std::vector<bvec2 >& _ob
|
|||||||
|
|
||||||
vec2 vec2rotate(const vec2& _val, const vec2& _point, float _angle) {
|
vec2 vec2rotate(const vec2& _val, const vec2& _point, float _angle) {
|
||||||
vec2 out = _val;
|
vec2 out = _val;
|
||||||
#if (defined(__TARGET_OS__MacOs) || defined(__TARGET_OS__IOs) || __cplusplus < 201103L)
|
#if __CPP_VERSION__ >= 2011 && !defined(__STDCPP_LLVM__)
|
||||||
float sinAngle = sin(_angle);
|
|
||||||
float cosAngle = cos(_angle);
|
|
||||||
#else
|
|
||||||
float sinAngle = std::sin(_angle);
|
float sinAngle = std::sin(_angle);
|
||||||
float cosAngle = std::cos(_angle);
|
float cosAngle = std::cos(_angle);
|
||||||
|
#else
|
||||||
|
float sinAngle = sin(_angle);
|
||||||
|
float cosAngle = cos(_angle);
|
||||||
#endif
|
#endif
|
||||||
if (_point == vec2(0,0)) {
|
if (_point == vec2(0,0)) {
|
||||||
float tempX = out.x() * cosAngle - out.y() * sinAngle;
|
float tempX = out.x() * cosAngle - out.y() * sinAngle;
|
||||||
|
@ -242,7 +242,7 @@ namespace etk {
|
|||||||
* @brief Return the length of the vector
|
* @brief Return the length of the vector
|
||||||
*/
|
*/
|
||||||
float length() const {
|
float length() const {
|
||||||
#if __CPP_VERSION__ >= 2011 && !defined(__TARGET_OS__MacOs) && !defined(__TARGET_OS__IOs)
|
#if __CPP_VERSION__ >= 2011 && !defined(__STDCPP_LLVM__)
|
||||||
return std::sqrt(length2());
|
return std::sqrt(length2());
|
||||||
#else
|
#else
|
||||||
return sqrt(length2());
|
return sqrt(length2());
|
||||||
|
@ -155,15 +155,11 @@ namespace etk {
|
|||||||
* @brief Return the length of the vector
|
* @brief Return the length of the vector
|
||||||
*/
|
*/
|
||||||
btScalar length() const {
|
btScalar length() const {
|
||||||
#ifdef ETK_BUILD_LINEARMATH
|
#if __CPP_VERSION__ >= 2011 && !defined(__STDCPP_LLVM__)
|
||||||
return btSqrt(length2());
|
|
||||||
#else
|
|
||||||
#if __CPP_VERSION__ >= 2011 && !defined(__TARGET_OS__MacOs) && !defined(__TARGET_OS__IOs)
|
|
||||||
return std::sqrt(length2());
|
return std::sqrt(length2());
|
||||||
#else
|
#else
|
||||||
return sqrt(length2());
|
return sqrt(length2());
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,13 +14,11 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
double etk::tool::frand(double _a, double _b)
|
double etk::tool::frand(double _a, double _b) {
|
||||||
{
|
|
||||||
return (float)(( (double)rand()/(double)RAND_MAX ) * ((double)_b-(double)_a) + (double)_a);
|
return (float)(( (double)rand()/(double)RAND_MAX ) * ((double)_b-(double)_a) + (double)_a);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t etk::tool::irand(int32_t _a, int32_t _b)
|
int32_t etk::tool::irand(int32_t _a, int32_t _b) {
|
||||||
{
|
|
||||||
return (int32_t)(( rand()/(double)RAND_MAX ) * ((double)_b-(double)_a) + (double)_a);
|
return (int32_t)(( rand()/(double)RAND_MAX ) * ((double)_b-(double)_a) + (double)_a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,8 +88,10 @@ def create(target, module_name):
|
|||||||
elif target.name != "Windows":
|
elif target.name != "Windows":
|
||||||
my_module.add_export_flag('link', [
|
my_module.add_export_flag('link', [
|
||||||
'-ldl'])
|
'-ldl'])
|
||||||
|
# build in C++ mode
|
||||||
my_module.compile_version("c++", 2011)
|
my_module.compile_version("c++", 2011)
|
||||||
|
# ad dependency of the generic C++ library:
|
||||||
|
my_module.add_module_depend('cxx')
|
||||||
my_module.add_optionnal_module_depend('minizip', ["c++", "-DETK_BUILD_MINIZIP"])
|
my_module.add_optionnal_module_depend('minizip', ["c++", "-DETK_BUILD_MINIZIP"])
|
||||||
my_module.add_optionnal_module_depend('linearmath', ["c", "-DETK_BUILD_LINEARMATH"], export=True)
|
my_module.add_optionnal_module_depend('linearmath', ["c", "-DETK_BUILD_LINEARMATH"], export=True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user