@Indicium
Does your program compile for you on Windows? It seems like MSVC is bending some rules, because on my end I see illegal code.
In the file btCollisionShape.h:103 for example:
virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const = 0;
In your project, file physicsComponent.cpp:21 you're calling it as follows:
boxShape->calculateLocalInertia( 1, btVector3(0,0,0));
Which fails to compile because argument 2 (btVector3(0,0,0)) is an rvalue, so calculateLocalInertia must declare it as const to ensure it doesn't get modified. Should be:
virtual void calculateLocalInertia(btScalar mass,const btVector3& inertia) const = 0;
The correct way would be to write:
btVector3 nullVector(0,0,0);
boxShape->calculateLocalInertia( 1, nullVector);
[EDIT] Got everything to compile successfully. Just need to get everything to link correctly now.
[EDIT2]
Loading library RenderSystem_GL
terminate called after throwing an instance of 'Ogre::InternalErrorException'
what(): OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library RenderSystem_GL. System Error: RenderSystem_GL.so.1.9.0: cannot open shared object file: No such file or directory
Is that so?
➜ build git:(master) ✗ ls ~/Documents/programming/c++/Teabag/build
CMakeCache.txt CMakeFiles cmake_install.cmake Makefile Ogre.log RenderSystem_GL.so.1.9.0 teabag teabag.cbp teabag.layout
As you can see, RenderSystem_GL.so.1.9.0 is there. It's in the working directory of the executable, and I double-checked to make sure
renderer doesn't append a "_d", so the name should be correct.
Anyone know why Ogre can't find it? The relevant code is the following:
m_Root = new Ogre::Root("","","Ogre.log");
// Load the GL Rendersystem and set up
Ogre::String renderer = "RenderSystem_GL";
#if defined(_DEBUG) && defined(WIN32)
renderer.append("_d");
#endif
m_Root->loadPlugin( renderer );
[EDIT3]
It runs
Well, kind of. The window opens briefly, then it crashes. Here's the log:
➜ build git:(master) ✗ ./teabag ~/Documents/programming/c++/Teabag/build
Creating resource group General
Creating resource group Internal
Creating resource group Autodetect
SceneManagerFactory for type 'DefaultSceneManager' registered.
Registering ResourceManager for type Material
Registering ResourceManager for type Mesh
Registering ResourceManager for type Skeleton
MovableObjectFactory for type 'ParticleSystem' registered.
ArchiveFactory for archive type FileSystem registered.
ArchiveFactory for archive type Zip registered.
ArchiveFactory for archive type EmbeddedZip registered.
DDS codec registering
FreeImage version: 3.16.0
This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,rgb,rgba,bw,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti,webp,jxr,wdp,hdp
Registering ResourceManager for type HighLevelGpuProgram
Registering ResourceManager for type Compositor
MovableObjectFactory for type 'Entity' registered.
MovableObjectFactory for type 'Light' registered.
MovableObjectFactory for type 'BillboardSet' registered.
MovableObjectFactory for type 'ManualObject' registered.
MovableObjectFactory for type 'BillboardChain' registered.
MovableObjectFactory for type 'RibbonTrail' registered.
*-*-* OGRE Initialising
*-*-* Version 1.9.0 (Ghadamon)
Loading library ./RenderSystem_GL
Installing plugin: GL RenderSystem
OpenGL Rendering Subsystem created.
Plugin successfully installed
CPU Identifier & Features
-------------------------
* CPU ID: GenuineIntel: Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
* SSE: yes
* SSE2: yes
* SSE3: yes
* MMX: yes
* MMXEXT: yes
* 3DNOW: no
* 3DNOWEXT: no
* CMOV: yes
* TSC: yes
* FPU: yes
* PRO: yes
* HT: no
-------------------------
******************************
*** Starting GLX Subsystem ***
******************************
Registering ResourceManager for type Texture
GLRenderSystem::_createRenderWindow "Window", 800x600 windowed miscParams: FSAA=0 currentGLContext=True macAPI=carbon vsync=true
terminate called after throwing an instance of 'Ogre::RenderingAPIException'
what(): OGRE EXCEPTION(3:RenderingAPIException): currentGLContext was specified with no current GL context in GLXWindow::create at /home/alex/Documents/programming/c++/dep-openrump/build/ogre_1-9-0/RenderSystems/GL/src/GLX/OgreGLXWindow.cpp (line 146)
[1] 3735 abort (core dumped) ./teabag
[EDIT4]
I created a pull request so you can merge the changes I made back into your project. You should have received an e-mail if I did it right.
https://github.com/karljacques/Teabag/pull/1