From 8f2c6bad9a8c7c25fd4d8fa58c63fd823f4dd74b Mon Sep 17 00:00:00 2001 From: nkorslund Date: Wed, 22 Oct 2008 09:34:30 +0000 Subject: [PATCH] Fixed non-compiling bullet code git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@52 ea6a568a-9f4f-0410-981a-c910a81bb256 --- Makefile | 4 +- bullet/cpp_bullet.cpp | 92 ++++++++++++++++++++--------------------- dsss.conf | 4 +- ogre/cpp_bsaarchive.cpp | 2 + ogre/cpp_interface.cpp | 5 ++- 5 files changed, 55 insertions(+), 52 deletions(-) diff --git a/Makefile b/Makefile index a681562f1..0f4bbff0f 100644 --- a/Makefile +++ b/Makefile @@ -75,10 +75,10 @@ nifobjs/%.o: %.d $(DMD) $(NIFFLAGS) -c $< -of$@ openmw: openmw.d cpp_ogre.o cpp_avcodec.o cpp_bullet.o $(obj) - $(DMD) $^ -of$@ -L-lopenal -L-lOgreMain -L-lOIS -L-lavcodec -L-lavformat bullet/libBulletDynamics.a bullet/libBulletCollision.a bullet/libLinearMath.a + $(DMD) $^ -of$@ -L-lopenal -L-lOgreMain -L-lOIS -L-lavcodec -L-lavformat bullet/libbulletdynamics.a bullet/libbulletcollision.a bullet/libbulletmath.a esmtool: esmtool.d cpp_ogre.o cpp_avcodec.o $(obj) - $(DMD) $^ -of$@ -L-lopenal -L-lOgreMain -L-lOIS -L-lavcodec -L-lavformat + $(DMD) $^ -of$@ -L-lopenal -L-lOgreMain -L-lOIS -L-lavcodec -L-lavformat bullet/libbulletdynamics.a bullet/libbulletcollision.a bullet/libbulletmath.a niftool: niftool.d $(obj_nif) $(DMD) $^ -of$@ diff --git a/bullet/cpp_bullet.cpp b/bullet/cpp_bullet.cpp index 83d1e8b28..f33a38f5a 100644 --- a/bullet/cpp_bullet.cpp +++ b/bullet/cpp_bullet.cpp @@ -286,52 +286,6 @@ const short cube_tris[] = const int cube_num_verts = 8; const int cube_num_tris = 12; -// Create a (trimesh) box with the given dimensions. Used for bounding -// boxes. TODO: I guess we have to use the NIF-specified bounding box -// for this, not our automatically calculated one. -/* -extern "C" void bullet_createBox(float xmin, float ymin, float zmin, - float xmax, float ymax, float zmax, - float *trans, float *matrix) -{ - // Make a copy of the vertex buffer, since we need to change it - float *vbuffer = (float*)copyBuffer(cube_verts, 12, cube_num_verts); - - // Calculate the widths - float xwidth = xmax-xmin; - float ywidth = ymax-ymin; - float zwidth = zmax-zmin; - - // Transform the cube to (xmin,xmax) etc - float *vb = vbuffer; - for(int i=0; iaddIndexedMesh(im, PHY_SHORT); } +// Create a (trimesh) box with the given dimensions. Used for bounding +// boxes. TODO: I guess we have to use the NIF-specified bounding box +// for this, not our automatically calculated one. +/* +extern "C" void bullet_createBox(float xmin, float ymin, float zmin, + float xmax, float ymax, float zmax, + float *trans, float *matrix) +{ + // Make a copy of the vertex buffer, since we need to change it + float *vbuffer = (float*)copyBuffer(cube_verts, 12, cube_num_verts); + + // Calculate the widths + float xwidth = xmax-xmin; + float ywidth = ymax-ymin; + float zwidth = zmax-zmin; + + // Transform the cube to (xmin,xmax) etc + float *vb = vbuffer; + for(int i=0; igetRootSceneNode(); root = rt->createChildSceneNode(); root->pitch(Degree(-90));