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:
authorJoseph Eagar <joeedh@gmail.com>2011-02-27 09:19:40 +0300
committerJoseph Eagar <joeedh@gmail.com>2011-02-27 09:19:40 +0300
commitf01261d040be27337db9f9996d648a279c89b7c4 (patch)
treec448230939b3c90d53ce8852dd00925d6052e3a4 /source/gameengine/Physics/Bullet
parentdcaeda5c4e3a0687251b8511de4f2e8b85ef75c0 (diff)
parent2198cfdb2deec8b2e85e242c74a032f43d0b26ca (diff)
merge with/from trunk at r35190
Diffstat (limited to 'source/gameengine/Physics/Bullet')
-rw-r--r--source/gameengine/Physics/Bullet/CMakeLists.txt23
-rw-r--r--source/gameengine/Physics/Bullet/CcdGraphicController.cpp3
-rw-r--r--source/gameengine/Physics/Bullet/CcdGraphicController.h4
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.cpp21
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsController.h4
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp8
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h14
-rw-r--r--source/gameengine/Physics/Bullet/Makefile55
-rw-r--r--source/gameengine/Physics/Bullet/SConscript13
9 files changed, 74 insertions, 71 deletions
diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt
index 95888967b78..c677685de49 100644
--- a/source/gameengine/Physics/Bullet/CMakeLists.txt
+++ b/source/gameengine/Physics/Bullet/CMakeLists.txt
@@ -24,9 +24,10 @@
#
# ***** END GPL LICENSE BLOCK *****
-SET(SRC CcdPhysicsEnvironment.cpp CcdPhysicsController.cpp CcdGraphicController.cpp)
+# since this includes bullet we get errors from the headers too
+remove_strict_flags()
-SET(INC
+set(INC
.
../common
../../../../extern/bullet2/src
@@ -43,7 +44,21 @@ SET(INC
../../../../source/blender/makesdna
../../../../source/blender/blenlib
../../../../source/blender/blenkernel
- ${PYTHON_INC}
+ ${PYTHON_INCLUDE_DIRS}
)
-BLENDERLIB(bf_bullet "${SRC}" "${INC}")
+set(SRC
+ CcdPhysicsEnvironment.cpp
+ CcdPhysicsController.cpp
+ CcdGraphicController.cpp
+
+ CcdGraphicController.h
+ CcdPhysicsController.h
+ CcdPhysicsEnvironment.h
+)
+
+if(WITH_BULLET)
+ add_definitions(-DUSE_BULLET)
+endif()
+
+blender_add_lib(ge_phys_bullet "${SRC}" "${INC}")
diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.cpp b/source/gameengine/Physics/Bullet/CcdGraphicController.cpp
index 73ac789edf7..a5577d5e7d2 100644
--- a/source/gameengine/Physics/Bullet/CcdGraphicController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdGraphicController.cpp
@@ -1,3 +1,6 @@
+/** \file gameengine/Physics/Bullet/CcdGraphicController.cpp
+ * \ingroup physbullet
+ */
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.h b/source/gameengine/Physics/Bullet/CcdGraphicController.h
index 97893420d79..d0cb899cb74 100644
--- a/source/gameengine/Physics/Bullet/CcdGraphicController.h
+++ b/source/gameengine/Physics/Bullet/CcdGraphicController.h
@@ -13,6 +13,10 @@ subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
+/** \file CcdGraphicController.h
+ * \ingroup physbullet
+ */
+
#ifndef BULLET2_GRAPHICCONTROLLER_H
#define BULLET2_GRAPHICCONTROLLER_H
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 26265cb7e74..b67f9889ce8 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -1,3 +1,6 @@
+/** \file gameengine/Physics/Bullet/CcdPhysicsController.cpp
+ * \ingroup physbullet
+ */
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
@@ -13,6 +16,10 @@ subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
+#ifndef WIN32
+#include <stdint.h>
+#endif
+
#include "CcdPhysicsController.h"
#include "btBulletDynamicsCommon.h"
#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
@@ -1690,12 +1697,16 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
return false;
RAS_Deformer *deformer= gameobj ? gameobj->GetDeformer():NULL;
+ DerivedMesh* dm = NULL;
+
+ if (deformer)
+ dm = deformer->GetPhysicsMesh();
/* get the mesh from the object if not defined */
if(meshobj==NULL) {
/* modifier mesh */
- if(deformer && deformer->GetFinalMesh())
+ if(dm)
meshobj= deformer->GetRasMesh();
/* game object first mesh */
@@ -1706,14 +1717,12 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
}
}
- if(deformer && deformer->GetFinalMesh() && deformer->GetRasMesh() == meshobj)
+ if(dm && deformer->GetRasMesh() == meshobj)
{ /*
* Derived Mesh Update
*
* */
- DerivedMesh* dm= gameobj->GetDeformer()->GetFinalMesh();
-
MVert *mvert = dm->getVertArray(dm);
MFace *mface = dm->getTessFaceArray(dm);
numpolys = dm->getNumTessFaces(dm);
@@ -1973,6 +1982,10 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA
m_meshObject= meshobj;
+ if (dm) {
+ dm->needsFree = 1;
+ dm->release(dm);
+ }
return true;
}
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
index 3bbe17459c9..dc7a88e8db1 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h
@@ -13,6 +13,10 @@ subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
+/** \file CcdPhysicsController.h
+ * \ingroup physbullet
+ */
+
#ifndef BULLET2_PHYSICSCONTROLLER_H
#define BULLET2_PHYSICSCONTROLLER_H
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index 477a2c35d4f..93f1d0962d7 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -1,3 +1,6 @@
+/** \file gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+ * \ingroup physbullet
+ */
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
@@ -287,6 +290,7 @@ void CcdPhysicsEnvironment::setDebugDrawer(btIDebugDraw* debugDrawer)
m_debugDrawer = debugDrawer;
}
+#if 0
static void DrawAabb(btIDebugDraw* debugDrawer,const btVector3& from,const btVector3& to,const btVector3& color)
{
btVector3 halfExtents = (to-from)* 0.5f;
@@ -314,10 +318,8 @@ static void DrawAabb(btIDebugDraw* debugDrawer,const btVector3& from,const btVec
if (i<3)
edgecoord[i]*=-1.f;
}
-
-
}
-
+#endif
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
index c6e759743a9..4b97dc95179 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
@@ -13,6 +13,11 @@ subject to the following restrictions:
3. This notice may not be removed or altered from any source distribution.
*/
+/** \file CcdPhysicsEnvironment.h
+ * \ingroup physbullet
+ * See also \ref bulletdoc
+ */
+
#ifndef CCDPHYSICSENVIRONMENT
#define CCDPHYSICSENVIRONMENT
@@ -47,10 +52,11 @@ class btIDebugDraw;
class PHY_IVehicle;
class CcdOverlapFilterCallBack;
-/// CcdPhysicsEnvironment is an experimental mainloop for physics simulation using optional continuous collision detection.
-/// Physics Environment takes care of stepping the simulation and is a container for physics entities.
-/// It stores rigidbodies,constraints, materials etc.
-/// A derived class may be able to 'construct' entities by loading and/or converting
+/** CcdPhysicsEnvironment is an experimental mainloop for physics simulation using optional continuous collision detection.
+ * Physics Environment takes care of stepping the simulation and is a container for physics entities.
+ * It stores rigidbodies,constraints, materials etc.
+ * A derived class may be able to 'construct' entities by loading and/or converting
+ */
class CcdPhysicsEnvironment : public PHY_IPhysicsEnvironment
{
friend class CcdOverlapFilterCallBack;
diff --git a/source/gameengine/Physics/Bullet/Makefile b/source/gameengine/Physics/Bullet/Makefile
deleted file mode 100644
index 0514565534d..00000000000
--- a/source/gameengine/Physics/Bullet/Makefile
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id$
-#
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): none yet.
-#
-# ***** END GPL LICENSE BLOCK *****
-#
-#
-
-LIBNAME = blbullet
-DIR = $(OCGDIR)/gameengine/blphys/$(LIBNAME)
-
-include nan_compile.mk
-
-CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
-
-CPPFLAGS += -I$(NAN_BULLET2)/include
-CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
-CPPFLAGS += -I$(NAN_STRING)/include
-CPPFLAGS += -I$(NAN_MOTO)/include
-CPPFLAGS += -I$(NAN_GLEW)/include
-CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-CPPFLAGS += -I../../../kernel/gen_system
-CPPFLAGS += -I../../Physics/common
-CPPFLAGS += -I../../Physics/Dummy
-CPPFLAGS += -I../../Rasterizer
-CPPFLAGS += -I../../Ketsji
-CPPFLAGS += -I../../Expressions
-CPPFLAGS += -I../../GameLogic
-CPPFLAGS += -I../../SceneGraph
-CPPFLAGS += -I../../../../source/blender/makesdna
-CPPFLAGS += -I../../../../source/blender/blenkernel
-CPPFLAGS += -I../../../../source/blender/blenlib
-
diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript
index f58085ab354..e00b2d21ffa 100644
--- a/source/gameengine/Physics/Bullet/SConscript
+++ b/source/gameengine/Physics/Bullet/SConscript
@@ -23,8 +23,19 @@ incs += ' ' + env['BF_BULLET_INC']
defs = []
if env['WITH_BF_PYTHON']:
+<<<<<<< .working
incs += ' ' + env['BF_PYTHON_INC']
else:
defs.append('DISABLE_PYTHON')
+=======
+ incs += ' ' + env['BF_PYTHON_INC']
+ defs.append('WITH_PYTHON')
+>>>>>>> .merge-right.r35190
+
+if env['WITH_BF_CXX_GUARDEDALLOC']:
+ defs.append('WITH_CXX_GUARDEDALLOC')
+
+if env['WITH_BF_BULLET']:
+ defs.append('USE_BULLET')
-env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), defs, libtype=['core','player'], priority=[350,50], cxx_compileflags=env['BGE_CXXFLAGS'])
+env.BlenderLib ( 'ge_phys_bullet', Split(sources), Split(incs), defs, libtype=['core','player'], priority=[350,50], cxx_compileflags=env['BGE_CXXFLAGS'])