summaryrefslogtreecommitdiff
path: root/thirdparty/bullet/LinearMath/btVector3.h
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/bullet/LinearMath/btVector3.h')
-rw-r--r--thirdparty/bullet/LinearMath/btVector3.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/thirdparty/bullet/LinearMath/btVector3.h b/thirdparty/bullet/LinearMath/btVector3.h
index c69effa96e..76024f1236 100644
--- a/thirdparty/bullet/LinearMath/btVector3.h
+++ b/thirdparty/bullet/LinearMath/btVector3.h
@@ -705,7 +705,9 @@ public:
SIMD_FORCE_INLINE void serialize(struct btVector3Data& dataOut) const;
- SIMD_FORCE_INLINE void deSerialize(const struct btVector3Data& dataIn);
+ SIMD_FORCE_INLINE void deSerialize(const struct btVector3DoubleData& dataIn);
+
+ SIMD_FORCE_INLINE void deSerialize(const struct btVector3FloatData& dataIn);
SIMD_FORCE_INLINE void serializeFloat(struct btVector3FloatData& dataOut) const;
@@ -1236,9 +1238,9 @@ public:
///btSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization
SIMD_FORCE_INLINE void btSwapScalarEndian(const btScalar& sourceVal, btScalar& destVal)
{
- #ifdef BT_USE_DOUBLE_PRECISION
+#ifdef BT_USE_DOUBLE_PRECISION
unsigned char* dest = (unsigned char*) &destVal;
- unsigned char* src = (unsigned char*) &sourceVal;
+ const unsigned char* src = (const unsigned char*) &sourceVal;
dest[0] = src[7];
dest[1] = src[6];
dest[2] = src[5];
@@ -1249,7 +1251,7 @@ SIMD_FORCE_INLINE void btSwapScalarEndian(const btScalar& sourceVal, btScalar& d
dest[7] = src[0];
#else
unsigned char* dest = (unsigned char*) &destVal;
- unsigned char* src = (unsigned char*) &sourceVal;
+ const unsigned char* src = (const unsigned char*) &sourceVal;
dest[0] = src[3];
dest[1] = src[2];
dest[2] = src[1];
@@ -1354,10 +1356,18 @@ SIMD_FORCE_INLINE void btVector3::serialize(struct btVector3Data& dataOut) const
dataOut.m_floats[i] = m_floats[i];
}
-SIMD_FORCE_INLINE void btVector3::deSerialize(const struct btVector3Data& dataIn)
+
+SIMD_FORCE_INLINE void btVector3::deSerialize(const struct btVector3FloatData& dataIn)
+{
+ for (int i = 0; i<4; i++)
+ m_floats[i] = (btScalar)dataIn.m_floats[i];
+}
+
+
+SIMD_FORCE_INLINE void btVector3::deSerialize(const struct btVector3DoubleData& dataIn)
{
for (int i=0;i<4;i++)
- m_floats[i] = dataIn.m_floats[i];
+ m_floats[i] = (btScalar)dataIn.m_floats[i];
}
#endif //BT_VECTOR3_H