How to: Bullet Physics in Visual Studio 2012

Standard

I’m going to use Bullet Physics in a university course this semester, as usual, the online documentation to create projects from scratch always lacks something / are outdated / all sorts of useless time consuming crap.

Creating a project from scratch with Bullet is actually pretty simple, this are the steps:

In this example I’m supposing you downloaded the file “bullet-2.81-rev2613.zip” and extracted it to “c:\bullet-2.81-rev2613”

  • Bullet comes already with all the compiled to your environment, but you can compile them for yourself using CMake ( Bullet wiki has a fairly good tutorial on this ) or Premake4. We are going to use the ones that already come with Bullet for simplicity.
  • Create a new C++ Win32 Console Project (I recommend that you use the Precompiled Headers, if you don’t know what they are, google it 😉 )
  • Now Add all the Bullet projects you need. For this example, in VS go to File>Add> Existing Project and, separately, add:
  1. c:\bullet-2.81-rev2613\build\vs2010\BulletCollision.vcxproj
  2. c:\bullet-2.81-rev2613\build\vs2010\BulletDynamics.vcxproj
  3. c:\bullet-2.81-rev2613\build\vs2010\LinearMath.vcxproj
  • In Solution Explorer, go to your project Properties (select it and ALT+ENTER)
  • Go to Common Properties> Framework and References and click on “Add New References…”. Choose all the projects you’ve previosly added
  • Click on Configuration Properties
  • At the top, change Configuration to All Configurations
  • Go to Configuration Properties> C/C++> General
  • In Additional Include Directories, add c:\Bullet-2.81-rev2613\src\

That’s it.

To test it, use this code in your project .cpp:

#include "stdafx.h"
#include "btBulletDynamicsCommon.h"
int _tmain(int argc, _TCHAR* argv[]){
btBoxShape * box = new btBoxShape(btVector3(1,1,1));
delete box;
return 0;
}

Did it run or did you got this error?

If so, the projects you’ve added have weird references. Do this:

  • In each added project, go to project Properties Page (ALT+ENTER)
  • In Common Properties> Framework and References, remove references to ZERO_CHECK

Run it again. Worked?

Compiled

How to: Install Language Pack file ( lp.cab ) in Windows 8 RTM

Standard

Currently, DreamSpark Premium (formerly MSDNAA) only have access to the en-US version of Windows 8 RTM, fortunately enough if you want to change the display language now you can download the official Language Pack.

Problem: There’s no way to manually install a language pack file (lp.cab) in Windows 8, at least accessible through Control Panel as it was in Windows 7 (Microsoft must be planing to only distribute language packs through Windows Update, but, at the time of writing, they aren’t available yet )

Solution #1:

  • Press Win key
  • In Start Screen write lpksetup
  • Press enter and follow instructions
  • After the successful installation, restart and enable the new display language in Control Panel\Clock> Language and Region> Language

Solution #2:

  • Press Win key
  • In Start Screen, write cmd
  • Right mouse click over Command Prompt and select Run as Administrator
  • Write the following command, restart afterwards and enable your display language in Control Panel:
dism /online /add-package /packagepath:C:\languagepacks\de-de\lp.cab

NOTE 1#: You will need to adapt the commands requirements for your specific usage, for instance, if i want to install a pt-PT language pack that is located at c:\users\me\lpacks\pt-PT\lp.cab, the command would be

dism /online /add-package /packagepath:C:\users\me\lpacks\pt-PT\lp.cab

NOTE 2#: Don’t forget to change your Locale settings also, so you can get the same language everywhere.

PS: I don’t know if I’m allowed to share the full .iso file here, but you can easly find this anywhere, they are named as follow in MSDN:

  • x86: mu_windows_8_language_pack_x86_dvd_917546.iso
  • x64: mu_windows_8_language_pack_x64_dvd_917544.iso

Synchronizing files in Dropbox without having them in the Dropbox folder, possible?

Standard

Short answer: no.

Long answer: sort of.

Now maybe thinking “huummm so, you’re just wasting my damn time?”, to answer that, no, I’m not, as far as i know there is no way to have files outside the Dropbox folder being synchronized, BUT, when you finish reading this post you will know something that will certainly fill this void.

Meet, Link Shell Extension

I’m going to keep this short, the creator of the application has done a nice work documenting everything so, there’s no need for me to copy paste with different words. This context menu application adds the possibility to use a system feature that creates a one way shortcut called symbolic links or hardlinks, which differs from a normal shortcut because the later is just file pointing to the destiny file.

So, now that you know Link Shell Extension, let’s get back on track. The gimmick here is that, the original files will be stored inside Dropbox folder, afterwards you just need to use this application to create a Hardlink (for files) or a Junction (for folders).

 

Practical usage of Link Shell Extension with Dropbox:

– You want to synchronize a folder with Word documents but maintain access to them through your Documents folder.

  1. Just put the folder anywhere in your Dropbox
  2. Select the folder
  3. Right mouse button click
  4. Click on “Pick Link Source”
  5. Go to your Documents folder
  6. Right mouse button click on the folder
  7. Drop As> Junction
Practical usage of Link Shell Extension without Dropbox:
-Like me, you have your music separated by Artists in your Music folder, but there’s always the problem of music with multiple artists.
  1. Well, usually there’s always a “main” artist so, put the original file in that artist folder
  2. Right mouse button click on the file
  3. Click on “Pick Link Source”
  4. Go to the other artist folder
  5. Right mouse button click on the folder
  6. Drop As> Hardlink

 

This has all sorts of applications, i will describe in another post how to use this is UDK to keep your files synchronized !