Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergej Reich <sergej.reich@googlemail.com>2013-11-23 20:17:12 +0400
committerSergej Reich <sergej.reich@googlemail.com>2013-11-23 20:17:12 +0400
commit39dc956f593b3406bf1d81fb83c557b7b51f5327 (patch)
tree50b59815aad48902a6563aefc8b944daf34c401e /extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
parent5d5176095e82b34499e15d74f1fb76d56f4d9508 (diff)
parentd846c9a3b75c3d6f20bc7ab7d2da6cdd18bbbef2 (diff)
Merge branch 'master' into soc-2013-rigid_body_simsoc-2013-rigid_body_sim
Conflicts: intern/rigidbody/CMakeLists.txt release/datafiles/splash.png source/blender/editors/space_view3d/drawobject.c source/blender/makesdna/DNA_view3d_types.h
Diffstat (limited to 'extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h')
-rw-r--r--extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h64
1 files changed, 48 insertions, 16 deletions
diff --git a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
index 09c048beda8..1735b524dba 100644
--- a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
+++ b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
@@ -40,6 +40,15 @@ and swing 1 and 2 are along the z and y axes respectively.
#include "btJacobianEntry.h"
#include "btTypedConstraint.h"
+#ifdef BT_USE_DOUBLE_PRECISION
+#define btConeTwistConstraintData2 btConeTwistConstraintDoubleData
+#define btConeTwistConstraintDataName "btConeTwistConstraintDoubleData"
+#else
+#define btConeTwistConstraintData2 btConeTwistConstraintData
+#define btConeTwistConstraintDataName "btConeTwistConstraintData"
+#endif //BT_USE_DOUBLE_PRECISION
+
+
class btRigidBody;
enum btConeTwistFlags
@@ -295,7 +304,30 @@ public:
};
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+
+
+struct btConeTwistConstraintDoubleData
+{
+ btTypedConstraintDoubleData m_typeConstraintData;
+ btTransformDoubleData m_rbAFrame;
+ btTransformDoubleData m_rbBFrame;
+
+ //limits
+ double m_swingSpan1;
+ double m_swingSpan2;
+ double m_twistSpan;
+ double m_limitSoftness;
+ double m_biasFactor;
+ double m_relaxationFactor;
+
+ double m_damping;
+
+
+
+};
+
+#ifdef BT_BACKWARDS_COMPATIBLE_SERIALIZATION
+///this structure is not used, except for loading pre-2.82 .bullet files
struct btConeTwistConstraintData
{
btTypedConstraintData m_typeConstraintData;
@@ -315,12 +347,12 @@ struct btConeTwistConstraintData
char m_pad[4];
};
-
-
+#endif //BT_BACKWARDS_COMPATIBLE_SERIALIZATION
+//
SIMD_FORCE_INLINE int btConeTwistConstraint::calculateSerializeBufferSize() const
{
- return sizeof(btConeTwistConstraintData);
+ return sizeof(btConeTwistConstraintData2);
}
@@ -328,21 +360,21 @@ SIMD_FORCE_INLINE int btConeTwistConstraint::calculateSerializeBufferSize() cons
///fills the dataBuffer and returns the struct name (and 0 on failure)
SIMD_FORCE_INLINE const char* btConeTwistConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
{
- btConeTwistConstraintData* cone = (btConeTwistConstraintData*) dataBuffer;
+ btConeTwistConstraintData2* cone = (btConeTwistConstraintData2*) dataBuffer;
btTypedConstraint::serialize(&cone->m_typeConstraintData,serializer);
- m_rbAFrame.serializeFloat(cone->m_rbAFrame);
- m_rbBFrame.serializeFloat(cone->m_rbBFrame);
+ m_rbAFrame.serialize(cone->m_rbAFrame);
+ m_rbBFrame.serialize(cone->m_rbBFrame);
- cone->m_swingSpan1 = float(m_swingSpan1);
- cone->m_swingSpan2 = float(m_swingSpan2);
- cone->m_twistSpan = float(m_twistSpan);
- cone->m_limitSoftness = float(m_limitSoftness);
- cone->m_biasFactor = float(m_biasFactor);
- cone->m_relaxationFactor = float(m_relaxationFactor);
- cone->m_damping = float(m_damping);
-
- return "btConeTwistConstraintData";
+ cone->m_swingSpan1 = m_swingSpan1;
+ cone->m_swingSpan2 = m_swingSpan2;
+ cone->m_twistSpan = m_twistSpan;
+ cone->m_limitSoftness = m_limitSoftness;
+ cone->m_biasFactor = m_biasFactor;
+ cone->m_relaxationFactor = m_relaxationFactor;
+ cone->m_damping = m_damping;
+
+ return btConeTwistConstraintDataName;
}