1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

Fixed non-compiling bullet code

git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@52 ea6a568a-9f4f-0410-981a-c910a81bb256
This commit is contained in:
nkorslund 2008-10-22 09:34:30 +00:00
parent ebf1862971
commit 8f2c6bad9a
5 changed files with 55 additions and 52 deletions

View file

@ -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$@

View file

@ -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; i<cube_num_verts; i++)
{
*vb = (*vb)*xwidth + xmin; vb++;
*vb = (*vb)*ywidth + ymin; vb++;
*vb = (*vb)*zwidth + zmin; vb++;
}
// Insert the trimesh
createTriShape(cube_num_tris*3, cube_tris,
cube_num_verts, vbuffer,
trans, matrix);
}
*/
// Create a triangle shape and insert it into the current index/vertex
// array. If no array is active, create one.
extern "C" void bullet_createTriShape(int32_t numFaces,
void *triArray,
int32_t numVerts,
void *vertArray,
float *trans,
float *matrix)
{
createTriShape(numFaces, copyBuffer(triArray, 2, numFaces)
numVerts, copyBuffer(vertArray, 12, numVerts),
trans, matrix);
}
// Internal version that does not copy buffers
void createTriShape(int32_t numFaces, void *triArray,
int32_t numVerts, void *vertArray,
@ -375,6 +329,52 @@ void createTriShape(int32_t numFaces, void *triArray,
g_currentMesh->addIndexedMesh(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; i<cube_num_verts; i++)
{
*vb = (*vb)*xwidth + xmin; vb++;
*vb = (*vb)*ywidth + ymin; vb++;
*vb = (*vb)*zwidth + zmin; vb++;
}
// Insert the trimesh
createTriShape(cube_num_tris*3, cube_tris,
cube_num_verts, vbuffer,
trans, matrix);
}
*/
// Create a triangle shape and insert it into the current index/vertex
// array. If no array is active, create one.
extern "C" void bullet_createTriShape(int32_t numFaces,
void *triArray,
int32_t numVerts,
void *vertArray,
float *trans,
float *matrix)
{
createTriShape(numFaces, copyBuffer(triArray, 2, numFaces),
numVerts, copyBuffer(vertArray, 12, numVerts),
trans, matrix);
}
// Get the shape built up so far, if any. This clears g_currentMesh,
// so the next call to createTriShape will start a new shape.
extern "C" btCollisionShape *bullet_getFinalShape()

View file

@ -4,7 +4,7 @@
[openmw.d]
# Add libraries and the two C++ object files
buildflags = -llOgreMain -llopenal -llOIS -llavcodec -llavformat cpp_ogre.o cpp_avcodec.o cpp_bullet.o bullet/libBulletDynamics.a bullet/libBulletCollision.a bullet/libLinearMath.a
buildflags = -llOgreMain -llopenal -llOIS -llavcodec -llavformat cpp_ogre.o cpp_avcodec.o cpp_bullet.o bullet/libbulletdynamics.a bullet/libbulletcollision.a bullet/libbulletmath.a
# Make sure the C++ object files are built first
version(Windows) {
@ -34,7 +34,7 @@ prebuild += dsss clean niftool
[esmtool.d]
# Because of interdepencies between the ESM code and the resource
# manager, we have to include all the C++ stuff.
buildflags = -llOgreMain -llopenal -llOIS -llavcodec -llavformat cpp_ogre.o cpp_avcodec.o cpp_bullet.o bullet/libBulletDynamics.a bullet/libBulletCollision.a bullet/libLinearMath.a
buildflags = -llOgreMain -llopenal -llOIS -llavcodec -llavformat cpp_ogre.o cpp_avcodec.o cpp_bullet.o bullet/libbulletdynamics.a bullet/libbulletcollision.a bullet/libbulletmath.a

View file

@ -82,6 +82,8 @@ public:
return ptr;
}
time_t getModifiedTime(const String&) { return 0; }
// After load() is called, find("*") is called once. It doesn't seem
// to matter that we return an empty list, exists() gets called on
// the correct files anyway.

View file

@ -193,8 +193,9 @@ extern "C" void ogre_makeScene()
// Turn the entire scene (represented by the 'root' node) -90
// degrees around the x axis. This makes Z go upwards, and Y go into
// the screen. This is the orientation that Morrowind uses, and it
// automagically makes everything work as it should.
// the screen (when x is to the right.) This is the orientation that
// Morrowind uses, and it automagically makes everything work as it
// should.
SceneNode *rt = mSceneMgr->getRootSceneNode();
root = rt->createChildSceneNode();
root->pitch(Degree(-90));