Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2011, 7:15:14 AM (13 years ago)
Author:
rgrieder
Message:

Merged kicklib2 branch back to trunk (includes former branches ois_update, mac_osx and kicklib).

Notes for updating

Linux:
You don't need an extra package for CEGUILua and Tolua, it's already shipped with CEGUI.
However you do need to make sure that the OgreRenderer is installed too with CEGUI 0.7 (may be a separate package).
Also, Orxonox now recognises if you install the CgProgramManager (a separate package available on newer Ubuntu on Debian systems).

Windows:
Download the new dependency packages versioned 6.0 and use these. If you have problems with that or if you don't like the in game console problem mentioned below, you can download the new 4.3 version of the packages (only available for Visual Studio 2005/2008).

Key new features:

  • *Support for Mac OS X*
  • Visual Studio 2010 support
  • Bullet library update to 2.77
  • OIS library update to 1.3
  • Support for CEGUI 0.7 —> Support for Arch Linux and even SuSE
  • Improved install target
  • Compiles now with GCC 4.6
  • Ogre Cg Shader plugin activated for Linux if available
  • And of course lots of bug fixes

There are also some regressions:

  • No support for CEGUI 0.5, Ogre 1.4 and boost 1.35 - 1.39 any more
  • In game console is not working in main menu for CEGUI 0.7
  • Tolua (just the C lib, not the application) and CEGUILua libraries are no longer in our repository. —> You will need to get these as well when compiling Orxonox
  • And of course lots of new bugs we don't yet know about
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/external/bullet/LinearMath/btVector3.h

    r5781 r8351  
    2020
    2121#include "btScalar.h"
    22 #include "btScalar.h"
    2322#include "btMinMax.h"
     23
     24#ifdef BT_USE_DOUBLE_PRECISION
     25#define btVector3Data btVector3DoubleData
     26#define btVector3DataName "btVector3DoubleData"
     27#else
     28#define btVector3Data btVector3FloatData
     29#define btVector3DataName "btVector3FloatData"
     30#endif //BT_USE_DOUBLE_PRECISION
     31
     32
     33
     34
    2435/**@brief btVector3 can be used to represent 3D points and vectors.
    2536 * It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user
    2637 * Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers
    2738 */
    28 
    2939ATTRIBUTE_ALIGNED16(class) btVector3
    3040{
     
    3242
    3343#if defined (__SPU__) && defined (__CELLOS_LV2__)
    34         union {
    35                 vec_float4 mVec128;
    3644                btScalar        m_floats[4];
    37         };
    3845public:
    39         vec_float4      get128() const
    40         {
    41                 return mVec128;
     46        SIMD_FORCE_INLINE const vec_float4&     get128() const
     47        {
     48                return *((const vec_float4*)&m_floats[0]);
    4249        }
    4350public:
    4451#else //__CELLOS_LV2__ __SPU__
    45 #ifdef BT_USE_SSE // WIN32
     52#ifdef BT_USE_SSE // _WIN32
    4653        union {
    4754                __m128 mVec128;
     
    142149        SIMD_FORCE_INLINE btScalar distance(const btVector3& v) const;
    143150
     151        SIMD_FORCE_INLINE btVector3& safeNormalize()
     152        {
     153                btVector3 absVec = this->absolute();
     154                int maxIndex = absVec.maxAxis();
     155                if (absVec[maxIndex]>0)
     156                {
     157                        *this /= absVec[maxIndex];
     158                        return *this /= length();
     159                }
     160                setValue(1,0,0);
     161                return *this;
     162        }
     163
    144164  /**@brief Normalize this vector
    145165   * x^2 + y^2 + z^2 = 1 */
     
    152172        SIMD_FORCE_INLINE btVector3 normalized() const;
    153173
    154   /**@brief Rotate this vector
     174  /**@brief Return a rotated version of this vector
    155175   * @param wAxis The axis to rotate about
    156176   * @param angle The angle to rotate by */
    157         SIMD_FORCE_INLINE btVector3 rotate( const btVector3& wAxis, const btScalar angle );
     177        SIMD_FORCE_INLINE btVector3 rotate( const btVector3& wAxis, const btScalar angle ) const;
    158178
    159179  /**@brief Return the angle between this and another vector
     
    307327                        m_floats[1]=y;
    308328                        m_floats[2]=z;
    309                         m_floats[3] = 0.f;
     329                        m_floats[3] = btScalar(0.);
    310330                }
    311331
     
    316336                        v2->setValue(-y()       ,x()    ,0.);
    317337                }
     338
     339                void    setZero()
     340                {
     341                        setValue(btScalar(0.),btScalar(0.),btScalar(0.));
     342                }
     343
     344                SIMD_FORCE_INLINE bool isZero() const
     345                {
     346                        return m_floats[0] == btScalar(0) && m_floats[1] == btScalar(0) && m_floats[2] == btScalar(0);
     347                }
     348
     349                SIMD_FORCE_INLINE bool fuzzyZero() const
     350                {
     351                        return length2() < SIMD_EPSILON;
     352                }
     353
     354                SIMD_FORCE_INLINE       void    serialize(struct        btVector3Data& dataOut) const;
     355
     356                SIMD_FORCE_INLINE       void    deSerialize(const struct        btVector3Data& dataIn);
     357
     358                SIMD_FORCE_INLINE       void    serializeFloat(struct   btVector3FloatData& dataOut) const;
     359
     360                SIMD_FORCE_INLINE       void    deSerializeFloat(const struct   btVector3FloatData& dataIn);
     361
     362                SIMD_FORCE_INLINE       void    serializeDouble(struct  btVector3DoubleData& dataOut) const;
     363
     364                SIMD_FORCE_INLINE       void    deSerializeDouble(const struct  btVector3DoubleData& dataIn);
    318365
    319366};
     
    377424/**@brief Return the dot product between two vectors */
    378425SIMD_FORCE_INLINE btScalar
    379 dot(const btVector3& v1, const btVector3& v2)
     426btDot(const btVector3& v1, const btVector3& v2)
    380427{
    381428        return v1.dot(v2);
     
    385432/**@brief Return the distance squared between two vectors */
    386433SIMD_FORCE_INLINE btScalar
    387 distance2(const btVector3& v1, const btVector3& v2)
     434btDistance2(const btVector3& v1, const btVector3& v2)
    388435{
    389436        return v1.distance2(v2);
     
    393440/**@brief Return the distance between two vectors */
    394441SIMD_FORCE_INLINE btScalar
    395 distance(const btVector3& v1, const btVector3& v2)
     442btDistance(const btVector3& v1, const btVector3& v2)
    396443{
    397444        return v1.distance(v2);
     
    400447/**@brief Return the angle between two vectors */
    401448SIMD_FORCE_INLINE btScalar
    402 angle(const btVector3& v1, const btVector3& v2)
     449btAngle(const btVector3& v1, const btVector3& v2)
    403450{
    404451        return v1.angle(v2);
     
    407454/**@brief Return the cross product of two vectors */
    408455SIMD_FORCE_INLINE btVector3
    409 cross(const btVector3& v1, const btVector3& v2)
     456btCross(const btVector3& v1, const btVector3& v2)
    410457{
    411458        return v1.cross(v2);
     
    413460
    414461SIMD_FORCE_INLINE btScalar
    415 triple(const btVector3& v1, const btVector3& v2, const btVector3& v3)
     462btTriple(const btVector3& v1, const btVector3& v2, const btVector3& v3)
    416463{
    417464        return v1.triple(v2, v3);
     
    445492}
    446493
    447 SIMD_FORCE_INLINE btVector3 btVector3::rotate( const btVector3& wAxis, const btScalar angle )
     494SIMD_FORCE_INLINE btVector3 btVector3::rotate( const btVector3& wAxis, const btScalar angle ) const
    448495{
    449496        // wAxis must be a unit lenght vector
     
    489536        {
    490537                int maxIndex = -1;
    491                 btScalar maxVal = btScalar(-1e30);
     538                btScalar maxVal = btScalar(-BT_LARGE_FLOAT);
    492539                if (m_floats[0] > maxVal)
    493540                {
     
    522569        {
    523570                int minIndex = -1;
    524                 btScalar minVal = btScalar(1e30);
     571                btScalar minVal = btScalar(BT_LARGE_FLOAT);
    525572                if (m_floats[0] < minVal)
    526573                {
     
    585632                }
    586633
    587 
    588  
    589634
    590635};
     
    636681}
    637682
     683template <class T>
     684SIMD_FORCE_INLINE void btPlaneSpace1 (const T& n, T& p, T& q)
     685{
     686  if (btFabs(n[2]) > SIMDSQRT12) {
     687    // choose p in y-z plane
     688    btScalar a = n[1]*n[1] + n[2]*n[2];
     689    btScalar k = btRecipSqrt (a);
     690    p[0] = 0;
     691        p[1] = -n[2]*k;
     692        p[2] = n[1]*k;
     693    // set q = n x p
     694    q[0] = a*k;
     695        q[1] = -n[0]*p[2];
     696        q[2] = n[0]*p[1];
     697  }
     698  else {
     699    // choose p in x-y plane
     700    btScalar a = n[0]*n[0] + n[1]*n[1];
     701    btScalar k = btRecipSqrt (a);
     702    p[0] = -n[1]*k;
     703        p[1] = n[0]*k;
     704        p[2] = 0;
     705    // set q = n x p
     706    q[0] = -n[2]*p[1];
     707        q[1] = n[2]*p[0];
     708        q[2] = a*k;
     709  }
     710}
     711
     712
     713struct  btVector3FloatData
     714{
     715        float   m_floats[4];
     716};
     717
     718struct  btVector3DoubleData
     719{
     720        double  m_floats[4];
     721
     722};
     723
     724SIMD_FORCE_INLINE       void    btVector3::serializeFloat(struct        btVector3FloatData& dataOut) const
     725{
     726        ///could also do a memcpy, check if it is worth it
     727        for (int i=0;i<4;i++)
     728                dataOut.m_floats[i] = float(m_floats[i]);
     729}
     730
     731SIMD_FORCE_INLINE void  btVector3::deSerializeFloat(const struct        btVector3FloatData& dataIn)
     732{
     733        for (int i=0;i<4;i++)
     734                m_floats[i] = btScalar(dataIn.m_floats[i]);
     735}
     736
     737
     738SIMD_FORCE_INLINE       void    btVector3::serializeDouble(struct       btVector3DoubleData& dataOut) const
     739{
     740        ///could also do a memcpy, check if it is worth it
     741        for (int i=0;i<4;i++)
     742                dataOut.m_floats[i] = double(m_floats[i]);
     743}
     744
     745SIMD_FORCE_INLINE void  btVector3::deSerializeDouble(const struct       btVector3DoubleData& dataIn)
     746{
     747        for (int i=0;i<4;i++)
     748                m_floats[i] = btScalar(dataIn.m_floats[i]);
     749}
     750
     751
     752SIMD_FORCE_INLINE       void    btVector3::serialize(struct     btVector3Data& dataOut) const
     753{
     754        ///could also do a memcpy, check if it is worth it
     755        for (int i=0;i<4;i++)
     756                dataOut.m_floats[i] = m_floats[i];
     757}
     758
     759SIMD_FORCE_INLINE void  btVector3::deSerialize(const struct     btVector3Data& dataIn)
     760{
     761        for (int i=0;i<4;i++)
     762                m_floats[i] = dataIn.m_floats[i];
     763}
     764
     765
    638766#endif //SIMD__VECTOR3_H
Note: See TracChangeset for help on using the changeset viewer.