Anonymous avatar Anonymous committed 3836dc4

using custom OgreApplication as basis, changed material, AABB-based scaling

Comments (0)

Files changed (8)

media/gray.material

-material Gray
+material 3DS/Gray
 {
     technique
     {
         pass
         {
-			//cull_hardware none
+	    //cull_hardware none
             lightning on
-			shading gouraud
-            ambient 0.5 0.5 0.5
-            diffuse 0.5 0.5 0.5
+            ambient 0.1 0.1 0.1
+            diffuse 0.3 0.3 0.3
+	    specular  0.5 0.5 0.5 50.0
         }
     }
 }

ogre-lib3ds/ExampleApplication.h

-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2006 Torus Knot Software Ltd
-Also see acknowledgements in Readme.html
-
-You may use this sample code for anything you like, it is not covered by the
-LGPL like the rest of the engine.
------------------------------------------------------------------------------
-*/
-/*
------------------------------------------------------------------------------
-Filename:    ExampleApplication.h
-Description: Base class for all the OGRE examples
------------------------------------------------------------------------------
-*/
-
-#ifndef __ExampleApplication_H__
-#define __ExampleApplication_H__
-
-#include "Ogre.h"
-#include "OgreConfigFile.h"
-#include "ExampleFrameListener.h"
-
-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-#include <CoreFoundation/CoreFoundation.h>
-
-// This function will locate the path to our application on OS X,
-// unlike windows you can not rely on the curent working directory
-// for locating your configuration files and resources.
-std::string macBundlePath()
-{
-    char path[1024];
-    CFBundleRef mainBundle = CFBundleGetMainBundle();
-    assert(mainBundle);
-
-    CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
-    assert(mainBundleURL);
-
-    CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
-    assert(cfStringRef);
-
-    CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
-
-    CFRelease(mainBundleURL);
-    CFRelease(cfStringRef);
-
-    return std::string(path);
-}
-#endif
-
-using namespace Ogre;
-
-/** Base class which manages the standard startup of an Ogre application.
-    Designed to be subclassed for specific examples if required.
-*/
-class ExampleApplication
-{
-public:
-    /// Standard constructor
-    ExampleApplication()
-    {
-        mFrameListener = 0;
-        mRoot = 0;
-		// Provide a nice cross platform solution for locating the configuration files
-		// On windows files are searched for in the current working directory, on OS X however
-		// you must provide the full path, the helper function macBundlePath does this for us.
-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-		mResourcePath = macBundlePath() + "/Contents/Resources/";
-#else
-		mResourcePath = "";
-#endif
-    }
-    /// Standard destructor
-    virtual ~ExampleApplication()
-    {
-        if (mFrameListener)
-            delete mFrameListener;
-        if (mRoot)
-            OGRE_DELETE mRoot;
-    }
-
-    /// Start the example
-    virtual void go(void)
-    {
-        if (!setup())
-            return;
-
-        mRoot->startRendering();
-
-        // clean up
-        destroyScene();
-    }
-
-protected:
-    Root *mRoot;
-    Camera* mCamera;
-    SceneManager* mSceneMgr;
-    ExampleFrameListener* mFrameListener;
-    RenderWindow* mWindow;
-	Ogre::String mResourcePath;
-
-    // These internal methods package up the stages in the startup process
-    /** Sets up the application - returns false if the user chooses to abandon configuration. */
-    virtual bool setup(void)
-    {
-
-		String pluginsPath;
-		// only use plugins.cfg if not static
-#ifndef OGRE_STATIC_LIB
-		pluginsPath = mResourcePath + "plugins.cfg";
-#endif
-		
-        mRoot = OGRE_NEW Root(pluginsPath, 
-            mResourcePath + "ogre.cfg", mResourcePath + "Ogre.log");
-
-        setupResources();
-
-        bool carryOn = configure();
-        if (!carryOn) return false;
-
-        chooseSceneManager();
-        createCamera();
-        createViewports();
-
-        // Set default mipmap level (NB some APIs ignore this)
-        TextureManager::getSingleton().setDefaultNumMipmaps(5);
-
-		// Create any resource listeners (for loading screens)
-		createResourceListener();
-		// Load resources
-		loadResources();
-
-		// Create the scene
-        createScene();
-
-        createFrameListener();
-
-        return true;
-
-    }
-    /** Configures the application - returns false if the user chooses to abandon configuration. */
-    virtual bool configure(void)
-    {
-        // Show the configuration dialog and initialise the system
-        // You can skip this and use root.restoreConfig() to load configuration
-        // settings if you were sure there are valid ones saved in ogre.cfg
-        if(mRoot->showConfigDialog())
-        {
-            // If returned true, user clicked OK so initialise
-            // Here we choose to let the system create a default rendering window by passing 'true'
-            mWindow = mRoot->initialise(true);
-            return true;
-        }
-        else
-        {
-            return false;
-        }
-    }
-
-    virtual void chooseSceneManager(void)
-    {
-        // Create the SceneManager, in this case a generic one
-        mSceneMgr = mRoot->createSceneManager(ST_GENERIC, "ExampleSMInstance");
-    }
-    virtual void createCamera(void)
-    {
-        // Create the camera
-        mCamera = mSceneMgr->createCamera("PlayerCam");
-
-        // Position it at 500 in Z direction
-        mCamera->setPosition(Vector3(0,0,500));
-        // Look back along -Z
-        mCamera->lookAt(Vector3(0,0,-300));
-        mCamera->setNearClipDistance(5);
-
-    }
-    virtual void createFrameListener(void)
-    {
-        mFrameListener= new ExampleFrameListener(mWindow, mCamera);
-        mFrameListener->showDebugOverlay(true);
-        mRoot->addFrameListener(mFrameListener);
-    }
-
-    virtual void createScene(void) = 0;    // pure virtual - this has to be overridden
-
-    virtual void destroyScene(void){}    // Optional to override this
-
-    virtual void createViewports(void)
-    {
-        // Create one viewport, entire window
-        Viewport* vp = mWindow->addViewport(mCamera);
-        vp->setBackgroundColour(ColourValue(0,0,0));
-
-        // Alter the camera aspect ratio to match the viewport
-        mCamera->setAspectRatio(
-            Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
-    }
-
-    /// Method which will define the source of resources (other than current folder)
-    virtual void setupResources(void)
-    {
-        // Load resource paths from config file
-        ConfigFile cf;
-        cf.load(mResourcePath + "resources.cfg");
-
-        // Go through all sections & settings in the file
-        ConfigFile::SectionIterator seci = cf.getSectionIterator();
-
-        String secName, typeName, archName;
-        while (seci.hasMoreElements())
-        {
-            secName = seci.peekNextKey();
-            ConfigFile::SettingsMultiMap *settings = seci.getNext();
-            ConfigFile::SettingsMultiMap::iterator i;
-            for (i = settings->begin(); i != settings->end(); ++i)
-            {
-                typeName = i->first;
-                archName = i->second;
-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-                // OS X does not set the working directory relative to the app,
-                // In order to make things portable on OS X we need to provide
-                // the loading with it's own bundle path location
-                ResourceGroupManager::getSingleton().addResourceLocation(
-                    String(macBundlePath() + "/" + archName), typeName, secName);
-#else
-                ResourceGroupManager::getSingleton().addResourceLocation(
-                    archName, typeName, secName);
-#endif
-            }
-        }
-    }
-
-	/// Optional override method where you can create resource listeners (e.g. for loading screens)
-	virtual void createResourceListener(void)
-	{
-
-	}
-
-	/// Optional override method where you can perform resource group loading
-	/// Must at least do ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
-	virtual void loadResources(void)
-	{
-		// Initialise, parse scripts etc
-		ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
-
-	}
-
-
-
-};
-
-
-#endif

ogre-lib3ds/ExampleFrameListener.h

-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2006 Torus Knot Software Ltd
-Also see acknowledgements in Readme.html
-
-You may use this sample code for anything you like, it is not covered by the
-LGPL like the rest of the engine.
------------------------------------------------------------------------------
-*/
-/*
------------------------------------------------------------------------------
-Filename:    ExampleFrameListener.h
-Description: Defines an example frame listener which responds to frame events.
-This frame listener just moves a specified camera around based on
-keyboard and mouse movements.
-Mouse:    Freelook
-W or Up:  Forward
-S or Down:Backward
-A:        Step left
-D:        Step right
-             PgUp:     Move upwards
-             PgDown:   Move downwards
-             F:        Toggle frame rate stats on/off
-			 R:        Render mode
-             T:        Cycle texture filtering
-                       Bilinear, Trilinear, Anisotropic(8)
-             P:        Toggle on/off display of camera position / orientation
------------------------------------------------------------------------------
-*/
-
-#ifndef __ExampleFrameListener_H__
-#define __ExampleFrameListener_H__
-
-#include "Ogre.h"
-#include "OgreStringConverter.h"
-#include "OgreException.h"
-
-//Use this define to signify OIS will be used as a DLL
-//(so that dll import/export macros are in effect)
-#define OIS_DYNAMIC_LIB
-#include <OIS/OIS.h>
-
-using namespace Ogre;
-
-class ExampleFrameListener: public FrameListener, public WindowEventListener
-{
-protected:
-	virtual void updateStats(void)
-	{
-		static String currFps = "Current FPS: ";
-		static String avgFps = "Average FPS: ";
-		static String bestFps = "Best FPS: ";
-		static String worstFps = "Worst FPS: ";
-		static String tris = "Triangle Count: ";
-		static String batches = "Batch Count: ";
-
-		// update stats when necessary
-		try {
-			OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps");
-			OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps");
-			OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps");
-			OverlayElement* guiWorst = OverlayManager::getSingleton().getOverlayElement("Core/WorstFps");
-
-			const RenderTarget::FrameStats& stats = mWindow->getStatistics();
-			guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS));
-			guiCurr->setCaption(currFps + StringConverter::toString(stats.lastFPS));
-			guiBest->setCaption(bestFps + StringConverter::toString(stats.bestFPS)
-				+" "+StringConverter::toString(stats.bestFrameTime)+" ms");
-			guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS)
-				+" "+StringConverter::toString(stats.worstFrameTime)+" ms");
-
-			OverlayElement* guiTris = OverlayManager::getSingleton().getOverlayElement("Core/NumTris");
-			guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount));
-
-			OverlayElement* guiBatches = OverlayManager::getSingleton().getOverlayElement("Core/NumBatches");
-			guiBatches->setCaption(batches + StringConverter::toString(stats.batchCount));
-
-			OverlayElement* guiDbg = OverlayManager::getSingleton().getOverlayElement("Core/DebugText");
-			guiDbg->setCaption(mDebugText);
-		}
-		catch(...) { /* ignore */ }
-	}
-
-public:
-	// Constructor takes a RenderWindow because it uses that to determine input context
-	ExampleFrameListener(RenderWindow* win, Camera* cam, bool bufferedKeys = false, bool bufferedMouse = false,
-			     bool bufferedJoy = false ) :
-		mCamera(cam), mTranslateVector(Vector3::ZERO), mCurrentSpeed(0), mWindow(win), mStatsOn(true), mNumScreenShots(0),
-		mMoveScale(0.0f), mRotScale(0.0f), mTimeUntilNextToggle(0), mFiltering(TFO_BILINEAR),
-		mAniso(1), mSceneDetailIndex(0), mMoveSpeed(100), mRotateSpeed(36), mDebugOverlay(0),
-		mInputManager(0), mMouse(0), mKeyboard(0), mJoy(0)
-	{
-
-		mDebugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
-
-		LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
-		OIS::ParamList pl;
-		size_t windowHnd = 0;
-		std::ostringstream windowHndStr;
-
-		win->getCustomAttribute("WINDOW", &windowHnd);
-		windowHndStr << windowHnd;
-		pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
-
-		mInputManager = OIS::InputManager::createInputSystem( pl );
-
-		//Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
-		mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, bufferedKeys ));
-		mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, bufferedMouse ));
-		try {
-			mJoy = static_cast<OIS::JoyStick*>(mInputManager->createInputObject( OIS::OISJoyStick, bufferedJoy ));
-		}
-		catch(...) {
-			mJoy = 0;
-		}
-
-		//Set initial mouse clipping size
-		windowResized(mWindow);
-
-		showDebugOverlay(true);
-
-		//Register as a Window listener
-		WindowEventUtilities::addWindowEventListener(mWindow, this);
-	}
-
-	//Adjust mouse clipping area
-	virtual void windowResized(RenderWindow* rw)
-	{
-		unsigned int width, height, depth;
-		int left, top;
-		rw->getMetrics(width, height, depth, left, top);
-
-		const OIS::MouseState &ms = mMouse->getMouseState();
-		ms.width = width;
-		ms.height = height;
-	}
-
-	//Unattach OIS before window shutdown (very important under Linux)
-	virtual void windowClosed(RenderWindow* rw)
-	{
-		//Only close for window that created OIS (the main window in these demos)
-		if( rw == mWindow )
-		{
-			if( mInputManager )
-			{
-				mInputManager->destroyInputObject( mMouse );
-				mInputManager->destroyInputObject( mKeyboard );
-				mInputManager->destroyInputObject( mJoy );
-
-				OIS::InputManager::destroyInputSystem(mInputManager);
-				mInputManager = 0;
-			}
-		}
-	}
-
-	virtual ~ExampleFrameListener()
-	{
-		//Remove ourself as a Window listener
-		WindowEventUtilities::removeWindowEventListener(mWindow, this);
-		windowClosed(mWindow);
-	}
-
-	virtual bool processUnbufferedKeyInput(const FrameEvent& evt)
-	{
-
-		if(mKeyboard->isKeyDown(OIS::KC_A))
-			mTranslateVector.x = -mMoveScale;	// Move camera left
-
-		if(mKeyboard->isKeyDown(OIS::KC_D))
-			mTranslateVector.x = mMoveScale;	// Move camera RIGHT
-
-		if(mKeyboard->isKeyDown(OIS::KC_UP) || mKeyboard->isKeyDown(OIS::KC_W) )
-			mTranslateVector.z = -mMoveScale;	// Move camera forward
-
-		if(mKeyboard->isKeyDown(OIS::KC_DOWN) || mKeyboard->isKeyDown(OIS::KC_S) )
-			mTranslateVector.z = mMoveScale;	// Move camera backward
-
-		if(mKeyboard->isKeyDown(OIS::KC_PGUP))
-			mTranslateVector.y = mMoveScale;	// Move camera up
-
-		if(mKeyboard->isKeyDown(OIS::KC_PGDOWN))
-			mTranslateVector.y = -mMoveScale;	// Move camera down
-
-		if(mKeyboard->isKeyDown(OIS::KC_RIGHT))
-			mCamera->yaw(-mRotScale);
-
-		if(mKeyboard->isKeyDown(OIS::KC_LEFT))
-			mCamera->yaw(mRotScale);
-
-		if( mKeyboard->isKeyDown(OIS::KC_ESCAPE) || mKeyboard->isKeyDown(OIS::KC_Q) )
-			return false;
-
-       	if( mKeyboard->isKeyDown(OIS::KC_F) && mTimeUntilNextToggle <= 0 )
-		{
-			mStatsOn = !mStatsOn;
-			showDebugOverlay(mStatsOn);
-			mTimeUntilNextToggle = 1;
-		}
-
-		if( mKeyboard->isKeyDown(OIS::KC_T) && mTimeUntilNextToggle <= 0 )
-		{
-			switch(mFiltering)
-			{
-			case TFO_BILINEAR:
-				mFiltering = TFO_TRILINEAR;
-				mAniso = 1;
-				break;
-			case TFO_TRILINEAR:
-				mFiltering = TFO_ANISOTROPIC;
-				mAniso = 8;
-				break;
-			case TFO_ANISOTROPIC:
-				mFiltering = TFO_BILINEAR;
-				mAniso = 1;
-				break;
-			default: break;
-			}
-			MaterialManager::getSingleton().setDefaultTextureFiltering(mFiltering);
-			MaterialManager::getSingleton().setDefaultAnisotropy(mAniso);
-
-			showDebugOverlay(mStatsOn);
-			mTimeUntilNextToggle = 1;
-		}
-
-		if(mKeyboard->isKeyDown(OIS::KC_SYSRQ) && mTimeUntilNextToggle <= 0)
-		{
-			std::ostringstream ss;
-			ss << "screenshot_" << ++mNumScreenShots << ".png";
-			mWindow->writeContentsToFile(ss.str());
-			mTimeUntilNextToggle = 0.5;
-			mDebugText = "Saved: " + ss.str();
-		}
-
-		if(mKeyboard->isKeyDown(OIS::KC_R) && mTimeUntilNextToggle <=0)
-		{
-			mSceneDetailIndex = (mSceneDetailIndex+1)%3 ;
-			switch(mSceneDetailIndex) {
-				case 0 : mCamera->setPolygonMode(PM_SOLID); break;
-				case 1 : mCamera->setPolygonMode(PM_WIREFRAME); break;
-				case 2 : mCamera->setPolygonMode(PM_POINTS); break;
-			}
-			mTimeUntilNextToggle = 0.5;
-		}
-
-		static bool displayCameraDetails = false;
-		if(mKeyboard->isKeyDown(OIS::KC_P) && mTimeUntilNextToggle <= 0)
-		{
-			displayCameraDetails = !displayCameraDetails;
-			mTimeUntilNextToggle = 0.5;
-			if (!displayCameraDetails)
-				mDebugText = "";
-		}
-
-		// Print camera details
-		if(displayCameraDetails)
-			mDebugText = "P: " + StringConverter::toString(mCamera->getDerivedPosition()) +
-						 " " + "O: " + StringConverter::toString(mCamera->getDerivedOrientation());
-
-		// Return true to continue rendering
-		return true;
-	}
-
-	virtual bool processUnbufferedMouseInput(const FrameEvent& evt)
-	{
-
-		// Rotation factors, may not be used if the second mouse button is pressed
-		// 2nd mouse button - slide, otherwise rotate
-		const OIS::MouseState &ms = mMouse->getMouseState();
-		if( ms.buttonDown( OIS::MB_Right ) )
-		{
-			mTranslateVector.x += ms.X.rel * 0.13;
-			mTranslateVector.y -= ms.Y.rel * 0.13;
-		}
-		else
-		{
-			mRotX = Degree(-ms.X.rel * 0.13);
-			mRotY = Degree(-ms.Y.rel * 0.13);
-		}
-
-		return true;
-	}
-
-	virtual void moveCamera()
-	{
-		// Make all the changes to the camera
-		// Note that YAW direction is around a fixed axis (freelook style) rather than a natural YAW
-		//(e.g. airplane)
-		mCamera->yaw(mRotX);
-		mCamera->pitch(mRotY);
-		mCamera->moveRelative(mTranslateVector);
-	}
-
-	virtual void showDebugOverlay(bool show)
-	{
-		if (mDebugOverlay)
-		{
-			if (show)
-				mDebugOverlay->show();
-			else
-				mDebugOverlay->hide();
-		}
-	}
-
-	// Override frameRenderingQueued event to process that (don't care about frameEnded)
-	bool frameRenderingQueued(const FrameEvent& evt)
-	{
-
-		if(mWindow->isClosed())	return false;
-
-		mSpeedLimit = mMoveScale * evt.timeSinceLastFrame;
-
-		//Need to capture/update each device
-		mKeyboard->capture();
-		mMouse->capture();
-		if( mJoy ) mJoy->capture();
-
-		bool buffJ = (mJoy) ? mJoy->buffered() : true;
-
-    	Ogre::Vector3 lastMotion = mTranslateVector;
-
-		//Check if one of the devices is not buffered
-		if( !mMouse->buffered() || !mKeyboard->buffered() || !buffJ )
-		{
-			// one of the input modes is immediate, so setup what is needed for immediate movement
-			if (mTimeUntilNextToggle >= 0)
-				mTimeUntilNextToggle -= evt.timeSinceLastFrame;
-
-			// Move about 100 units per second
-			mMoveScale = mMoveSpeed * evt.timeSinceLastFrame;
-			// Take about 10 seconds for full rotation
-			mRotScale = mRotateSpeed * evt.timeSinceLastFrame;
-
-			mRotX = 0;
-			mRotY = 0;
-			mTranslateVector = Ogre::Vector3::ZERO;
-
-		}
-
-		//Check to see which device is not buffered, and handle it
-		if( !mKeyboard->buffered() )
-			if( processUnbufferedKeyInput(evt) == false )
-				return false;
-		if( !mMouse->buffered() )
-			if( processUnbufferedMouseInput(evt) == false )
-				return false;
-
-		// ramp up / ramp down speed
-    	if (mTranslateVector == Ogre::Vector3::ZERO)
-		{
-			// decay (one third speed)
-			mCurrentSpeed -= evt.timeSinceLastFrame * 0.3;
-			mTranslateVector = lastMotion;
-		}
-		else
-		{
-			// ramp up
-			mCurrentSpeed += evt.timeSinceLastFrame;
-
-		}
-		// Limit motion speed
-		if (mCurrentSpeed > 1.0)
-			mCurrentSpeed = 1.0;
-		if (mCurrentSpeed < 0.0)
-			mCurrentSpeed = 0.0;
-
-		mTranslateVector *= mCurrentSpeed;
-
-
-		if( !mMouse->buffered() || !mKeyboard->buffered() || !buffJ )
-			moveCamera();
-
-		return true;
-	}
-
-	bool frameEnded(const FrameEvent& evt)
-	{
-		updateStats();
-		return true;
-	}
-
-protected:
-	Camera* mCamera;
-
-	Vector3 mTranslateVector;
-	Real mCurrentSpeed;
-	RenderWindow* mWindow;
-	bool mStatsOn;
-
-	std::string mDebugText;
-
-	unsigned int mNumScreenShots;
-	float mMoveScale;
-	float mSpeedLimit;
-	Degree mRotScale;
-	// just to stop toggles flipping too fast
-	Real mTimeUntilNextToggle ;
-	Radian mRotX, mRotY;
-	TextureFilterOptions mFiltering;
-	int mAniso;
-
-	int mSceneDetailIndex ;
-	Real mMoveSpeed;
-	Degree mRotateSpeed;
-	Overlay* mDebugOverlay;
-
-	//OIS Input devices
-	OIS::InputManager* mInputManager;
-	OIS::Mouse*    mMouse;
-	OIS::Keyboard* mKeyboard;
-	OIS::JoyStick* mJoy;
-};
-
-#endif

ogre-lib3ds/OgreApplication.cpp

+#include "precompiled.h"
+
+#include "OgreApplication.h"
+
+using namespace Ogre;
+
+
+//-----------------------------------------------------------------------------
+OgreApplication::OgreApplication(const String &_title)
+    :mWindowTitle(_title)
+	,mRoot(NULL)
+    ,mCamera(NULL)
+    ,mSceneMgr(NULL)
+    ,mWindow(NULL)
+    ,mInputManager(NULL)
+    ,mKeyboard(NULL)
+    ,mMouse(NULL)
+    ,mRotateSpeed(0.5)
+{
+	
+}
+//-----------------------------------------------------------------------------
+OgreApplication::~OgreApplication()
+{
+    delete mRoot;
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::go()
+{
+    if (!initialise())
+        return;
+
+    mRoot->startRendering();
+
+    // clean up
+    destroyScene();
+}
+//-----------------------------------------------------------------------------
+bool OgreApplication::initialise()
+{
+    mRoot = new Root();
+
+    // add resource locations
+    addResourceLocations();
+
+    // if we cannot initialise Ogre, just abandon the whole deal
+    if ( !initOgreCore() ) return false;
+
+    createSceneManager();
+    createCamera();
+    createViewports();
+
+    // Set default mipmap level (NB some APIs ignore this)
+    TextureManager::getSingleton().setDefaultNumMipmaps(5);
+
+    // Create any resource listeners (for loading screens)
+    createResourceListener();
+
+    // Initialise resources
+    initResources();
+
+    // Create the scene
+    createScene();
+
+    createInputSystem();
+    createFrameListener();
+	_createDebugOverlay();
+
+    return true;
+}
+//-----------------------------------------------------------------------------
+bool OgreApplication::initOgreCore()
+{
+    // Show the configuration dialog and initialise the system
+    // You can skip this and use root.restoreConfig() to load configuration
+    // settings if you were sure there are valid ones saved in ogre.cfg
+    if(mRoot->restoreConfig() || mRoot->showConfigDialog())
+    {
+        // If returned true, user clicked OK so initialise
+        // Here we choose to let the system create a default rendering window by passing 'true'
+        mWindow = mRoot->initialise(true, mWindowTitle);
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::createSceneManager()
+{
+    mSceneMgr = mRoot->createSceneManager(ST_GENERIC);
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::createCamera()
+{
+    // Create the camera
+    mCamera = mSceneMgr->createCamera("PlayerCam");
+
+    mCamera->setNearClipDistance(1);
+
+    mCameraBaseNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("Camera Base Node");
+    mCameraTargetNode = mCameraBaseNode->createChildSceneNode("Camera Target Node");
+    mCameraNode = mCameraTargetNode->createChildSceneNode("Camera Node");
+    mCameraNode->attachObject(mCamera);
+
+    mCameraNode->translate(Vector3(0, 0, 200));
+
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::createViewports()
+{
+    // Create one viewport, entire window
+    Viewport* vp = mWindow->addViewport(mCamera);
+    vp->setBackgroundColour(ColourValue(0.5,0.5,0.5));
+
+    // Alter the camera aspect ratio to match the viewport
+    mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+    mCamera->setQueryFlags(0);
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::createResourceListener(){}
+//-----------------------------------------------------------------------------
+void OgreApplication::createFrameListener()
+{
+    mRoot->addFrameListener(this);
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::createInputSystem()
+{
+    OIS::ParamList pl;
+    size_t windowHnd = 0;
+    std::ostringstream windowHndStr;
+    mWindow->getCustomAttribute("WINDOW", &windowHnd);
+    windowHndStr << windowHnd;
+    pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+    
+
+    mInputManager = OIS::InputManager::createInputSystem( pl );
+
+    mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
+    mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, true));
+
+
+    unsigned int width, height, depth;
+    int top, left;
+    mWindow->getMetrics(width, height, depth, left, top);
+    const OIS::MouseState &ms = mMouse->getMouseState();
+    ms.width = width;
+    ms.height = height;
+
+    mMouse->setEventCallback(this);
+    mKeyboard->setEventCallback(this);
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::addResourceLocations()
+{
+    // Load resource paths from config file
+    ConfigFile cf;
+    cf.load("resources.cfg");
+
+    // Go through all sections & settings in the file
+    ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+    String secName, typeName, archName;
+    while (seci.hasMoreElements())
+    {
+        secName = seci.peekNextKey();
+        ConfigFile::SettingsMultiMap *settings = seci.getNext();
+        ConfigFile::SettingsMultiMap::iterator i;
+        for (i = settings->begin(); i != settings->end(); ++i)
+        {
+            typeName = i->first;
+            archName = i->second;
+            ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
+        }
+    }
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::initResources()
+{
+    // Initialise, parse scripts etc
+    ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::destroyScene()
+{
+//    mInputManager->destroyInputObject(mMouse);
+//    mInputManager->destroyInputObject(mKeyboard);
+//    OIS::InputManager::destroyInputSystem(mInputManager);
+
+    mSceneMgr->destroyAllEntities();
+}
+//-----------------------------------------------------------------------------
+//Adjust mouse clipping area
+void OgreApplication::windowResized(RenderWindow* rw)
+{
+    unsigned int width, height, depth;
+    int left, top;
+    rw->getMetrics(width, height, depth, left, top);
+
+    const OIS::MouseState &ms = mMouse->getMouseState();
+    ms.width = width;
+    ms.height = height;
+}
+//-----------------------------------------------------------------------------
+//Unattach OIS before window shutdown (very important under Linux)
+void OgreApplication::windowClosed(RenderWindow* rw)
+{
+    //Only close for window that created OIS (the main window in these demos)
+    if( rw == mWindow )
+    {
+        if( mInputManager )
+        {
+            mInputManager->destroyInputObject( mMouse );
+            mInputManager->destroyInputObject( mKeyboard );
+
+            OIS::InputManager::destroyInputSystem(mInputManager);
+            mInputManager = 0;
+        }
+    }
+}
+//-----------------------------------------------------------------------------
+bool OgreApplication::frameStarted(const FrameEvent& evt)
+{
+	_updateDebugOverlay();
+    mKeyboard->capture();
+    mMouse->capture();
+    if (mKeyboard->isKeyDown(OIS::KC_ESCAPE))
+        return false;
+
+    return true;
+}
+//-----------------------------------------------------------------------------
+bool OgreApplication::frameEnded(const FrameEvent& evt)
+{
+    return true;
+}
+//-----------------------------------------------------------------------------
+bool OgreApplication::keyPressed( const OIS::KeyEvent &e )
+{
+    return true;
+}
+//-----------------------------------------------------------------------------
+bool OgreApplication::keyReleased( const OIS::KeyEvent &e )
+{
+    return true;
+}
+//-----------------------------------------------------------------------------
+bool OgreApplication::mouseMoved( const OIS::MouseEvent &e )
+{
+
+    if (e.state.buttonDown(OIS::MB_Right))
+    {
+        int dx = e.state.X.rel * mRotateSpeed;
+        int dy = e.state.Y.rel * mRotateSpeed;
+
+        mCameraTargetNode->yaw(Degree(dx), SceneNode::TS_PARENT);
+        mCameraTargetNode->pitch(Degree(dy)/*, SceneNode::TS_PARENT*/);
+    }
+    else if (e.state.buttonDown(OIS::MB_Middle))
+    {
+        int dy = e.state.Y.rel;
+
+        mCameraNode->translate(Vector3(0.0, 0.0, dy)); 
+    }
+
+       
+   return true;
+}
+//-----------------------------------------------------------------------------
+bool OgreApplication::mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id )
+{
+    return true;
+}
+//-----------------------------------------------------------------------------
+bool OgreApplication::mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id )
+{
+    return true;
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::_createGrid(int _units)
+{
+    SceneNode *gridNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("WorldGrid Node");
+    ManualObject *axes = mSceneMgr->createManualObject("AXES");
+
+
+    axes->begin("WorldGrid/Axes", RenderOperation::OT_LINE_LIST);
+    // X axis
+    axes->position(-_units, 0.0, 0.0);     
+    axes->colour(0.1, 0.0, 0.0);
+    
+    axes->position( _units, 0.0, 0.0);     
+    axes->colour(1.0, 0.0, 0.0);
+    
+    // Y Axis
+    axes->position(0.0, -_units, 0.0);     
+    axes->colour(0.0, 0.1, 0.0);
+    
+    axes->position(0.0,  _units, 0.0);     
+    axes->colour(0.0, 1.0, 0.0);
+  
+    // Z axis
+    axes->position( 0.0, 0.0, -_units);     
+    axes->colour(0.0, 0.0, 0.1);
+    
+    axes->position( 0.0, 0.0,  _units);  
+    axes->colour(0.0, 0.0, 1.0);
+    
+    axes->end();
+    gridNode->attachObject(axes);
+    axes->setQueryFlags(0x00);
+
+    ManualObject *grid = mSceneMgr->createManualObject("Grid Lines");
+
+    grid->begin("WorldGrid/Lines", RenderOperation::OT_LINE_LIST);
+    float c;
+    for (int i = 10; i<=_units ; i+=10)
+    {
+        c = (i%100) ? 0.6 : 0.7;
+
+        grid->position(-_units, 0, i);
+        grid->colour(c, c, c);
+        grid->position( _units, 0, i);
+        grid->colour(c, c, c);
+
+        grid->position(-_units, 0, -i);
+        grid->colour(c, c, c);
+        grid->position( _units, 0, -i);
+        grid->colour(c, c, c);
+
+
+        grid->position(i, 0, -_units);
+        grid->colour(c, c, c);
+        grid->position(i, 0,  _units);
+        grid->colour(c, c, c);
+
+        grid->position(-i, 0, -_units);
+        grid->colour(c, c, c);
+        grid->position(-i, 0,  _units);
+        grid->colour(c, c, c);
+    }
+
+
+    grid->end();
+    grid->setQueryFlags(0x00);
+    gridNode->attachObject(grid);
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::_createLight()
+{
+    assert(mCameraNode);
+    mLight = mSceneMgr->createLight("main light");
+	mLight->setType(Light::LT_POINT);
+	mLight->setDiffuseColour(ColourValue::White);
+	mLight->setSpecularColour(ColourValue::White);
+
+    mCameraNode->attachObject(mLight);
+
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::_createDebugOverlay()
+{
+	new TextRenderer();
+
+	mDebugText = TextRenderer::getSingletonPtr();
+
+	int x_offset=100, y_offset=18, w=100, h=18;
+
+	mDebugText->addTextBox("Batches_", "#Batches : "
+		, 10, 10, w, h
+		, ColourValue(0.7,0.7,0.7));
+	mDebugText->addTextBox("Batches", "0"
+		, x_offset, 10, w, h
+		, ColourValue(1.0,1.0,1.0));
+	mDebugText->addTextBox("FPS_", "#FPS : "
+		, 10, 10+y_offset, w, h
+		, ColourValue(0.7,0.7,0.7));
+	mDebugText->addTextBox("FPS", "0"
+		, x_offset, 10+y_offset, w, h
+		, ColourValue(1.0,1.0,1.0));
+
+	mDebugText->addTextBox("Triangles_", "#tris : "
+		, 10, 10+y_offset*2, w, h
+		, ColourValue(0.7,0.7,0.7));
+	mDebugText->addTextBox("Triangles", "0"
+		, x_offset, 10+y_offset*2, w, h
+		, ColourValue(1.0,1.0,1.0));
+
+
+
+}
+//-----------------------------------------------------------------------------
+void OgreApplication::_updateDebugOverlay()
+{
+	mDebugText->setText("Batches", StringConverter::toString(mWindow->getBatchCount()));
+	mDebugText->setText("FPS", StringConverter::toString(mWindow->getLastFPS()));
+	mDebugText->setText("Triangles", StringConverter::toString(mWindow->getTriangleCount()));
+}
+//-----------------------------------------------------------------------------

ogre-lib3ds/OgreApplication.h

+#ifndef __OgreApplication_h__
+#define __OgreApplication_h__
+
+#include <Ogre.h>
+#include <OIS/OIS.h>
+#include <CEGUI/CEGUI.h>
+
+#include "TextRenderer.h"
+
+using namespace Ogre;
+
+class OgreApplication	: public FrameListener
+						, public WindowEventListener 
+						, public OIS::MouseListener
+						, public OIS::KeyListener
+{
+public:
+   OgreApplication(const String&);
+   virtual ~OgreApplication();
+
+   virtual void go();
+
+protected:
+   virtual bool initialise();
+   virtual bool initOgreCore();
+
+   virtual void createSceneManager();
+   virtual void createCamera();
+   virtual void createViewports();
+   virtual void createResourceListener();
+   virtual void createFrameListener();
+   virtual void createInputSystem();
+
+   virtual void addResourceLocations();
+   virtual void initResources();
+
+   virtual void createScene() = 0; // I am pure virtual, override me!
+   virtual void destroyScene();
+
+   // WindowEventListener
+    virtual void windowResized(RenderWindow* rw);
+    virtual void windowClosed(RenderWindow* rw);
+
+   // FrameListener overrides 
+   virtual bool frameStarted(const FrameEvent& evt); 
+   virtual bool frameEnded(const FrameEvent& evt); 
+
+   // OIS crap
+   virtual bool keyPressed( const OIS::KeyEvent &e );
+   virtual bool keyReleased( const OIS::KeyEvent &e );
+
+   virtual bool mouseMoved( const OIS::MouseEvent &e );
+   virtual bool mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id );
+   virtual bool mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id );
+
+
+protected:
+    void _createGrid(int);
+	void _createLight();
+	void _createDebugOverlay();
+	void _updateDebugOverlay();
+
+	String mWindowTitle;
+	Root *mRoot;
+    Camera* mCamera;
+    SceneManager* mSceneMgr;
+    RenderWindow* mWindow;
+
+    SceneNode *mCameraNode, *mCameraTargetNode, *mCameraBaseNode;
+    Real mRotateSpeed;
+
+    OIS::InputManager *mInputManager;
+    OIS::Keyboard *mKeyboard;
+    OIS::Mouse *mMouse;
+
+	BillboardSet *mBBset;
+	Billboard *mLightFlare;
+	Light *mLight;
+	SceneNode *mLightNode;
+
+	TextRenderer *mDebugText;
+};
+ 
+#endif // __OgreApplication_h__

ogre-lib3ds/Test3DSViewerApp.cpp

 
 
 Test3DSViewerApp::Test3DSViewerApp(void)
-:mDummyCnt(0)
-,mNodeCnt(0)
+    :OgreApplication("3DS loader")
+    ,mDummyCnt(0)
+    ,mNodeCnt(0)
 {
 }
 
     m3dsBuildLog = LogManager::getSingleton().createLog("3dsbuild.log");
 
     mSceneMgr->setNormaliseNormalsOnScale(true);
-    _createGrid(500);
-    mCamera->setPosition(100, 100, 100);
-    mCamera->lookAt(Vector3::ZERO);
+    _createGrid(1000);
+    _createLight();
+    /*mCamera->setPosition(100, 100, 100);
+    mCamera->lookAt(Vector3::ZERO);*/
 
-    //_build3dsModel();
-    _buildRadiator();
+    _build3dsModel();
+    //_buildRadiator();
 
 
-    mBBset = mSceneMgr->createBillboardSet("Light BB");
-    mBBset->setMaterialName("Objects/Flare");
-    mLightFlare = mBBset->createBillboard(Vector3::ZERO);
-
-    mLight = mSceneMgr->createLight("main light");
-    mLight->setType(Light::LT_POINT);
-    mLight->setDiffuseColour(ColourValue::White);
-    mLight->setSpecularColour(ColourValue::White);
-
-    mLightNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("light node");
-    mLightNode->attachObject(mLight);
-    mLightNode->attachObject(mBBset);
-    mLightNode->setPosition(-300, 100, -200);
-    //mLightNode->setPosition(0, 100, 0);
     
 }
 //------------------------------------------------------------------------------
-void Test3DSViewerApp::_createGrid(int _units)
-{
-    SceneNode *gridNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("WorldGrid Node");
-    ManualObject *axes = mSceneMgr->createManualObject("AXES");
-
-
-    axes->begin("WorldGrid/Axes", RenderOperation::OT_LINE_LIST);
-    // X axis
-    axes->position(-_units, 0.0, 0.0);     
-    axes->colour(0.1, 0.0, 0.0);
-
-    axes->position( _units, 0.0, 0.0);     
-    axes->colour(1.0, 0.0, 0.0);
-
-    // Y Axis
-    axes->position(0.0, -_units, 0.0);     
-    axes->colour(0.0, 0.1, 0.0);
-
-    axes->position(0.0,  _units, 0.0);     
-    axes->colour(0.0, 1.0, 0.0);
-
-    // Z axis
-    axes->position( 0.0, 0.0, -_units);     
-    axes->colour(0.0, 0.0, 0.1);
-
-    axes->position( 0.0, 0.0,  _units);  
-    axes->colour(0.0, 0.0, 1.0);
-
-    axes->end();
-    gridNode->attachObject(axes);
-    axes->setQueryFlags(0x00);
-
-    ManualObject *grid = mSceneMgr->createManualObject("Grid Lines");
-
-    grid->begin("WorldGrid/Lines", RenderOperation::OT_LINE_LIST);
-    float c;
-    for (int i = 10; i<=_units ; i+=10)
-    {
-        c = (i%100) ? 0.3 : 0.5;
-
-        grid->position(-_units, 0, i);
-        grid->colour(c, c, c);
-        grid->position( _units, 0, i);
-        grid->colour(c, c, c);
-
-        grid->position(-_units, 0, -i);
-        grid->colour(c, c, c);
-        grid->position( _units, 0, -i);
-        grid->colour(c, c, c);
-
-
-        grid->position(i, 0, -_units);
-        grid->colour(c, c, c);
-        grid->position(i, 0,  _units);
-        grid->colour(c, c, c);
-
-        grid->position(-i, 0, -_units);
-        grid->colour(c, c, c);
-        grid->position(-i, 0,  _units);
-        grid->colour(c, c, c);
-    }
-
-
-    grid->end();
-    grid->setQueryFlags(0x00);
-    gridNode->attachObject(grid);
-}
-//------------------------------------------------------------------------------
 void Test3DSViewerApp::_build3dsModel()
 {
     SceneNode *modelNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("3ds model");
  
     //m3dsFile =  lib3ds_file_open("../media/3ds/test3.3DS");
-    //m3dsFile =  lib3ds_file_open("../media/3ds/indochine.3DS");
+    m3dsFile =  lib3ds_file_open("../media/3ds/indochine.3DS");
     //m3dsFile =  lib3ds_file_open("../media/3ds/monaco.3DS");
     //m3dsFile =  lib3ds_file_open("../media/3ds/amphimath_walls.3DS");
-    m3dsFile =  lib3ds_file_open("../media/3ds/amphimath2.3DS");
+    //m3dsFile =  lib3ds_file_open("../media/3ds/lyon.3DS");
+    //m3dsFile =  lib3ds_file_open("../media/3ds/Kengresshus-visuelle.3DS");
+    //m3dsFile =  lib3ds_file_open("../media/3ds/casa_de_musica-visuelle.3DS");
     //m3dsFile =  lib3ds_file_open("../media/3ds/Modern-home-interior1.3DS");
     //m3dsFile =  lib3ds_file_open("../media/3ds/test.3DS");
     //m3dsFile =  lib3ds_file_open("../media/3ds/chienvert.3DS");
 
     lib3ds_file_eval(m3dsFile, 0);
 
+    mAABB = Ogre::AxisAlignedBox::BOX_NULL;
+
     _createMeshesFrom3dsFile(m3dsFile);
     _buildSceneFromNode(m3dsFile->nodes, modelNode, "/", 0, false);
 
     //_buildSubtree( m3dsFile->nodes, "/", modelNode);
 
-    //modelNode->scale(0.1, 0.1, 0.1);
+
+    Real width = mAABB.getSize()[0];
+    Real scale = 1000.0/width;
+    modelNode->scale(scale, scale, scale);
     modelNode->pitch(Degree(-90));
 
     lib3ds_file_free(m3dsFile);
         // create an ogre object for easy OgreMesh conversion
         // Gray = default material
         // TODO: better default material
-        newObject->begin("Gray", RenderOperation::OT_TRIANGLE_LIST);
+        newObject->begin("3DS/Gray", RenderOperation::OT_TRIANGLE_LIST);
 
         int idx = 0;
         // foreach tri
                 m3dsBuildLog->logMessage("");
             }
 
-            newNode = newNode->createChildSceneNode(fullName+"pivot node", Vector3(-n->pivot[0], -n->pivot[1], -n->pivot[2]));
+            newNode = newNode->createChildSceneNode(fullName+"pivot node"
+                                                    , Vector3(-n->pivot[0]
+                                                            , -n->pivot[1]
+                                                            , -n->pivot[2]));
             newNode->setVisible(!(bool)n->hide);
             {
                 // log node xforms
                 _logXformMatrix(meshMatrix, spaces, "mesh matrix : ");
 
                 MeshPtr meshToAdd = mCenteredMeshes[meshName];
-                
-                if (meshName == "Box210" ||meshName == "Loft394")
-                {
-
-                    MeshSerializer serializer;
-                    serializer.exportMesh(&(*meshToAdd), meshName+".mesh");
-                }
 
                 if(! meshToAdd.isNull())
                 {
-                    if(_show)
+                    if(1)//_show)
                     {
 
-                        Entity *ent = mSceneMgr->createEntity(fullName+" Ent", mCenteredMeshes[meshName]->getName());
+                        Entity *ent = mSceneMgr->createEntity(fullName+" Ent"
+                                                            , mCenteredMeshes[meshName]->getName());
                         newNode->attachObject(ent);
+
+                        {
+                            Ogre::Vector3 pos = ent->getParentSceneNode()->_getDerivedPosition();
+                            Ogre::Vector3 scale = ent->getParentSceneNode()->_getDerivedScale();
+                            Ogre::Quaternion rotation = ent->getParentSceneNode()->_getDerivedOrientation();
+
+                            const Ogre::Vector3 * corners = ent->getBoundingBox().getAllCorners();
+
+                            for (int i=0 ; i<8 ; i++)
+                            {
+                                mAABB.merge(pos + rotation * corners[i] * scale);
+                            }
+                        }
                     }
                 }
             }
 
             m3dsBuildLog->logMessage("\n\n\n");
+            
+            
 
             _buildSceneFromNode(p->childs, newNode, fullName, _level+1, _show);
         }
     //basePos = Vector3(-1062.25, -1199.29, -775.482);
     basePos = Vector3(0, 0, 0);
 
-    baseNode->scale(baseScl);
+    //baseNode->scale(baseScl);
     baseNode->rotate(baseRot);
-    baseNode->translate(basePos);
+    //baseNode->translate(basePos);
+
 
     Matrix4 boxMatrix, loftMatrix, baseMatrix;
     

ogre-lib3ds/Test3DSViewerApp.h

 
 
 #include "MovableText.h"
-#include "ExampleApplication.h"
+#include "OgreApplication.h"
 
 
     
 using namespace Ogre;
 
 class Test3DSViewerApp :
-    public ExampleApplication
+    public OgreApplication
 {
 public:
     Test3DSViewerApp(void);
     void createScene();
     
 protected:
-    void _createGrid(int);
+    //void _createGrid(int);
 
     void _buildRadiator();
 
 
     ManualObject *mObjectBuilder;
 
-    BillboardSet *mBBset;
-    Billboard *mLightFlare;
-    Light *mLight;
-    SceneNode *mLightNode;
-
     std::map<std::string, MeshPtr> mMeshes;
     std::list<MeshPtr> mMeshVect;
 
     std::map<std::string, MeshPtr> mCenteredMeshes;
     std::map<std::string, MovableTextPtr> mNodeLabels;
 
+    Ogre::AxisAlignedBox mAABB;
 };

ogre-lib3ds/ogre-lib3ds.vcproj

 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="&quot;$(BOOST_HOME)&quot;;&quot;$(OGRE_HOME)\include&quot;;&quot;..\Dependencies\lib3ds-20080909\src&quot;"
+				AdditionalIncludeDirectories="&quot;$(BOOST136_HOME)&quot;;&quot;$(OGRE16_HOME)\include&quot;;&quot;..\Dependencies\lib3ds-20080909\src&quot;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				Name="VCLinkerTool"
 				AdditionalDependencies="OgreMain_d.lib OIS_d.lib lib3ds-2_0.lib"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="&quot;$(OGRE_HOME)\lib&quot;;&quot;..\Dependencies\lib3ds-20080909\$(ConfigurationName)&quot;"
+				AdditionalLibraryDirectories="&quot;$(OGRE16_HOME)\lib&quot;;&quot;..\Dependencies\lib3ds-20080909\$(ConfigurationName)&quot;"
 				GenerateDebugInformation="true"
 				SubSystem="2"
 				TargetMachine="1"
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
-				AdditionalIncludeDirectories="&quot;$(BOOST_HOME)&quot;;&quot;$(OGRE_HOME)\include&quot;;&quot;..\Dependencies\lib3ds-20080909\src&quot;"
+				AdditionalIncludeDirectories="&quot;$(BOOST136_HOME)&quot;;&quot;$(OGRE16_HOME)\include&quot;;&quot;..\Dependencies\lib3ds-20080909\src&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
 				Name="VCLinkerTool"
 				AdditionalDependencies="OgreMain.lib OIS.lib lib3ds-2_0.lib"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories="&quot;$(OGRE_HOME)\lib&quot;;&quot;..\Dependencies\lib3ds-20080909\$(ConfigurationName)&quot;"
+				AdditionalLibraryDirectories="&quot;$(OGRE16_HOME)\lib&quot;;&quot;..\Dependencies\lib3ds-20080909\$(ConfigurationName)&quot;"
 				GenerateDebugInformation="true"
 				SubSystem="2"
 				OptimizeReferences="2"
 				>
 			</File>
 			<File
+				RelativePath=".\OgreApplication.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\precompiled.cpp"
 				>
 				<FileConfiguration
 				>
 			</File>
 			<File
+				RelativePath=".\OgreApplication.h"
+				>
+			</File>
+			<File
 				RelativePath=".\precompiled.h"
 				>
 			</File>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.