First checkin of core ODE functionality. See OdePhysicsController.cpp for a todo...
authorNorman Lin <nlin@nlin.net>
Fri, 18 Oct 2002 14:36:34 +0000 (14:36 +0000)
committerNorman Lin <nlin@nlin.net>
Fri, 18 Oct 2002 14:36:34 +0000 (14:36 +0000)
source/Makefile
source/blender/src/buttons.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/Makefile
source/gameengine/Ketsji/KX_ConvertPhysicsObject.h
source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
source/gameengine/Ketsji/Makefile
source/gameengine/Physics/Makefile
source/nan_definitions.mk
source/nan_link.mk

index ef7a2aa73c126239701fa588c4a8a40d7844aae1..51aa0234f8bb64cc9e993c5b7456a4951cddf99a 100644 (file)
@@ -38,7 +38,7 @@ endif
 
 include nan_definitions.mk
 
-DIRS = creator blender kernel sumo gameengine
+DIRS = ode creator blender kernel sumo gameengine
 
 ifeq ($(OS),windows)
     DIRS += icons
@@ -114,6 +114,11 @@ PYPLAYERLIB ?= $(PYLIB)
     GRPLIB += $(OCGDIR)/blender/bpython/$(DEBUG_DIR)libbpython.a
     GRPLIB += $(NAN_PYTHON)/frozen/libfrozen.a
 
+# nlin: the reason that some libraries appear more than once below is
+# to handle circular dependencies in linking among libraries... some
+# linkers (e.g. under Linux) need libs to be specified multiple times
+# to properly resolve circular dependencies. ugly, but it works...
+# the repeat entries could probably be trimmed down.
     COMLIB = $(OCGDIR)/blender/blenkernel/$(DEBUG_DIR)libblenkernel.a
     COMLIB += $(OCGDIR)/blender/blenloader/$(DEBUG_DIR)libblenloader.a
     COMLIB += $(OCGDIR)/blender/blenpluginapi/$(DEBUG_DIR)libblenpluginapi.a
@@ -124,6 +129,15 @@ PYPLAYERLIB ?= $(PYLIB)
     COMLIB += $(OCGDIR)/gameengine/bloutines/$(DEBUG_DIR)libbloutines.a
     COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
     COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
+    COMLIB += $(OCGDIR)/gameengine/blphys/blode/$(DEBUG_DIR)libblode.a
+    COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
+    COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
+    COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
+    COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
+    COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
+    COMLIB += $(OCGDIR)/gameengine/ketsji/$(DEBUG_DIR)libketsji.a
+    COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
+    COMLIB += $(OCGDIR)/gameengine/blphys/blode/$(DEBUG_DIR)libblode.a
     COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
     COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
     COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
index 85aeb92d9592a15a9103e2b544a495c477a31dac..6aa265489266e5559965632b5e2999066db4608c 100644 (file)
@@ -559,9 +559,9 @@ enum {
 
 static char *physics_pup(void)
 {
-       /* the number needs to match defines in game.h */
-       return "Physics %t|Sumo %x0|"
-               "ODE %x4 |None %x7|";
+  /* the number needs to match defines in KX_PhysicsBlenderSceneConverter.cpp */
+  return "Physics %t|None %x1|Sumo %x2|"
+         "ODE %x3 |Dynamo %x4|";
 }
 
 
index 68d45044fff2be952f19453c6bf7b036b8f4c5ec..2343c372f1be62839c43e21ed417e795429adc0a 100644 (file)
 
 #include "SG_Node.h"
 
+// defines USE_ODE to choose physics engine
 #include "KX_ConvertPhysicsObject.h"
 
 
index fdba851b7a3a2b7579da69c2bb7605621aefe2a2..a043291c5d5c7f2cda7aaf3fd867445a618b304c 100644 (file)
 
 #include "DummyPhysicsEnvironment.h"
 
+//to decide to use sumo/ode or dummy physics - defines USE_ODE
+#include "KX_ConvertPhysicsObject.h"
+
 #ifdef USE_ODE
 #include "OdePhysicsEnvironment.h"
 #endif //USE_ODE
 
-//to decide to use sumo/ode or dummy physics
-#include "KX_ConvertPhysicsObject.h"
 #ifdef USE_SUMO_SOLID
 #include "SumoPhysicsEnvironment.h"
 #endif
@@ -181,24 +182,29 @@ void KX_BlenderSceneConverter::ConvertScene(const STR_String& scenename,
                        switch (blenderscene->world->pad1)
                        {
                                
-                       case 4:
+                       case 1:
                                {
-                                       physics_engine = UseODE;
+                                       physics_engine = UseNone;
+                                       break;
+                               };
+                       case 2:
+                               {
+                                       physics_engine = UseSumo;
                                        break;
                                }
-                       case 5:
+                       case 3:
                                {
-                                       physics_engine = UseDynamo;
+                                       physics_engine = UseODE;
                                        break;
                                }
-                       case 7:
+                       case 4:
                                {
-                                       physics_engine = UseNone;
+                                       physics_engine = UseDynamo;
                                        break;
-                               };
+                               }
                        default:
                                {
-                                       physics_engine = UseSumo;
+                                       physics_engine = UseODE;
                                }
                        }
                }
index 8f85e4c1a58de378ca7a7f0c6ceba1f1fc1ef663..ffcdf8a0693e8e56af42e2402a164a331c056ae5 100644 (file)
@@ -57,4 +57,4 @@ CPPFLAGS += -I../../kernel/gen_system
 CPPFLAGS += -I../Rasterizer/RAS_OpenGLRasterizer
 CPPFLAGS += -I../Network -I../Ketsji/KXNetwork
 CPPFLAGS += -I../Physics/common -I../Physics/Dummy
-
+CPPFLAGS += -I../Physics/BlOde
index f74349a3e1a248c81aab1d85dcc1ef8920ee9609..931b9e3d400d6fa99c730e0124e0b7786ebab336 100644 (file)
@@ -38,8 +38,7 @@
 //#define USE_SUMO_SOLID
 //solid is not available yet
 
-//#define USE_ODE
-//ode is not available yet
+#define USE_ODE
 
 
 class RAS_MeshObject;
index 01d02b58132d98c4c07e57dbd7691da31e6d768c..97828b618f8f60df5f60a7de9db8e07153234ab1 100644 (file)
@@ -31,6 +31,7 @@
  */
 #pragma warning (disable : 4786)
 
+// defines USE_ODE to choose physics engine
 #include "KX_ConvertPhysicsObject.h"
 #include "KX_GameObject.h"
 #include "RAS_MeshObject.h"
 #ifdef USE_ODE
 
 #include "KX_OdePhysicsController.h"
-#include "odephysicsenvironment.h"
+#include "OdePhysicsEnvironment.h"
 #endif //USE_ODE
 
 
-// USE_SUMO_SOLID is defined in headerfile KX_ConvertPhysicsObjects.h
+// USE_SUMO_SOLID is defined in headerfile KX_ConvertPhysicsObject.h
 #ifdef USE_SUMO_SOLID
 
 
@@ -235,7 +236,7 @@ void        KX_ConvertSumoObject(   class   KX_GameObject* gameobj,
        // physics object get updated here !
 
        
-       // lazy evaluation because Havok doesn't support scaling !gameobj->UpdateTransform();
+       // lazy evaluation because we might not support scaling !gameobj->UpdateTransform();
 
        if (objprop->m_in_active_layer && sumoObj)
        {
index 4e0ee06fe1a9377098ef719f7130c17d68de7d62..1c11d7ca4c57e1182035fa595e46029b8fe90f7d 100644 (file)
@@ -49,6 +49,7 @@ CPPFLAGS += -I../Network -IKXNetwork
 CPPFLAGS += -I../Physics/common
 CPPFLAGS += -I../Physics/Dummy
 CPPFLAGS += -I../Physics/Sumo
+CPPFLAGS += -I../Physics/BlOde
 CPPFLAGS += -I.
 
 ###########################
index c04ccb175aa101194bbbf809f37dc9ae359e2b05..349c225e7ee96c20b349b394cbad858aed8e4b4b 100644 (file)
@@ -35,6 +35,6 @@ include nan_definitions.mk
 
 SOURCEDIR = source/gameengine/Physics
 DIR = $(OCGDIR)/gameengine/blphys
-DIRS = common Sumo Dummy
+DIRS = common Sumo Dummy BlOde
 
 include nan_subdirs.mk
index 1034d3253c7199698e854e09c37061aadc27c457..d084ce972f5eae2a260b9be3bf129f94e7b83bda 100644 (file)
@@ -57,6 +57,7 @@ all debug::
     export NAN_SOLID ?= $(SRCHOME)/sumo/SOLID-3.0
     export NAN_SUMO ?= $(SRCHOME)/sumo
     export NAN_FUZZICS ?= $(SRCHOME)/sumo/Fuzzics
+    export NAN_ODE ?= $(SRCHOME)/ode
     export NAN_OPENSSL ?= $(LCGDIR)/openssl
     export NAN_BLENKEY ?= $(LCGDIR)/blenkey
     export NAN_DECIMATION ?= $(LCGDIR)/decimation
index 2b8395badeb025f4cb7dc7793dce81bbb87917cf..6a9ebded01717f3f639c77685bfb2cd7efade942 100644 (file)
@@ -91,6 +91,7 @@ ifeq ($(OS),linux)
     COMMENT = "MESA 3.1"
     LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi
     LLIBS += -lutil -lc -lm -ldl -lpthread
+    LLIBS += -L$(NAN_ODE)/lib -lode
     LOPTS = -export-dynamic
     DADD = -lGL -lGLU
     SADD = $(NAN_MESA)/lib/libGL.a $(NAN_MESA)/lib/libGLU.a