add support for double precision and 64bit serialization (and compatibility between all versions)

fix some issue in serialization of nested array data
add some tesing files
This commit is contained in:
erwin.coumans
2010-01-25 19:42:51 +00:00
parent 5d8e6dc3f3
commit e7ff71d99b
48 changed files with 1207 additions and 294 deletions

View File

@@ -1011,9 +1011,9 @@ bool HullLibrary::CleanupVertices(unsigned int svcount,
btScalar y = v[1];
btScalar z = v[2];
btScalar dx = fabsf(x - px );
btScalar dy = fabsf(y - py );
btScalar dz = fabsf(z - pz );
btScalar dx = btFabs(x - px );
btScalar dy = btFabs(y - py );
btScalar dz = btFabs(z - pz );
if ( dx < normalepsilon && dy < normalepsilon && dz < normalepsilon )
{

View File

@@ -19,6 +19,11 @@ subject to the following restrictions:
#include "btVector3.h"
#include "btQuaternion.h"
#ifdef BT_USE_DOUBLE_PRECISION
#define btMatrix3x3Data btMatrix3x3DoubleData
#else
#define btMatrix3x3Data btMatrix3x3FloatData
#endif //BT_USE_DOUBLE_PRECISION
/**@brief The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with btQuaternion, btTransform and btVector3.
@@ -500,6 +505,10 @@ public:
void deSerialize(const struct btMatrix3x3Data& dataIn);
void deSerializeFloat(const struct btMatrix3x3FloatData& dataIn);
void deSerializeDouble(const struct btMatrix3x3DoubleData& dataIn);
};
@@ -628,11 +637,18 @@ SIMD_FORCE_INLINE bool operator==(const btMatrix3x3& m1, const btMatrix3x3& m2)
}
///for serialization
struct btMatrix3x3Data
struct btMatrix3x3FloatData
{
btVector3Data m_el[3];
btVector3FloatData m_el[3];
};
///for serialization
struct btMatrix3x3DoubleData
{
btVector3DoubleData m_el[3];
};
SIMD_FORCE_INLINE void btMatrix3x3::serialize(struct btMatrix3x3Data& dataOut) const
{
@@ -640,11 +656,24 @@ SIMD_FORCE_INLINE void btMatrix3x3::serialize(struct btMatrix3x3Data& dataOut) c
m_el[i].serialize(dataOut.m_el[i]);
}
SIMD_FORCE_INLINE void btMatrix3x3::deSerialize(const struct btMatrix3x3Data& dataIn)
{
for (int i=0;i<3;i++)
m_el[i].deSerialize(dataIn.m_el[i]);
}
SIMD_FORCE_INLINE void btMatrix3x3::deSerializeFloat(const struct btMatrix3x3FloatData& dataIn)
{
for (int i=0;i<3;i++)
m_el[i].deSerializeFloat(dataIn.m_el[i]);
}
SIMD_FORCE_INLINE void btMatrix3x3::deSerializeDouble(const struct btMatrix3x3DoubleData& dataIn)
{
for (int i=0;i<3;i++)
m_el[i].deSerializeDouble(dataIn.m_el[i]);
}
#endif //BT_MATRIX3x3_H

View File

@@ -1,5 +1,6 @@
unsigned char sBulletDNAstr[]= {
83,68,78,65,78,65,77,69,83,0,0,0,109,95,115,105,122,101,0,109,
unsigned char sBulletDNAstr64[]= {
83,68,78,65,78,65,77,69,85,0,0,0,109,95,115,105,122,101,0,109,
95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
@@ -12,115 +13,275 @@ unsigned char sBulletDNAstr[]= {
109,95,108,111,99,97,108,83,99,97,108,105,110,103,0,109,95,105,109,112,
108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
95,112,111,115,0,109,95,114,97,100,105,117,115,0,109,95,99,111,110,118,
101,120,73,110,116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,
42,109,95,108,111,99,97,108,80,111,115,105,116,105,111,110,65,114,114,97,
121,80,116,114,0,109,95,108,111,99,97,108,80,111,115,105,116,105,111,110,
65,114,114,97,121,83,105,122,101,0,109,95,118,97,108,117,101,0,105,110,
116,0,42,109,95,118,101,114,116,105,99,101,115,51,102,0,42,109,95,118,
101,114,116,105,99,101,115,51,100,0,42,109,95,105,110,100,105,99,101,115,
51,50,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,117,
109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,116,
105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,114,
0,109,95,110,117,109,77,101,115,104,80,97,114,116,115,0,109,95,115,99,
97,108,105,110,103,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,
112,101,68,97,116,97,0,109,95,109,101,115,104,73,110,116,101,114,102,97,
99,101,0,42,109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,
80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,111,105,
110,116,115,0,109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,
0,109,95,105,110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,
100,84,114,97,110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,
108,97,116,105,111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,
0,109,95,105,110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,
108,97,114,86,101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,
114,111,112,105,99,70,114,105,99,116,105,111,110,0,109,95,104,97,115,65,
110,105,115,111,116,114,111,112,105,99,70,114,105,99,116,105,111,110,0,109,
95,99,111,110,116,97,99,116,80,114,111,99,101,115,115,105,110,103,84,104,
114,101,115,104,111,108,100,0,42,109,95,98,114,111,97,100,112,104,97,115,
101,72,97,110,100,108,101,0,42,109,95,99,111,108,108,105,115,105,111,110,
83,104,97,112,101,0,42,109,95,114,111,111,116,67,111,108,108,105,115,105,
111,110,83,104,97,112,101,0,109,95,99,111,108,108,105,115,105,111,110,70,
108,97,103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,
99,111,109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,
116,105,111,110,83,116,97,116,101,49,0,109,95,100,101,97,99,116,105,118,
97,116,105,111,110,84,105,109,101,0,109,95,102,114,105,99,116,105,111,110,
0,109,95,114,101,115,116,105,116,117,116,105,111,110,0,109,95,105,110,116,
101,114,110,97,108,84,121,112,101,0,42,109,95,117,115,101,114,79,98,106,
101,99,116,80,111,105,110,116,101,114,0,109,95,104,105,116,70,114,97,99,
116,105,111,110,0,109,95,99,99,100,83,119,101,112,116,83,112,104,101,114,
101,82,97,100,105,117,115,0,109,95,99,99,100,77,111,116,105,111,110,84,
104,114,101,115,104,111,108,100,0,109,95,99,104,101,99,107,67,111,108,108,
105,100,101,87,105,116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,
98,106,101,99,116,68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,
105,97,84,101,110,115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,
97,114,86,101,108,111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,
86,101,108,111,99,105,116,121,0,109,95,105,110,118,101,114,115,101,77,97,
115,115,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,109,
95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,118,
105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,101,
114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,76,
111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,95,
116,111,116,97,108,84,111,114,113,117,101,0,109,95,108,105,110,101,97,114,
68,97,109,112,105,110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,
112,105,110,103,0,109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,
112,105,110,103,0,109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,
112,105,110,103,70,97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,
110,97,108,76,105,110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,
115,104,111,108,100,83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,
108,65,110,103,117,108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,
104,111,108,100,83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,
65,110,103,117,108,97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,
0,109,95,108,105,110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,
101,115,104,111,108,100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,
112,105,110,103,84,104,114,101,115,104,111,108,100,0,0,0,84,89,80,69,
32,0,0,0,99,104,97,114,0,117,99,104,97,114,0,115,104,111,114,116,
0,117,115,104,111,114,116,0,105,110,116,0,108,111,110,103,0,117,108,111,
110,103,0,102,108,111,97,116,0,100,111,117,98,108,101,0,118,111,105,100,
0,98,116,83,99,97,108,97,114,0,80,111,105,110,116,101,114,65,114,114,
97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,109,0,76,
105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,68,97,116,
97,0,98,116,86,101,99,116,111,114,51,70,108,111,97,116,68,97,116,97,
0,98,116,86,101,99,116,111,114,51,68,111,117,98,108,101,68,97,116,97,
0,98,116,77,97,116,114,105,120,51,120,51,68,97,116,97,0,98,116,84,
114,97,110,115,102,111,114,109,68,97,116,97,0,98,116,67,111,108,108,105,
115,105,111,110,83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,
101,120,73,110,116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,
98,116,80,111,115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,
98,116,77,117,108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,
116,97,0,98,116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,
83,104,111,114,116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,
77,101,115,104,80,97,114,116,68,97,116,97,0,98,116,83,116,114,105,100,
105,110,103,77,101,115,104,73,110,116,101,114,102,97,99,101,68,97,116,97,
0,98,116,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,
68,97,116,97,0,109,95,99,111,110,99,97,118,101,83,104,97,112,101,68,
97,116,97,59,0,98,116,67,111,110,118,101,120,72,117,108,108,83,104,97,
112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,79,98,
106,101,99,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
68,97,116,97,0,0,0,0,84,76,69,78,1,0,1,0,2,0,2,0,
4,0,4,0,4,0,4,0,8,0,0,0,4,0,12,0,36,0,8,0,
16,0,16,0,32,0,48,0,64,0,12,0,52,0,20,0,64,0,4,0,
4,0,24,0,28,0,0,0,0,0,64,0,-8,0,-32,1,83,84,82,67,
20,0,0,0,11,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,
12,0,3,0,11,0,3,0,11,0,4,0,11,0,5,0,13,0,2,0,
9,0,6,0,9,0,7,0,14,0,1,0,10,0,8,0,15,0,1,0,
7,0,8,0,16,0,1,0,8,0,8,0,17,0,1,0,14,0,9,0,
18,0,2,0,17,0,10,0,14,0,11,0,19,0,3,0,9,0,12,0,
4,0,13,0,0,0,14,0,20,0,5,0,19,0,15,0,14,0,16,0,
14,0,17,0,10,0,18,0,0,0,14,0,21,0,2,0,14,0,19,0,
10,0,20,0,22,0,4,0,20,0,21,0,21,0,22,0,4,0,23,0,
0,0,14,0,23,0,1,0,4,0,24,0,24,0,2,0,2,0,25,0,
2,0,24,0,25,0,6,0,15,0,26,0,16,0,27,0,23,0,28,0,
24,0,29,0,4,0,30,0,4,0,31,0,26,0,4,0,25,0,32,0,
4,0,33,0,14,0,34,0,0,0,14,0,27,0,4,0,28,0,35,0,
28,0,15,0,26,0,36,0,10,0,18,0,29,0,4,0,20,0,21,0,
14,0,37,0,4,0,38,0,0,0,14,0,30,0,23,0,18,0,39,0,
18,0,40,0,14,0,41,0,14,0,42,0,14,0,43,0,4,0,44,0,
10,0,45,0,9,0,46,0,9,0,47,0,19,0,48,0,4,0,49,0,
4,0,50,0,4,0,51,0,4,0,52,0,10,0,53,0,10,0,54,0,
10,0,55,0,4,0,56,0,9,0,57,0,10,0,58,0,10,0,59,0,
10,0,60,0,4,0,61,0,31,0,21,0,30,0,62,0,17,0,63,0,
14,0,64,0,14,0,65,0,10,0,66,0,14,0,67,0,14,0,68,0,
14,0,69,0,14,0,70,0,14,0,71,0,14,0,72,0,14,0,73,0,
10,0,74,0,10,0,75,0,4,0,76,0,10,0,77,0,10,0,78,0,
10,0,79,0,10,0,80,0,10,0,81,0,10,0,82,0,};
95,112,97,100,100,105,110,103,0,109,95,112,111,115,0,109,95,114,97,100,
105,117,115,0,109,95,99,111,110,118,101,120,73,110,116,101,114,110,97,108,
83,104,97,112,101,68,97,116,97,0,42,109,95,108,111,99,97,108,80,111,
115,105,116,105,111,110,65,114,114,97,121,80,116,114,0,109,95,108,111,99,
97,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0,
109,95,118,97,108,117,101,0,105,110,116,0,42,109,95,118,101,114,116,105,
99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115,51,100,0,
42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,105,110,100,105,
99,101,115,49,54,0,109,95,110,117,109,84,114,105,97,110,103,108,101,115,
0,109,95,110,117,109,86,101,114,116,105,99,101,115,0,42,109,95,109,101,
115,104,80,97,114,116,115,80,116,114,0,109,95,115,99,97,108,105,110,103,
0,109,95,110,117,109,77,101,115,104,80,97,114,116,115,0,109,95,109,101,
115,104,73,110,116,101,114,102,97,99,101,0,42,109,95,117,110,115,99,97,
108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42,109,
95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98,108,
101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,111,
105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0,42,
109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0,42,
109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109,95,
114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,
109,95,117,115,101,114,79,98,106,101,99,116,80,111,105,110,116,101,114,0,
109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,
110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,
110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,
111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,
110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,
101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,
99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80,
114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109,
95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,
102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,
111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99,
99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0,
109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100,
0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,
99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,
103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,
109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,
111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84,
121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,
109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,
118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,
101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,
76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,
95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114,
115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97,
108,68,97,109,112,105,110,103,0,0,0,0,84,89,80,69,33,0,0,0,
99,104,97,114,0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,
111,114,116,0,105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,
108,111,97,116,0,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,
110,116,101,114,65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,
121,115,116,101,109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,
116,111,114,51,70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,
111,114,51,68,111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,
105,120,51,120,51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,
114,105,120,51,120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,
114,97,110,115,102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,
84,114,97,110,115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,
98,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,68,97,116,97,
0,98,116,67,111,110,118,101,120,73,110,116,101,114,110,97,108,83,104,97,
112,101,68,97,116,97,0,98,116,80,111,115,105,116,105,111,110,65,110,100,
82,97,100,105,117,115,0,98,116,77,117,108,116,105,83,112,104,101,114,101,
83,104,97,112,101,68,97,116,97,0,98,116,73,110,116,73,110,100,101,120,
68,97,116,97,0,98,116,83,104,111,114,116,73,110,116,73,110,100,101,120,
68,97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,
98,116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,
97,99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,
115,104,83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,
72,117,108,108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,
105,115,105,111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,
97,0,98,116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,
108,111,97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
70,108,111,97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,
121,68,111,117,98,108,101,68,97,116,97,0,84,76,69,78,1,0,1,0,
2,0,2,0,4,0,4,0,4,0,4,0,8,0,0,0,16,0,48,0,
16,0,16,0,32,0,48,0,96,0,64,0,-128,0,16,0,56,0,20,0,
72,0,4,0,4,0,40,0,32,0,56,0,80,0,-40,1,8,1,-16,1,
-88,3,0,0,83,84,82,67,23,0,0,0,10,0,3,0,4,0,0,0,
4,0,1,0,9,0,2,0,11,0,3,0,10,0,3,0,10,0,4,0,
10,0,5,0,12,0,2,0,9,0,6,0,9,0,7,0,13,0,1,0,
7,0,8,0,14,0,1,0,8,0,8,0,15,0,1,0,13,0,9,0,
16,0,1,0,14,0,9,0,17,0,2,0,15,0,10,0,13,0,11,0,
18,0,2,0,16,0,10,0,14,0,11,0,19,0,3,0,9,0,12,0,
4,0,13,0,0,0,14,0,20,0,5,0,19,0,15,0,13,0,16,0,
13,0,17,0,7,0,18,0,4,0,19,0,21,0,2,0,13,0,20,0,
7,0,21,0,22,0,4,0,20,0,22,0,21,0,23,0,4,0,24,0,
0,0,14,0,23,0,1,0,4,0,25,0,24,0,2,0,2,0,26,0,
2,0,25,0,25,0,6,0,13,0,27,0,14,0,28,0,23,0,29,0,
24,0,30,0,4,0,31,0,4,0,32,0,26,0,4,0,25,0,33,0,
13,0,34,0,4,0,35,0,0,0,14,0,27,0,4,0,19,0,15,0,
26,0,36,0,7,0,18,0,0,0,14,0,28,0,5,0,20,0,22,0,
13,0,37,0,14,0,38,0,4,0,39,0,0,0,40,0,29,0,24,0,
9,0,41,0,9,0,42,0,19,0,43,0,9,0,44,0,18,0,45,0,
18,0,46,0,14,0,47,0,14,0,48,0,14,0,49,0,8,0,50,0,
8,0,51,0,8,0,52,0,8,0,53,0,8,0,54,0,8,0,55,0,
8,0,56,0,4,0,57,0,4,0,58,0,4,0,59,0,4,0,60,0,
4,0,61,0,4,0,62,0,4,0,63,0,0,0,14,0,30,0,23,0,
9,0,41,0,9,0,42,0,19,0,43,0,9,0,44,0,17,0,45,0,
17,0,46,0,13,0,47,0,13,0,48,0,13,0,49,0,7,0,50,0,
7,0,51,0,7,0,52,0,7,0,53,0,7,0,54,0,7,0,55,0,
7,0,56,0,4,0,57,0,4,0,58,0,4,0,59,0,4,0,60,0,
4,0,61,0,4,0,62,0,4,0,63,0,31,0,21,0,30,0,64,0,
15,0,65,0,13,0,66,0,13,0,67,0,13,0,68,0,13,0,69,0,
13,0,70,0,13,0,71,0,13,0,72,0,13,0,73,0,13,0,74,0,
7,0,75,0,7,0,76,0,7,0,77,0,7,0,78,0,7,0,79,0,
7,0,80,0,7,0,81,0,7,0,82,0,7,0,83,0,4,0,84,0,
32,0,22,0,29,0,64,0,16,0,65,0,14,0,66,0,14,0,67,0,
14,0,68,0,14,0,69,0,14,0,70,0,14,0,71,0,14,0,72,0,
14,0,73,0,14,0,74,0,8,0,75,0,8,0,76,0,8,0,77,0,
8,0,78,0,8,0,79,0,8,0,80,0,8,0,81,0,8,0,82,0,
8,0,83,0,4,0,84,0,0,0,14,0,};
int sBulletDNAlen64= sizeof(sBulletDNAstr64);
unsigned char sBulletDNAstr[]= {
83,68,78,65,78,65,77,69,85,0,0,0,109,95,115,105,122,101,0,109,
95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
115,116,114,97,105,110,116,115,0,42,102,105,114,115,116,0,42,108,97,115,
116,0,109,95,102,108,111,97,116,115,91,52,93,0,109,95,101,108,91,51,
93,0,109,95,98,97,115,105,115,0,109,95,111,114,105,103,105,110,0,42,
109,95,117,115,101,114,80,111,105,110,116,101,114,0,109,95,115,104,97,112,
101,84,121,112,101,0,109,95,112,97,100,100,105,110,103,91,52,93,0,109,
95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,68,97,116,97,0,
109,95,108,111,99,97,108,83,99,97,108,105,110,103,0,109,95,105,109,112,
108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
95,112,97,100,100,105,110,103,0,109,95,112,111,115,0,109,95,114,97,100,
105,117,115,0,109,95,99,111,110,118,101,120,73,110,116,101,114,110,97,108,
83,104,97,112,101,68,97,116,97,0,42,109,95,108,111,99,97,108,80,111,
115,105,116,105,111,110,65,114,114,97,121,80,116,114,0,109,95,108,111,99,
97,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0,
109,95,118,97,108,117,101,0,105,110,116,0,42,109,95,118,101,114,116,105,
99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115,51,100,0,
42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,105,110,100,105,
99,101,115,49,54,0,109,95,110,117,109,84,114,105,97,110,103,108,101,115,
0,109,95,110,117,109,86,101,114,116,105,99,101,115,0,42,109,95,109,101,
115,104,80,97,114,116,115,80,116,114,0,109,95,115,99,97,108,105,110,103,
0,109,95,110,117,109,77,101,115,104,80,97,114,116,115,0,109,95,109,101,
115,104,73,110,116,101,114,102,97,99,101,0,42,109,95,117,110,115,99,97,
108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42,109,
95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98,108,
101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,111,
105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0,42,
109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0,42,
109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109,95,
114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,
109,95,117,115,101,114,79,98,106,101,99,116,80,111,105,110,116,101,114,0,
109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,
110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,
110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,
111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,
110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,
101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,
99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80,
114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109,
95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,
102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,
111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99,
99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0,
109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100,
0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,
99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,
103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,
109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,
111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84,
121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,
109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,
118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,
101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,
76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,
95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114,
115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97,
108,68,97,109,112,105,110,103,0,0,0,0,84,89,80,69,33,0,0,0,
99,104,97,114,0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,
111,114,116,0,105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,
108,111,97,116,0,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,
110,116,101,114,65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,
121,115,116,101,109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,
116,111,114,51,70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,
111,114,51,68,111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,
105,120,51,120,51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,
114,105,120,51,120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,
114,97,110,115,102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,
84,114,97,110,115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,
98,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,68,97,116,97,
0,98,116,67,111,110,118,101,120,73,110,116,101,114,110,97,108,83,104,97,
112,101,68,97,116,97,0,98,116,80,111,115,105,116,105,111,110,65,110,100,
82,97,100,105,117,115,0,98,116,77,117,108,116,105,83,112,104,101,114,101,
83,104,97,112,101,68,97,116,97,0,98,116,73,110,116,73,110,100,101,120,
68,97,116,97,0,98,116,83,104,111,114,116,73,110,116,73,110,100,101,120,
68,97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,
98,116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,
97,99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,
115,104,83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,
72,117,108,108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,
105,115,105,111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,
97,0,98,116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,
108,111,97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
70,108,111,97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,
121,68,111,117,98,108,101,68,97,116,97,0,84,76,69,78,1,0,1,0,
2,0,2,0,4,0,4,0,4,0,4,0,8,0,0,0,12,0,36,0,
8,0,16,0,32,0,48,0,96,0,64,0,-128,0,12,0,52,0,20,0,
64,0,4,0,4,0,24,0,28,0,48,0,68,0,-56,1,-8,0,-32,1,
-104,3,0,0,83,84,82,67,23,0,0,0,10,0,3,0,4,0,0,0,
4,0,1,0,9,0,2,0,11,0,3,0,10,0,3,0,10,0,4,0,
10,0,5,0,12,0,2,0,9,0,6,0,9,0,7,0,13,0,1,0,
7,0,8,0,14,0,1,0,8,0,8,0,15,0,1,0,13,0,9,0,
16,0,1,0,14,0,9,0,17,0,2,0,15,0,10,0,13,0,11,0,
18,0,2,0,16,0,10,0,14,0,11,0,19,0,3,0,9,0,12,0,
4,0,13,0,0,0,14,0,20,0,5,0,19,0,15,0,13,0,16,0,
13,0,17,0,7,0,18,0,4,0,19,0,21,0,2,0,13,0,20,0,
7,0,21,0,22,0,4,0,20,0,22,0,21,0,23,0,4,0,24,0,
0,0,14,0,23,0,1,0,4,0,25,0,24,0,2,0,2,0,26,0,
2,0,25,0,25,0,6,0,13,0,27,0,14,0,28,0,23,0,29,0,
24,0,30,0,4,0,31,0,4,0,32,0,26,0,4,0,25,0,33,0,
13,0,34,0,4,0,35,0,0,0,14,0,27,0,4,0,19,0,15,0,
26,0,36,0,7,0,18,0,0,0,14,0,28,0,5,0,20,0,22,0,
13,0,37,0,14,0,38,0,4,0,39,0,0,0,40,0,29,0,24,0,
9,0,41,0,9,0,42,0,19,0,43,0,9,0,44,0,18,0,45,0,
18,0,46,0,14,0,47,0,14,0,48,0,14,0,49,0,8,0,50,0,
8,0,51,0,8,0,52,0,8,0,53,0,8,0,54,0,8,0,55,0,
8,0,56,0,4,0,57,0,4,0,58,0,4,0,59,0,4,0,60,0,
4,0,61,0,4,0,62,0,4,0,63,0,0,0,14,0,30,0,23,0,
9,0,41,0,9,0,42,0,19,0,43,0,9,0,44,0,17,0,45,0,
17,0,46,0,13,0,47,0,13,0,48,0,13,0,49,0,7,0,50,0,
7,0,51,0,7,0,52,0,7,0,53,0,7,0,54,0,7,0,55,0,
7,0,56,0,4,0,57,0,4,0,58,0,4,0,59,0,4,0,60,0,
4,0,61,0,4,0,62,0,4,0,63,0,31,0,21,0,30,0,64,0,
15,0,65,0,13,0,66,0,13,0,67,0,13,0,68,0,13,0,69,0,
13,0,70,0,13,0,71,0,13,0,72,0,13,0,73,0,13,0,74,0,
7,0,75,0,7,0,76,0,7,0,77,0,7,0,78,0,7,0,79,0,
7,0,80,0,7,0,81,0,7,0,82,0,7,0,83,0,4,0,84,0,
32,0,22,0,29,0,64,0,16,0,65,0,14,0,66,0,14,0,67,0,
14,0,68,0,14,0,69,0,14,0,70,0,14,0,71,0,14,0,72,0,
14,0,73,0,14,0,74,0,8,0,75,0,8,0,76,0,8,0,77,0,
8,0,78,0,8,0,79,0,8,0,80,0,8,0,81,0,8,0,82,0,
8,0,83,0,4,0,84,0,0,0,14,0,};
int sBulletDNAlen= sizeof(sBulletDNAstr);

View File

@@ -23,9 +23,14 @@ subject to the following restrictions:
#include <string.h>
///only the 32bit versions for now
extern unsigned char sBulletDNAstr[];
extern int sBulletDNAlen;
extern unsigned char sBulletDNAstr64[];
extern int sBulletDNAlen64;
class btChunk
{
@@ -263,12 +268,18 @@ public:
if (VOID_IS_8)
{
//64bit not yet supported (soon)
btAssert(0);
return;
//#if _WIN64
initDNA((const char*)sBulletDNAstr64,sBulletDNAlen64);
//#else
// btAssert(0);
//#endif
} else
{
//#ifndef _WIN64
initDNA((const char*)sBulletDNAstr,sBulletDNAlen);
//#else
// btAssert(0);
//#endif
}
}
@@ -282,28 +293,35 @@ public:
{
m_currentSize = BT_HEADER_LENGTH;
memcpy(m_buffer, "BULLET ", 7);
int endian= 1;
endian= ((char*)&endian)[0];
#ifdef BT_USE_DOUBLE_PRECISION
memcpy(m_buffer, "BULLETd", 7);
#else
memcpy(m_buffer, "BULLETf", 7);
#endif //BT_USE_DOUBLE_PRECISION
int littleEndian= 1;
littleEndian= ((char*)&littleEndian)[0];
if (endian)
{
m_buffer[7] = '_';
} else
{
m_buffer[7] = '-';
}
if (sizeof(void*)==8)
{
m_buffer[8]='V';
m_buffer[7] = '-';
} else
{
m_buffer[8]='v';
m_buffer[7] = '_';
}
if (littleEndian)
{
m_buffer[8]='v';
} else
{
m_buffer[8]='V';
}
m_buffer[9] = '2';
m_buffer[10] = '7';
m_buffer[11] = '5';
m_buffer[11] = '6';
}
@@ -327,6 +345,7 @@ public:
virtual void finalizeChunk(btChunk* chunk, const char* structType, int chunkCode,void* oldPtr) const
{
chunk->m_dna_nr = getReverseType(structType);
chunk->m_chunkCode = chunkCode;
chunk->m_oldPtr = oldPtr;
}
@@ -339,14 +358,14 @@ public:
{
unsigned char* ptr = m_buffer+m_currentSize;
m_currentSize += size*numElements+sizeof(btChunk);
m_currentSize += int(size)*numElements+sizeof(btChunk);
unsigned char* data = ptr + sizeof(btChunk);
btChunk* chunk = (btChunk*)ptr;
chunk->m_chunkCode = 0;
chunk->m_oldPtr = data;
chunk->m_length = size*numElements;
chunk->m_length = int(size)*numElements;
chunk->m_number = numElements;
m_chunkPtrs.push_back(chunk);

View File

@@ -20,6 +20,13 @@ subject to the following restrictions:
#include "btMatrix3x3.h"
#ifdef BT_USE_DOUBLE_PRECISION
#define btTransformData btTransformDoubleData
#else
#define btTransformData btTransformFloatData
#endif
/**@brief The btTransform class supports rigid transforms with only translation and rotation and no scaling/shear.
@@ -205,6 +212,10 @@ public:
void deSerialize(const struct btTransformData& dataIn);
void deSerializeDouble(const struct btTransformDoubleData& dataIn);
void deSerializeFloat(const struct btTransformFloatData& dataIn);
};
@@ -237,13 +248,22 @@ SIMD_FORCE_INLINE bool operator==(const btTransform& t1, const btTransform& t2)
t1.getOrigin() == t2.getOrigin() );
}
///for serialization
struct btTransformData
struct btTransformFloatData
{
btMatrix3x3Data m_basis;
btVector3Data m_origin;
btMatrix3x3FloatData m_basis;
btVector3FloatData m_origin;
};
struct btTransformDoubleData
{
btMatrix3x3DoubleData m_basis;
btVector3DoubleData m_origin;
};
SIMD_FORCE_INLINE void btTransform::serialize(btTransformData& dataOut) const
{
m_basis.serialize(dataOut.m_basis);
@@ -256,6 +276,19 @@ SIMD_FORCE_INLINE void btTransform::deSerialize(const btTransformData& dataIn)
m_origin.deSerialize(dataIn.m_origin);
}
SIMD_FORCE_INLINE void btTransform::deSerializeFloat(const btTransformFloatData& dataIn)
{
m_basis.deSerializeFloat(dataIn.m_basis);
m_origin.deSerializeFloat(dataIn.m_origin);
}
SIMD_FORCE_INLINE void btTransform::deSerializeDouble(const btTransformDoubleData& dataIn)
{
m_basis.deSerializeDouble(dataIn.m_basis);
m_origin.deSerializeDouble(dataIn.m_origin);
}
#endif

View File

@@ -21,6 +21,14 @@ subject to the following restrictions:
#include "btScalar.h"
#include "btMinMax.h"
#ifdef BT_USE_DOUBLE_PRECISION
#define btVector3Data btVector3DoubleData
#define btVector3DataName "btVector3DoubleData"
#else
#define btVector3Data btVector3FloatData
#define btVector3DataName "btVector3FloatData"
#endif //BT_USE_DOUBLE_PRECISION
@@ -330,10 +338,18 @@ public:
return length2() < SIMD_EPSILON;
}
SIMD_FORCE_INLINE void serialize(struct btVector3Data& dataOut) const;
SIMD_FORCE_INLINE void deSerialize(const struct btVector3Data& dataIn);
SIMD_FORCE_INLINE void serializeFloat(struct btVector3FloatData& dataOut) const;
SIMD_FORCE_INLINE void deSerializeFloat(const struct btVector3FloatData& dataIn);
SIMD_FORCE_INLINE void serializeDouble(struct btVector3DoubleData& dataOut) const;
SIMD_FORCE_INLINE void deSerializeDouble(const struct btVector3DoubleData& dataIn);
};
/**@brief Return the sum of two vectors (Point symantics)*/
@@ -671,10 +687,6 @@ SIMD_FORCE_INLINE void btPlaneSpace1 (const btVector3& n, btVector3& p, btVector
}
}
struct btVector3Data
{
btScalar m_floats[4];
};
struct btVector3FloatData
{
@@ -684,8 +696,37 @@ struct btVector3FloatData
struct btVector3DoubleData
{
double m_floats[4];
};
SIMD_FORCE_INLINE void btVector3::serializeFloat(struct btVector3FloatData& dataOut) const
{
///could also do a memcpy, check if it is worth it
for (int i=0;i<4;i++)
dataOut.m_floats[i] = float(m_floats[i]);
}
SIMD_FORCE_INLINE void btVector3::deSerializeFloat(const struct btVector3FloatData& dataIn)
{
for (int i=0;i<4;i++)
m_floats[i] = btScalar(dataIn.m_floats[i]);
}
SIMD_FORCE_INLINE void btVector3::serializeDouble(struct btVector3DoubleData& dataOut) const
{
///could also do a memcpy, check if it is worth it
for (int i=0;i<4;i++)
dataOut.m_floats[i] = double(m_floats[i]);
}
SIMD_FORCE_INLINE void btVector3::deSerializeDouble(const struct btVector3DoubleData& dataIn)
{
for (int i=0;i<4;i++)
m_floats[i] = btScalar(dataIn.m_floats[i]);
}
SIMD_FORCE_INLINE void btVector3::serialize(struct btVector3Data& dataOut) const
{
///could also do a memcpy, check if it is worth it