Game Development Community

Building GMK with Xcode

by Peter Stuart · in Game Mechanics Kit · 08/21/2009 (4:11 am) · 10 replies

Hi, there. Here are some notes for building GMK on the Mac with Xcode. You can pretty much just follow the steps outlined in the programmer's guide. The information here is just more detail.

To add the GMK files to your Xcode project file:
- select T3D in the "Groups & Files" tree on the left side
- right click and select "Add > Existing Files..."
- navigate to the T3D directory and select the logickingMechanics folder, click "Add"
- make sure "Recursively create groups for any added folders" is selected
- click "Add"

This will add all of the files to your project. The GMK instructions provide a subset of files for some of the steps. Just remove the files you don't want in the build from the current render target:

- select the newly create logickingMechanics folder in "Groups & Files"

On the right side you should see a list of all of the files in the project, as well as some fields with extra information. One of these fields looks like a little target - a circle with a dot in the center. The checkboxes in this column define whether the file is included in the build or not. Toggle off the files you don't want in the build. Later on in future steps, check the box next to any files that need to be added to the build.


Installation of the physics pack

You'll need to compile the bullet or ODE libraries and install them (PhysX is not available on the mac). There are various ways to do this on the mac. For example, this is what I did for bullet (from the command line):

cd bullet directory
./configure
make
make install

In Xcode you need to add the headers and libraries directories to the build process and specify which libraries to link against. By default, the files for bullet are installed into /usr/local/lib and /usr/local/include:

- Find your target in "Groups & Files" in the "Targets" section. Right click on it and select "Get Info"
- Double click in the "Header Search Paths" field, and add "/usr/local/include"
- Double click in the "Library Search Paths" field, and add "/usr/local/lib"
- Double click in the "Other Linker Flags" field, and add "-lbulletcollision -lbulletdynamics -lbulletmath -lbulletsoftbody"

NOTE: The method provided here is useful for using GMK on your own machine. You probably really want to build the physics library as a framework so that you can include it in your application bundle when you're ready to distribute it. I haven't done that yet, so there aren't instructions here. However, the bullet installation page describes how to make a framework for bullet.

I hope this is of use!

Peer.


#1
08/21/2009 (8:28 am)
Thanks for such a wonderful manual, Peter!
#2
08/21/2009 (5:17 pm)
Thanks Peter, i need this :)
#3
11/19/2009 (2:29 pm)
Thanks for your awesome writeup! This really took me forwared from 800 errors to 22 ^^ I'm really stuck here. I'm using T3D 1.0.1 and GMK 1.2.6.

I'm getting the following error in several files:

error: extra qualification 'PhysInfo::' on member 'PhysInfo'

Thanks in advance :)
#4
11/19/2009 (2:45 pm)
Ok... got them down to 3...

error: 'class TSMesch' has no member named 'setManualDynamic'
error: 'no matching function call to 'TSMesh::crateVBIB(GFXVertexBufferDataHandle&)'

the first one I'm getting twice. However, all errors are in softbBody.cpp
#5
11/19/2009 (2:49 pm)
I don't have T3D or GMK 1.2.6 (for some reason it is only showing 1.1.1 in my account), but I'll try to help...

In my version of the code I see in physShape.h line 21:
PhysInfo::PhysInfo()

Change that to PhysInfo(). That is inside a class/struct declaration so the namespace is unwanted.
#6
11/19/2009 (2:58 pm)
Have you copied over all the modified engine files? I notice that tsMesh.h in GMK has both of those functions added.
#7
11/19/2009 (3:21 pm)
@Peter Stuart

GMK 1.2.6 is already uploaded. Just get the copy for windows version, I don't know why they don't update Mac's since it's the same package.
#8
11/19/2009 (4:37 pm)
Thanks for the tip Peter, I really forgot to update some files. Now everything works fine. Only one error left :(

libary not found for -lbulletcollision :-/

I added the libs and includes but just wont recognize it :( Do I have to add them to the xCode project as I did with thoe logicking folder ? (sorry, first time using xcode)
#9
11/19/2009 (6:14 pm)
Did you install bullet? Also, check your "Library search paths" to make sure the bullet directory is there (/usr/local/lib by default).
#10
11/20/2009 (4:48 am)
well I installed it, but not correctly. It didnt place any files under /usr/local/lib /usr/local/include

However fixed that now, but there was not lbulletmath. Just a linearmath. Changed that and it seems to work. Gotta make some testing now. At least it compiled :) Thanks for your help.