First checkin of core ODE functionality. See OdePhysicsController.cpp for a todo list.
This commit is contained in:
@@ -38,7 +38,7 @@ endif
|
|||||||
|
|
||||||
include nan_definitions.mk
|
include nan_definitions.mk
|
||||||
|
|
||||||
DIRS = creator blender kernel sumo gameengine
|
DIRS = ode creator blender kernel sumo gameengine
|
||||||
|
|
||||||
ifeq ($(OS),windows)
|
ifeq ($(OS),windows)
|
||||||
DIRS += icons
|
DIRS += icons
|
||||||
@@ -114,6 +114,11 @@ PYPLAYERLIB ?= $(PYLIB)
|
|||||||
GRPLIB += $(OCGDIR)/blender/bpython/$(DEBUG_DIR)libbpython.a
|
GRPLIB += $(OCGDIR)/blender/bpython/$(DEBUG_DIR)libbpython.a
|
||||||
GRPLIB += $(NAN_PYTHON)/frozen/libfrozen.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/blenkernel/$(DEBUG_DIR)libblenkernel.a
|
||||||
COMLIB += $(OCGDIR)/blender/blenloader/$(DEBUG_DIR)libblenloader.a
|
COMLIB += $(OCGDIR)/blender/blenloader/$(DEBUG_DIR)libblenloader.a
|
||||||
COMLIB += $(OCGDIR)/blender/blenpluginapi/$(DEBUG_DIR)libblenpluginapi.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/bloutines/$(DEBUG_DIR)libbloutines.a
|
||||||
COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
|
COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
|
||||||
COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.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/sumo/$(DEBUG_DIR)libsumo.a
|
||||||
COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
|
COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
|
||||||
COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
|
COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
|
||||||
|
@@ -559,9 +559,9 @@ enum {
|
|||||||
|
|
||||||
static char *physics_pup(void)
|
static char *physics_pup(void)
|
||||||
{
|
{
|
||||||
/* the number needs to match defines in game.h */
|
/* the number needs to match defines in KX_PhysicsBlenderSceneConverter.cpp */
|
||||||
return "Physics %t|Sumo %x0|"
|
return "Physics %t|None %x1|Sumo %x2|"
|
||||||
"ODE %x4 |None %x7|";
|
"ODE %x3 |Dynamo %x4|";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -139,6 +139,7 @@
|
|||||||
|
|
||||||
#include "SG_Node.h"
|
#include "SG_Node.h"
|
||||||
|
|
||||||
|
// defines USE_ODE to choose physics engine
|
||||||
#include "KX_ConvertPhysicsObject.h"
|
#include "KX_ConvertPhysicsObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
@@ -43,12 +43,13 @@
|
|||||||
|
|
||||||
#include "DummyPhysicsEnvironment.h"
|
#include "DummyPhysicsEnvironment.h"
|
||||||
|
|
||||||
|
//to decide to use sumo/ode or dummy physics - defines USE_ODE
|
||||||
|
#include "KX_ConvertPhysicsObject.h"
|
||||||
|
|
||||||
#ifdef USE_ODE
|
#ifdef USE_ODE
|
||||||
#include "OdePhysicsEnvironment.h"
|
#include "OdePhysicsEnvironment.h"
|
||||||
#endif //USE_ODE
|
#endif //USE_ODE
|
||||||
|
|
||||||
//to decide to use sumo/ode or dummy physics
|
|
||||||
#include "KX_ConvertPhysicsObject.h"
|
|
||||||
#ifdef USE_SUMO_SOLID
|
#ifdef USE_SUMO_SOLID
|
||||||
#include "SumoPhysicsEnvironment.h"
|
#include "SumoPhysicsEnvironment.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -181,24 +182,29 @@ void KX_BlenderSceneConverter::ConvertScene(const STR_String& scenename,
|
|||||||
switch (blenderscene->world->pad1)
|
switch (blenderscene->world->pad1)
|
||||||
{
|
{
|
||||||
|
|
||||||
case 4:
|
case 1:
|
||||||
{
|
|
||||||
physics_engine = UseODE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5:
|
|
||||||
{
|
|
||||||
physics_engine = UseDynamo;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 7:
|
|
||||||
{
|
{
|
||||||
physics_engine = UseNone;
|
physics_engine = UseNone;
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
default:
|
case 2:
|
||||||
{
|
{
|
||||||
physics_engine = UseSumo;
|
physics_engine = UseSumo;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
physics_engine = UseODE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 4:
|
||||||
|
{
|
||||||
|
physics_engine = UseDynamo;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
physics_engine = UseODE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -57,4 +57,4 @@ CPPFLAGS += -I../../kernel/gen_system
|
|||||||
CPPFLAGS += -I../Rasterizer/RAS_OpenGLRasterizer
|
CPPFLAGS += -I../Rasterizer/RAS_OpenGLRasterizer
|
||||||
CPPFLAGS += -I../Network -I../Ketsji/KXNetwork
|
CPPFLAGS += -I../Network -I../Ketsji/KXNetwork
|
||||||
CPPFLAGS += -I../Physics/common -I../Physics/Dummy
|
CPPFLAGS += -I../Physics/common -I../Physics/Dummy
|
||||||
|
CPPFLAGS += -I../Physics/BlOde
|
||||||
|
@@ -38,8 +38,7 @@
|
|||||||
//#define USE_SUMO_SOLID
|
//#define USE_SUMO_SOLID
|
||||||
//solid is not available yet
|
//solid is not available yet
|
||||||
|
|
||||||
//#define USE_ODE
|
#define USE_ODE
|
||||||
//ode is not available yet
|
|
||||||
|
|
||||||
|
|
||||||
class RAS_MeshObject;
|
class RAS_MeshObject;
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma warning (disable : 4786)
|
#pragma warning (disable : 4786)
|
||||||
|
|
||||||
|
// defines USE_ODE to choose physics engine
|
||||||
#include "KX_ConvertPhysicsObject.h"
|
#include "KX_ConvertPhysicsObject.h"
|
||||||
#include "KX_GameObject.h"
|
#include "KX_GameObject.h"
|
||||||
#include "RAS_MeshObject.h"
|
#include "RAS_MeshObject.h"
|
||||||
@@ -50,11 +51,11 @@
|
|||||||
#ifdef USE_ODE
|
#ifdef USE_ODE
|
||||||
|
|
||||||
#include "KX_OdePhysicsController.h"
|
#include "KX_OdePhysicsController.h"
|
||||||
#include "odephysicsenvironment.h"
|
#include "OdePhysicsEnvironment.h"
|
||||||
#endif //USE_ODE
|
#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
|
#ifdef USE_SUMO_SOLID
|
||||||
|
|
||||||
|
|
||||||
@@ -235,7 +236,7 @@ void KX_ConvertSumoObject( class KX_GameObject* gameobj,
|
|||||||
// physics object get updated here !
|
// 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)
|
if (objprop->m_in_active_layer && sumoObj)
|
||||||
{
|
{
|
||||||
|
@@ -49,6 +49,7 @@ CPPFLAGS += -I../Network -IKXNetwork
|
|||||||
CPPFLAGS += -I../Physics/common
|
CPPFLAGS += -I../Physics/common
|
||||||
CPPFLAGS += -I../Physics/Dummy
|
CPPFLAGS += -I../Physics/Dummy
|
||||||
CPPFLAGS += -I../Physics/Sumo
|
CPPFLAGS += -I../Physics/Sumo
|
||||||
|
CPPFLAGS += -I../Physics/BlOde
|
||||||
CPPFLAGS += -I.
|
CPPFLAGS += -I.
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
|
@@ -35,6 +35,6 @@ include nan_definitions.mk
|
|||||||
|
|
||||||
SOURCEDIR = source/gameengine/Physics
|
SOURCEDIR = source/gameengine/Physics
|
||||||
DIR = $(OCGDIR)/gameengine/blphys
|
DIR = $(OCGDIR)/gameengine/blphys
|
||||||
DIRS = common Sumo Dummy
|
DIRS = common Sumo Dummy BlOde
|
||||||
|
|
||||||
include nan_subdirs.mk
|
include nan_subdirs.mk
|
||||||
|
@@ -57,6 +57,7 @@ all debug::
|
|||||||
export NAN_SOLID ?= $(SRCHOME)/sumo/SOLID-3.0
|
export NAN_SOLID ?= $(SRCHOME)/sumo/SOLID-3.0
|
||||||
export NAN_SUMO ?= $(SRCHOME)/sumo
|
export NAN_SUMO ?= $(SRCHOME)/sumo
|
||||||
export NAN_FUZZICS ?= $(SRCHOME)/sumo/Fuzzics
|
export NAN_FUZZICS ?= $(SRCHOME)/sumo/Fuzzics
|
||||||
|
export NAN_ODE ?= $(SRCHOME)/ode
|
||||||
export NAN_OPENSSL ?= $(LCGDIR)/openssl
|
export NAN_OPENSSL ?= $(LCGDIR)/openssl
|
||||||
export NAN_BLENKEY ?= $(LCGDIR)/blenkey
|
export NAN_BLENKEY ?= $(LCGDIR)/blenkey
|
||||||
export NAN_DECIMATION ?= $(LCGDIR)/decimation
|
export NAN_DECIMATION ?= $(LCGDIR)/decimation
|
||||||
|
@@ -91,6 +91,7 @@ ifeq ($(OS),linux)
|
|||||||
COMMENT = "MESA 3.1"
|
COMMENT = "MESA 3.1"
|
||||||
LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi
|
LLIBS = -L$(NAN_MESA)/lib -L/usr/X11R6/lib -lXmu -lXext -lX11 -lXi
|
||||||
LLIBS += -lutil -lc -lm -ldl -lpthread
|
LLIBS += -lutil -lc -lm -ldl -lpthread
|
||||||
|
LLIBS += -L$(NAN_ODE)/lib -lode
|
||||||
LOPTS = -export-dynamic
|
LOPTS = -export-dynamic
|
||||||
DADD = -lGL -lGLU
|
DADD = -lGL -lGLU
|
||||||
SADD = $(NAN_MESA)/lib/libGL.a $(NAN_MESA)/lib/libGLU.a
|
SADD = $(NAN_MESA)/lib/libGL.a $(NAN_MESA)/lib/libGLU.a
|
||||||
|
Reference in New Issue
Block a user