rewrote vector/quadword storage, it was incompatible with gcc compiler (causing some run-time problems)

This commit is contained in:
ejcoumans
2007-09-11 20:40:55 +00:00
parent cf3da19ee4
commit a7841c7775
3 changed files with 50 additions and 133 deletions

View File

@@ -22,17 +22,10 @@ subject to the following restrictions:
class btQuadWordStorage
{
protected:
#ifdef BT_USE_DOUBLE_PRECISION
union { btScalar m_x; unsigned char m_charx[8] ;};
union { btScalar m_y; unsigned char m_chary[8] ; };
union { btScalar m_z; unsigned char m_charz[8] ; };
union { btScalar m_unusedW; unsigned char m_charw[8] ; };
#else
union { btScalar m_x; unsigned int m_intx; unsigned char m_charx[4] ;};
union { btScalar m_y; unsigned int m_inty; unsigned char m_chary[4] ; };
union { btScalar m_z; unsigned int m_intz; unsigned char m_charz[4] ; };
union { btScalar m_unusedW; unsigned int m_intw; unsigned char m_charw[4] ; };
#endif //BT_USE_DOUBLE_PRECISION
btScalar m_x;
btScalar m_y;
btScalar m_z;
btScalar m_unusedW;
};
@@ -70,86 +63,7 @@ class btQuadWord : public btQuadWordStorage
SIMD_FORCE_INLINE operator btScalar *() { return &m_x; }
SIMD_FORCE_INLINE operator const btScalar *() const { return &m_x; }
#ifdef BT_USE_DOUBLE_PRECISION
SIMD_FORCE_INLINE const unsigned char* getLongIntXValue() const
{
return &m_charx[0];
}
SIMD_FORCE_INLINE const unsigned char* getLongIntYValue() const
{
return &m_chary[0];;
}
SIMD_FORCE_INLINE const unsigned char* getLongIntZValue() const
{
return &m_charz[0];;
}
SIMD_FORCE_INLINE const unsigned char* getLongIntWValue() const
{
return &m_charw[0];;
}
SIMD_FORCE_INLINE void setXValueByLongInt(unsigned char* intval)
{
int i;
for (i=0;i<8;i++)
m_charx[i] = intval[i];
}
SIMD_FORCE_INLINE void setYValueByLongInt(unsigned char* intval)
{
int i;
for (i=0;i<8;i++)
m_chary[i] = intval[i];
}
SIMD_FORCE_INLINE void setZValueByLongInt(unsigned char* intval)
{
int i;
for (i=0;i<8;i++)
m_charz[i] = intval[i];
}
SIMD_FORCE_INLINE void setWValueByLongInt(unsigned char* intval)
{
int i;
for (i=0;i<8;i++)
m_charw[i] = intval[i];
}
#else
SIMD_FORCE_INLINE unsigned int getIntXValue() const
{
return m_intx;
}
SIMD_FORCE_INLINE unsigned int getIntYValue() const
{
return m_inty;
}
SIMD_FORCE_INLINE unsigned int getIntZValue() const
{
return m_intz;
}
SIMD_FORCE_INLINE unsigned int getIntWValue() const
{
return m_intw;
}
SIMD_FORCE_INLINE void setXValueByInt(unsigned int intval)
{
m_intx = intval;
}
SIMD_FORCE_INLINE void setYValueByInt(unsigned int intval)
{
m_inty = intval;
}
SIMD_FORCE_INLINE void setZValueByInt(unsigned int intval)
{
m_intz = intval;
}
SIMD_FORCE_INLINE void setWValueByInt(unsigned int intval)
{
m_intw = intval;
}
#endif//BT_USE_DOUBLE_PRECISION
SIMD_FORCE_INLINE void setValue(const btScalar& x, const btScalar& y, const btScalar& z)
{