mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-09 00:50:17 +00:00
Fixes for IBM Cell SDK 3.0 by Jochen Roth
This commit is contained in:
parent
0bf152cabe
commit
66cdbb9659
@ -26,13 +26,23 @@ PROGRAM_ppu := CcdPhysicsDemo
|
||||
######################################################################
|
||||
OBJS = CcdPhysicsDemo.o main.o
|
||||
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
|
||||
|
||||
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
|
||||
CELL_TOP ?= /opt/cell/sdk
|
||||
CELL_SYSROOT = /opt/cell/sysroot
|
||||
include $(CELL_TOP)/buildutils/make.footer
|
||||
else
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
CELL_SYSROOT = $(CELL_TOP)/sysroot
|
||||
include $(CELL_TOP)/make.footer
|
||||
endif
|
||||
|
||||
########################################################################
|
||||
# Libraries, Include paths, Defines
|
||||
########################################################################
|
||||
INCLUDE = -DUSE_LIBSPE2 \
|
||||
-I$(CELL_TOP)/sysroot/usr/include \
|
||||
-I$(CELL_SYSROOT)/usr/include \
|
||||
-I../ \
|
||||
-I$(ROOT)/src \
|
||||
-I$(ROOT)/Demos/OpenGL \
|
||||
@ -55,7 +65,6 @@ INSTALL_FILES = $(PROGRAM_ppu)
|
||||
########################################################################
|
||||
|
||||
|
||||
include $(CELL_TOP)/make.footer
|
||||
|
||||
$(PPMS):
|
||||
cp textures/$@ .
|
||||
|
@ -90,13 +90,9 @@ void BasicDemo::clientMoveAndDisplay()
|
||||
if (ms > minFPS)
|
||||
ms = minFPS;
|
||||
|
||||
printf("step\n");
|
||||
|
||||
if (m_dynamicsWorld)
|
||||
m_dynamicsWorld->stepSimulation(ms / 1000000.f);
|
||||
|
||||
printf("step finished\n");
|
||||
|
||||
renderme();
|
||||
|
||||
glFlush();
|
||||
@ -175,6 +171,8 @@ void BasicDemo::initPhysics()
|
||||
#else
|
||||
m_dispatcher = new btCollisionDispatcher(collisionConfiguration);
|
||||
#endif //USE_PARALLEL_DISPATCHER
|
||||
m_collisionConfiguration = new btDefaultCollisionConfiguration();
|
||||
|
||||
|
||||
#define USE_SWEEP_AND_PRUNE 1
|
||||
#ifdef USE_SWEEP_AND_PRUNE
|
||||
@ -200,7 +198,7 @@ void BasicDemo::initPhysics()
|
||||
sol->setSolverMode(btSequentialImpulseConstraintSolver::SOLVER_RANDMIZE_ORDER);
|
||||
m_dynamicsWorld = new btSimpleDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver);
|
||||
#else
|
||||
m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver);
|
||||
m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver,m_collisionConfiguration);
|
||||
#endif //USE_SIMPLE_DYNAMICS_WORLD
|
||||
m_dynamicsWorld->getDispatchInfo().m_enableSPU = true;
|
||||
|
||||
@ -288,7 +286,7 @@ void BasicDemo::exitPhysics()
|
||||
//delete dispatcher
|
||||
delete m_dispatcher;
|
||||
|
||||
|
||||
delete m_collisionConfiguration;
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@ class BasicDemo : public DemoApplication
|
||||
btBroadphaseInterface* m_overlappingPairCache;
|
||||
|
||||
btCollisionDispatcher* m_dispatcher;
|
||||
|
||||
btDefaultCollisionConfiguration* m_collisionConfiguration;
|
||||
btConstraintSolver* m_solver;
|
||||
|
||||
btCollisionAlgorithmCreateFunc* m_sphereSphereCF;
|
||||
|
@ -51,9 +51,17 @@ INSTALL_FILES = $(PROGRAM_ppu)
|
||||
# make.footer
|
||||
########################################################################
|
||||
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
|
||||
include $(CELL_TOP)/make.footer
|
||||
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
|
||||
|
||||
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
|
||||
CELL_TOP ?= /opt/cell/sdk
|
||||
include $(CELL_TOP)/buildutils/make.footer
|
||||
else
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
include $(CELL_TOP)/make.footer
|
||||
endif
|
||||
|
||||
|
||||
$(PPMS):
|
||||
cp textures/$@ .
|
||||
|
@ -50,9 +50,15 @@ INSTALL_FILES = $(PROGRAM_ppu)
|
||||
# make.footer
|
||||
########################################################################
|
||||
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
|
||||
|
||||
include $(CELL_TOP)/make.footer
|
||||
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
|
||||
CELL_TOP ?= /opt/cell/sdk
|
||||
include $(CELL_TOP)/buildutils/make.footer
|
||||
else
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
include $(CELL_TOP)/make.footer
|
||||
endif
|
||||
|
||||
$(PPMS):
|
||||
cp textures/$@ .
|
||||
|
@ -32,5 +32,13 @@ RenderTexture.o
|
||||
#### Install directories
|
||||
INSTALL_DIR = $(ROOT)/lib/ibmsdk/
|
||||
INSTALL_FILES = $(LIBRARY)
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
include $(CELL_TOP)/make.footer
|
||||
|
||||
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
|
||||
|
||||
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
|
||||
CELL_TOP ?= /opt/cell/sdk
|
||||
include $(CELL_TOP)/buildutils/make.footer
|
||||
else
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
include $(CELL_TOP)/make.footer
|
||||
endif
|
||||
|
@ -4,13 +4,25 @@ __ARCH_BITS__ := 32
|
||||
NARROWPHASEDIR=./SpuNarrowPhaseCollisionTask
|
||||
SPU_TASKFILE=$(NARROWPHASEDIR)/SpuGatheringCollisionTask
|
||||
|
||||
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
|
||||
|
||||
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
|
||||
CELL_TOP ?= /opt/cell/sdk
|
||||
CELL_SYSROOT := /opt/cell/sysroot
|
||||
include $(CELL_TOP)/buildutils/make.footer
|
||||
else
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
CELL_SYSROOT := $(CELL_TOP)/sysroot
|
||||
include $(CELL_TOP)/make.footer
|
||||
endif
|
||||
|
||||
|
||||
RM=rm -f
|
||||
OUTDIR=./out
|
||||
DEBUGFLAG=-DNDEBUG
|
||||
LIBOUTDIR=../../lib/ibmsdk
|
||||
COLLISIONDIR=../../src/BulletCollision
|
||||
MATHDIR=../../src/LinearMath
|
||||
CELLSDKDIR=/opt/ibm/cell-sdk
|
||||
ARCHITECTUREFLAG=-m$(__ARCH_BITS__)
|
||||
ifeq "$(__ARCH_BITS__)" "64"
|
||||
SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__ -DUSE_ADDR64
|
||||
@ -18,7 +30,7 @@ else
|
||||
SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__
|
||||
endif
|
||||
SPU_GCC=/usr/bin/spu-gcc
|
||||
SPU_INCLUDEDIR= -I. -I$(CELLSDKDIR)/prototype/sysroot/usr/spu/include -I../../src -I$(NARROWPHASEDIR)
|
||||
SPU_INCLUDEDIR= -I. -I$(CELL_SYSROOT)/usr/spu/include -I../../src -I$(NARROWPHASEDIR)
|
||||
#SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -Os -c -include spu_intrinsics.h -include stdbool.h
|
||||
SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -O3 -mbranch-hints -fomit-frame-pointer -ftree-vectorize -finline-functions -ftree-vect-loop-version -ftree-loop-optimize -ffast-math -fno-rtti -fno-exceptions -c -include spu_intrinsics.h -include stdbool.h
|
||||
|
||||
@ -37,9 +49,9 @@ else
|
||||
endif
|
||||
|
||||
PPU_CFLAGS= $(ARCHITECTUREFLAG) $(DEBUGFLAG) -W -Wall -Winline -O3 -c -mabi=altivec -maltivec -include altivec.h -include stdbool.h
|
||||
PPU_INCLUDEDIR= -I. -I$(CELLSDKDIR)/prototype/sysroot/usr/include -I../../src -I$(NARROWPHASEDIR)
|
||||
PPU_INCLUDEDIR= -I. -I$(CELL_SYSROOT)/usr/include -I../../src -I$(NARROWPHASEDIR)
|
||||
PPU_LFLAGS= $(ARCHITECTUREFLAG) -Wl,-m,elf$(__ARCH_BITS__)ppc
|
||||
PPU_LIBRARIES= -lstdc++ -lsupc++ -lgcc -lgcov -lspe2 -lpthread -L../../lib/ibmsdk -lbulletcollision -lbulletdynamics -lbulletmath -L$(CELLSDKDIR)/prototype/sysroot/usr/lib$(__ARCH_BITS__) -R$(CELLSDKDIR)/prototype/sysroot/usr/lib
|
||||
PPU_LIBRARIES= -lstdc++ -lsupc++ -lgcc -lgcov -lspe2 -lpthread -L../../lib/ibmsdk -lbulletcollision -lbulletdynamics -lbulletmath -L$(CELL_SYSROOT)/usr/lib$(__ARCH_BITS__) -R$(CELL_SYSROOT)/usr/lib
|
||||
PPU_AR=/usr/bin/ar
|
||||
|
||||
MakeOut :
|
||||
|
@ -760,7 +760,7 @@ SIMD_FORCE_INLINE int getShapeTypeSize(int shapeType)
|
||||
default:
|
||||
btAssert(0);
|
||||
//unsupported shapetype, please add here
|
||||
break;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,4 +18,5 @@ subject to the following restrictions:
|
||||
btThreadSupportInterface::~btThreadSupportInterface()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,4 +39,5 @@ public:
|
||||
virtual void stopSPU()=0;
|
||||
};
|
||||
|
||||
#endif //THREAD_SUPPORT_INTERFACE_H
|
||||
#endif //THREAD_SUPPORT_INTERFACE_H
|
||||
|
||||
|
@ -70,6 +70,7 @@ public:
|
||||
btPersistentManifold(void* body0,void* body1,int bla)
|
||||
: m_body0(body0),m_body1(body1),m_cachedPoints(0)
|
||||
{
|
||||
(void)bla;
|
||||
}
|
||||
|
||||
SIMD_FORCE_INLINE void* getBody0() { return m_body0;}
|
||||
|
@ -91,5 +91,14 @@ btUniformScalingShape.o
|
||||
#### Install directories
|
||||
INSTALL_DIR = $(ROOT)/lib/ibmsdk
|
||||
INSTALL_FILES = $(LIBRARY_ppu)
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
include $(CELL_TOP)/make.footer
|
||||
|
||||
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
|
||||
|
||||
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
|
||||
CELL_TOP ?= /opt/cell/sdk
|
||||
include $(CELL_TOP)/buildutils/make.footer
|
||||
else
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
include $(CELL_TOP)/make.footer
|
||||
endif
|
||||
|
||||
|
@ -40,6 +40,14 @@ btWheelInfo.o
|
||||
#### Install directories
|
||||
INSTALL_DIR = $(ROOT)/lib/ibmsdk
|
||||
INSTALL_FILES = $(LIBRARY_ppu)
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
|
||||
include $(CELL_TOP)/make.footer
|
||||
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
|
||||
|
||||
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
|
||||
CELL_TOP ?= /opt/cell/sdk
|
||||
include $(CELL_TOP)/buildutils/make.footer
|
||||
else
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
include $(CELL_TOP)/make.footer
|
||||
endif
|
||||
|
||||
|
@ -26,5 +26,14 @@ btQuickprof.o
|
||||
#### Install directories
|
||||
INSTALL_DIR = $(ROOT)/lib/ibmsdk
|
||||
INSTALL_FILES = $(LIBRARY_ppu)
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
include $(CELL_TOP)/make.footer
|
||||
|
||||
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
|
||||
|
||||
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
|
||||
CELL_TOP ?= /opt/cell/sdk
|
||||
include $(CELL_TOP)/buildutils/make.footer
|
||||
else
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
include $(CELL_TOP)/make.footer
|
||||
endif
|
||||
|
||||
|
@ -1,10 +1,16 @@
|
||||
#### Visit Bullet library ibmsdk dirs and build code
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
|
||||
DIRS := \
|
||||
../BulletCollision/ibmsdk \
|
||||
../BulletDynamics/ibmsdk \
|
||||
DIRS := \
|
||||
../BulletCollision/ibmsdk \
|
||||
../BulletDynamics/ibmsdk \
|
||||
../LinearMath/ibmsdk
|
||||
|
||||
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
|
||||
|
||||
include $(CELL_TOP)/make.footer
|
||||
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
|
||||
CELL_TOP ?= /opt/cell/sdk
|
||||
include $(CELL_TOP)/buildutils/make.footer
|
||||
else
|
||||
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
|
||||
include $(CELL_TOP)/make.footer
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user