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:
Diffstat (limited to 'source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp')
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index 7dfdb67d2c6..171f13e9b9f 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -1457,7 +1457,7 @@ struct OcclusionBuffer
const float face,
const btScalar minarea)
{
- const btScalar a2=cross(b-a,c-a)[2];
+ const btScalar a2=btCross(b-a,c-a)[2];
if((face*a2)<0.f || btFabs(a2)<minarea)
return false;
// further down we are normally going to write to the Zbuffer, mark it so
@@ -2793,3 +2793,17 @@ float CcdPhysicsEnvironment::getAppliedImpulse(int constraintid)
return 0.f;
}
+
+void CcdPhysicsEnvironment::exportFile(const char* filename)
+{
+ btDefaultSerializer* serializer = new btDefaultSerializer();
+ m_dynamicsWorld->serialize(serializer);
+
+ FILE* file = fopen(filename,"wb");
+ if (file)
+ {
+ fwrite(serializer->getBufferPointer(),serializer->getCurrentBufferSize(),1, file);
+ fclose(file);
+ }
+}
+