Added makefiles to examples.
Added makefiles to examples.

--- /dev/null
+++ b/examples/Affectors/Makefile
@@ -1,1 +1,10 @@
+OBJS=main.o affectorsexample.o ../framework/exampleframework.o
+APP=Affectors
 
+CFLAGS=-I/home/kkrizka/dev/irrlicht-svn/include/irrlicht -I/home/kkrizka/dev/irrbullet-svn/include/irrBullet -g `pkg-config bullet --cflags`
+CXXFLAGS=${CFLAGS}
+LDFLAGS= -g `pkg-config bullet --libs` -lIrrlicht -L/home/kkrizka/dev/irrlicht-svn/lib -lIrrBullet -L/home/kkrizka/dev/irrbullet-svn/lib -lbz2
+
+all: ${OBJS}
+	g++ ${LDFLAGS} -o ${APP} ${OBJS}
+

--- a/examples/Affectors/affectorsexample.cpp
+++ b/examples/Affectors/affectorsexample.cpp
@@ -1,5 +1,5 @@
 #include <irrlicht.h>

-#include <irrBullet.h>

+#include <irrbullet.h>

 #include "affectorsexample.h"

 

 


--- /dev/null
+++ b/examples/Collision/Makefile
@@ -1,1 +1,10 @@
+OBJS=main.o collisionexample.o ../framework/exampleframework.o
+APP=Collision
 
+CFLAGS=-I/home/kkrizka/dev/irrlicht-svn/include/irrlicht -I/home/kkrizka/dev/irrbullet-svn/include/irrBullet -g `pkg-config bullet --cflags`
+CXXFLAGS=${CFLAGS}
+LDFLAGS= -g `pkg-config bullet --libs` -lIrrlicht -L/home/kkrizka/dev/irrlicht-svn/lib -lIrrBullet -L/home/kkrizka/dev/irrbullet-svn/lib -lbz2
+
+all: ${OBJS}
+	g++ ${LDFLAGS} -o ${APP} ${OBJS}
+

--- a/examples/Collision/collisionexample.cpp
+++ b/examples/Collision/collisionexample.cpp
@@ -10,7 +10,7 @@
 

 CCollisionExample::CCollisionExample()

 {

-    //ctor

+  //ctor

 }

 

 // To add a rigid body with collision masks, simply add two extra parameters to the creation code:

@@ -18,211 +18,210 @@
 // instead of world->addRigidBody(shape)

 void CCollisionExample::createGround()

 {

-    ISceneNode *Node = device->getSceneManager()->addCubeSceneNode(1.0);

-	Node->setScale(vector3df(600,3,600)); // 400, 3, 400

-	Node->setPosition(vector3df(200,0,100));

-	Node->setMaterialFlag(video::EMF_LIGHTING, true);

-	Node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);

-	Node->setMaterialTexture(0, device->getVideoDriver()->getTexture("rockwall.jpg"));

-

-    if(drawWireFrame)

-        Node->setMaterialFlag(EMF_WIREFRAME, true);

-

-	ICollisionShape *shape = new IBoxShape(Node, 0, false);

-

-	IRigidBody *body;

-	body = world->addRigidBody(shape);

+  ISceneNode *Node = device->getSceneManager()->addCubeSceneNode(1.0);

+  Node->setScale(vector3df(600,3,600)); // 400, 3, 400

+  Node->setPosition(vector3df(200,0,100));

+  Node->setMaterialFlag(video::EMF_LIGHTING, true);

+  Node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);

+  Node->setMaterialTexture(0, device->getVideoDriver()->getTexture("rockwall.jpg"));

+

+  if(drawWireFrame)

+    Node->setMaterialFlag(EMF_WIREFRAME, true);

+

+  ICollisionShape *shape = new IBoxShape(Node, 0, false);

+  

+  IRigidBody *body;

+  body = world->addRigidBody(shape);

 }

 

 bool CCollisionExample::OnEvent(const SEvent& event)

 {

-	if (!device)

-		return false;

-

-    switch(event.EventType)

-    {

-        case EET_MOUSE_INPUT_EVENT:

+  if (!device)

+    return false;

+  

+  switch(event.EventType)

+    {

+    case EET_MOUSE_INPUT_EVENT:

+      {

+	if(event.MouseInput.Event==EMIE_LMOUSE_PRESSED_DOWN)

+	  {

+	    shootCube(vector3df(2,2,2), 1);

+	    return true;

+	  }

+	else

+	  if(event.MouseInput.Event==EMIE_RMOUSE_PRESSED_DOWN)

+            {

+	      shootSphere(vector3df(0.2,0.2,0.2), 0.2);

+	      return true;

+            }

+      }

+      break;

+      

+    case EET_KEY_INPUT_EVENT:

+      {

+	if(event.KeyInput.Key == KEY_KEY_P && event.KeyInput.PressedDown == false)

+	  {

+	    world->pauseSimulation(!world->simulationPaused());

+	    return true;

+	  }

+      }

+      break;

+    default:

+      break;

+    }

+  return false;

+}

+

+void CCollisionExample::runExample()

+{

+  debugDraw = true;

+  drawProperties = true;

+  drawWireFrame = false;

+  

+  u32 rows = 10;

+  u32 columns = 10;

+  

+  device =

+    createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 16,

+		  false, false, false, this);

+  

+  

+  device->setWindowCaption(L"irrBullet Collision Example");

+  

+  device->getFileSystem()->addFolderFileArchive("../../media/");

+  

+  

+  device->getSceneManager()->addLightSceneNode(0, vector3df(20, 40, -50), SColorf(1.0f, 1.0f, 1.0f), 4000.0f);

+  

+  

+  

+  ////////////////////////////

+  // Create irrBullet World //

+  ////////////////////////////

+  world = createIrrBulletWorld(device, true, debugDraw);

+  

+  world->setDebugMode(EPDM_DrawAabb |

+		      EPDM_DrawContactPoints);

+  

+  world->setGravity(vector3df(0,-10,0));

+  

+  createGround();

+  

+  

+  for(int i=0; i < 8; i++)

+    {

+      srand(device->getTimer()->getTime());

+      

+      u32 force = rand() % 40 + 20;

+      

+      createTank(L"JagdPanther.b3d", L"JagdPanther.b3d", vector3df((i*40),5,-120), 12);

+      static_cast<IRigidBody*>(world->getCollisionObjectByIndex(world->getNumCollisionObjects()-1))->setLinearVelocity(vector3df(0,0,force));

+    }

+  

+  camera = device->getSceneManager()->addCameraSceneNodeFPS();

+  camera->setPosition(vector3df(50,15,4));

+  camera->setTarget(static_cast<IRigidBody*>(world->getCollisionObjectByName("Tank"))->getWorldTransform().getTranslation());

+  

+  

+  // Set our delta time and time stamp

+  u32 TimeStamp = device->getTimer()->getTime();

+  u32 DeltaTime = 0;

+  while(device->run())

+    {

+      device->getVideoDriver()->beginScene(true, true, SColor(255,100,101,140));

+      

+      DeltaTime = device->getTimer()->getTime() - TimeStamp;

+      TimeStamp = device->getTimer()->getTime();

+      

+      // Step the simulation with our delta time

+      world->stepSimulation(DeltaTime*0.001f, 120);

+      

+      handleCollisions();

+      

+      

+      world->debugDrawWorld(debugDraw);

+      // This call will draw the technical properties of the physics simulation

+      // to the GUI environment.

+      world->debugDrawProperties(drawProperties);

+      

+      

+      device->getSceneManager()->drawAll();

+      device->getGUIEnvironment()->drawAll();

+      

+      device->getVideoDriver()->endScene();

+    }

+  

+  // We're done with the IrrBullet world, so we free the memory that it takes up.

+  if(world)

+    delete world;

+  

+  if(device)

+    device->drop();

+}

+

+void CCollisionExample::handleCollisions()

+{

+  for(int i=0; i < world->getNumManifolds(); i++)

+    {

+      ICollisionCallbackInformation *info = world->getCollisionCallback(i);

+      

+      bool hasCollideAttribute = (info->getBody0()->getAttributes()->existsAttribute("collide"));

+      ICollisionObject* obj = (hasCollideAttribute) ? info->getBody0() : info->getBody1();

+      

+      if(obj->getAttributes()->existsAttribute("collide") && obj->getAttributes()->getAttributeAsBool("collide") == true)

         {

-            if(event.MouseInput.Event==EMIE_LMOUSE_PRESSED_DOWN)

+	  obj->getAttributes()->setAttribute("collide", false);

+	  world->addToDeletionQueue(obj);

+        }

+      

+      obj = (hasCollideAttribute) ? info->getBody1() : info->getBody0();

+      if(obj->getAttributes()->existsAttribute("vehicle"))

+        {

+	  if(obj->getAttributes()->existsAttribute("destroyable"))

             {

-                shootCube(vector3df(2,2,2), 1);

-                return true;

-            }

-

-            else

-            if(event.MouseInput.Event==EMIE_RMOUSE_PRESSED_DOWN)

-            {

-                shootSphere(vector3df(0.2,0.2,0.2), 0.2);

-                return true;

-            }

-        }

-        break;

-

-        case EET_KEY_INPUT_EVENT:

-        {

-            if(event.KeyInput.Key == KEY_KEY_P && event.KeyInput.PressedDown == false)

-            {

-                world->pauseSimulation(!world->simulationPaused());

-                return true;

-            }

-        }

-        break;

-        default:

-            break;

-    }

-    return false;

-}

-

-void CCollisionExample::runExample()

-{

-    debugDraw = true;

-    drawProperties = true;

-    drawWireFrame = false;

-

-    u32 rows = 10;

-	u32 columns = 10;

-

-    device =

-        createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 16,

-            false, false, false, this);

-

-

-    device->setWindowCaption(L"irrBullet Collision Example");

-

-    device->getFileSystem()->addFolderFileArchive("../../media/");

-

-

-    device->getSceneManager()->addLightSceneNode(0, vector3df(20, 40, -50), SColorf(1.0f, 1.0f, 1.0f), 4000.0f);

-

-

-

-    ////////////////////////////

-    // Create irrBullet World //

-    ////////////////////////////

-    world = createIrrBulletWorld(device, true, debugDraw);

-

-    world->setDebugMode(EPDM_DrawAabb |

-            EPDM_DrawContactPoints);

-

-    world->setGravity(vector3df(0,-10,0));

-

-    createGround();

-

-

-	for(int i=0; i < 8; i++)

-    {

-        srand(device->getTimer()->getTime());

-

-        u32 force = rand() % 40 + 20;

-

-        createTank(L"JagdPanther.b3d", L"JagdPanther.b3d", vector3df((i*40),5,-120), 12);

-        static_cast<IRigidBody*>(world->getCollisionObjectByIndex(world->getNumCollisionObjects()-1))->setLinearVelocity(vector3df(0,0,force));

-    }

-

-    camera = device->getSceneManager()->addCameraSceneNodeFPS();

-	camera->setPosition(vector3df(50,15,4));

-	camera->setTarget(static_cast<IRigidBody*>(world->getCollisionObjectByName("Tank"))->getWorldTransform().getTranslation());

-

-

-    // Set our delta time and time stamp

-    u32 TimeStamp = device->getTimer()->getTime();

-    u32 DeltaTime = 0;

-    while(device->run())

-    {

-        device->getVideoDriver()->beginScene(true, true, SColor(255,100,101,140));

-

-        DeltaTime = device->getTimer()->getTime() - TimeStamp;

-		TimeStamp = device->getTimer()->getTime();

-

-		// Step the simulation with our delta time

-        world->stepSimulation(DeltaTime*0.001f, 120);

-

-        handleCollisions();

-

-

-        world->debugDrawWorld(debugDraw);

-        // This call will draw the technical properties of the physics simulation

-        // to the GUI environment.

-        world->debugDrawProperties(drawProperties);

-

-

-        device->getSceneManager()->drawAll();

-        device->getGUIEnvironment()->drawAll();

-

-        device->getVideoDriver()->endScene();

-    }

-

-    // We're done with the IrrBullet world, so we free the memory that it takes up.

-    if(world)

-        delete world;

-

-    if(device)

-        device->drop();

-}

-

-void CCollisionExample::handleCollisions()

-{

-    for(int i=0; i < world->getNumManifolds(); i++)

-    {

-        ICollisionCallbackInformation *info = world->getCollisionCallback(i);

-

-        bool hasCollideAttribute = (info->getBody0()->getAttributes()->existsAttribute("collide"));

-        ICollisionObject* obj = (hasCollideAttribute) ? info->getBody0() : info->getBody1();

-

-        if(obj->getAttributes()->existsAttribute("collide") && obj->getAttributes()->getAttributeAsBool("collide") == true)

-        {

-            obj->getAttributes()->setAttribute("collide", false);

-            world->addToDeletionQueue(obj);

-        }

-

-        obj = (hasCollideAttribute) ? info->getBody1() : info->getBody0();

-        if(obj->getAttributes()->existsAttribute("vehicle"))

-        {

-            if(obj->getAttributes()->existsAttribute("destroyable"))

-            {

-                if(obj->getAttributes()->getAttributeAsBool("isDestroyed") == false)

+	      if(obj->getAttributes()->getAttributeAsBool("isDestroyed") == false)

                 {

-                    obj->getAttributes()->setAttribute("isDestroyed", true);

-

-                    IParticleSystemSceneNode* ps = createParticleSystem(vector3df(0.0f,0.02f,0.0f), 80, 100,

-                        SColor(0,255,255,255), SColor(0,255,255,255), 800, 2000, 0,

-                        dimension2df(5.f,5.f), dimension2df(10.f,10.f), "fire.bmp",

-                        0.0, false, EMT_TRANSPARENT_VERTEX_ALPHA, true);

-                    ps->setPosition(static_cast<IRigidBody*>(obj)->getWorldTransform().getTranslation());

-

-                    // Since we set a reference to the raycast vehicle of each tank, it will be removed automatically

-                    // by irrBullet when the object is removed!

-                    world->removeCollisionObject(obj);

+		  obj->getAttributes()->setAttribute("isDestroyed", true);

+		  

+		  IParticleSystemSceneNode* ps = createParticleSystem(vector3df(0.0f,0.02f,0.0f), 80, 100,

+								      SColor(0,255,255,255), SColor(0,255,255,255), 800, 2000, 0,

+								      dimension2df(5.f,5.f), dimension2df(10.f,10.f), "fire.bmp",

+								      0.0, false, EMT_TRANSPARENT_VERTEX_ALPHA, true);

+		  ps->setPosition(static_cast<IRigidBody*>(obj)->getWorldTransform().getTranslation());

+		  

+		  // Since we set a reference to the raycast vehicle of each tank, it will be removed automatically

+		  // by irrBullet when the object is removed!

+		  world->removeCollisionObject(obj);

                 }

             }

         }

     }

-

-    // If you wanted to get all contact points, you could do something like this:

-    /*

+  

+  // If you wanted to get all contact points, you could do something like this:

+  /*

     for(int i=0; i < DynamicsWorld->getNumManifolds(); i++)

     {

-        ICollisionCallbackInformation *info = DynamicsWorld->getCollisionCallback(i);

-

-        int numContacts = info->getPointer()->getNumContacts();

-        for(int j=0; j < numContacts; j++)

-        {

-            if(verifyCollisionCallback(info))

-            {

-                if(info->getContactPoint(j).getDistance()<1.5f && info->getContactPoint(j).getLifeTime() < 2.0f)

-                {

-                    // Handle contact point

-                }

-            }

-        }

-        info->getPointer()->clearManifold();

-    }

-    */

+    ICollisionCallbackInformation *info = DynamicsWorld->getCollisionCallback(i);

+    

+    int numContacts = info->getPointer()->getNumContacts();

+    for(int j=0; j < numContacts; j++)

+    {

+    if(verifyCollisionCallback(info))

+    {

+    if(info->getContactPoint(j).getDistance()<1.5f && info->getContactPoint(j).getLifeTime() < 2.0f)

+    {

+    // Handle contact point

+    }

+    }

+    }

+    info->getPointer()->clearManifold();

+    }

+  */

 }

 

 

 CCollisionExample::~CCollisionExample()

 {

-    //dtor

+  //dtor

 }

 

--- /dev/null
+++ b/examples/HelloWorld/Makefile
@@ -1,1 +1,10 @@
+OBJS=main.o helloworldexample.o ../framework/exampleframework.o
+APP=HelloWorld
 
+CFLAGS=-I/home/kkrizka/dev/irrlicht-svn/include/irrlicht -I/home/kkrizka/dev/irrbullet-svn/include/irrBullet -g `pkg-config bullet --cflags`
+CXXFLAGS=${CFLAGS}
+LDFLAGS= -g `pkg-config bullet --libs` -lIrrlicht -L/home/kkrizka/dev/irrlicht-svn/lib -lIrrBullet -L/home/kkrizka/dev/irrbullet-svn/lib -lbz2
+
+all: ${OBJS}
+	g++ ${LDFLAGS} -o ${APP} ${OBJS}
+

--- a/examples/HelloWorld/helloworldexample.cpp
+++ b/examples/HelloWorld/helloworldexample.cpp
@@ -1,5 +1,5 @@
 #include <irrlicht.h>

-#include <irrBullet.h>

+#include <irrbullet.h>

 #include "helloworldexample.h"

 

 

@@ -25,147 +25,147 @@
 

 bool CHelloWorldExample::OnEvent(const SEvent& event)

 {

-	if (!device)

-		return false;

-

-    switch(event.EventType)

+  if (!device)

+    return false;

+  

+  switch(event.EventType)

     {

-        case EET_MOUSE_INPUT_EVENT:

-        {

-            if(event.MouseInput.Event==EMIE_LMOUSE_PRESSED_DOWN)

+    case EET_MOUSE_INPUT_EVENT:

+      {

+	if(event.MouseInput.Event==EMIE_LMOUSE_PRESSED_DOWN)

+	  {

+	    shootCube(vector3df(2,2,2), 1);

+	    return true;

+	  }

+	

+	else

+	  if(event.MouseInput.Event==EMIE_RMOUSE_PRESSED_DOWN)

             {

-                shootCube(vector3df(2,2,2), 1);

-                return true;

+	      shootSphere(vector3df(0.2,0.2,0.2), 0.2);

+	      return true;

             }

-

-            else

-            if(event.MouseInput.Event==EMIE_RMOUSE_PRESSED_DOWN)

+      }

+      break;

+      

+    case EET_KEY_INPUT_EVENT:

+      {

+	if(event.KeyInput.Key == KEY_KEY_P && event.KeyInput.PressedDown == false)

+	  {

+	    world->pauseSimulation(!world->simulationPaused());

+	    return true;

+	  }

+	

+	else

+	  if(event.KeyInput.Key == KEY_KEY_R && event.KeyInput.PressedDown == false)

             {

-                shootSphere(vector3df(0.2,0.2,0.2), 0.2);

-                return true;

+	      while(world->getNumCollisionObjects() > 0)

+                {

+		  world->removeCollisionObject(world->getCollisionObjectByIndex(0));

+                }

+	      createGround();

+	      createBoxes();

+	      return true;

             }

-        }

-        break;

-

-        case EET_KEY_INPUT_EVENT:

-        {

-            if(event.KeyInput.Key == KEY_KEY_P && event.KeyInput.PressedDown == false)

-            {

-                world->pauseSimulation(!world->simulationPaused());

-                return true;

-            }

-

-            else

-            if(event.KeyInput.Key == KEY_KEY_R && event.KeyInput.PressedDown == false)

-            {

-                while(world->getNumCollisionObjects() > 0)

-                {

-                    world->removeCollisionObject(world->getCollisionObjectByIndex(0));

-                }

-                createGround();

-                createBoxes();

-                return true;

-            }

-        }

-        break;

-        default:

-            break;

+      }

+      break;

+    default:

+      break;

     }

-    return false;

-

-

+  return false;

+  

+  

 }

 

 

 void CHelloWorldExample::runExample()

 {

-    debugDraw = true;

-    drawProperties = true;

-    drawWireFrame = false;

+  debugDraw = true;

+  drawProperties = true;

+  drawWireFrame = false;

+  

+  rows = 10;

+  columns = 10;

+  

+  device =

+    createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 16,

+		  false, false, false, this);

+  

+  printf("Number of stack rows: ");

+  cin >> rows;

+  printf("\nNumber of stack columns: ");

+  cin >> columns;

+  

 

-    rows = 10;

-	columns = 10;

+  device->setWindowCaption(L"irrBullet Hello World");

 

-    device =

-        createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 16,

-            false, false, false, this);

+  device->getFileSystem()->addFolderFileArchive("../../media/");

+  

 

-    printf("Number of stack rows: ");

-    cin >> rows;

-    printf("\nNumber of stack columns: ");

-    cin >> columns;

-

-

-    device->setWindowCaption(L"irrBullet Hello World");

-

-    device->getFileSystem()->addFolderFileArchive("../../media/");

-

-

-    device->getSceneManager()->addLightSceneNode(0, vector3df(20, 40, -50), SColorf(1.0f, 1.0f, 1.0f), 4000.0f);

+  device->getSceneManager()->addLightSceneNode(0, vector3df(20, 40, -50), SColorf(1.0f, 1.0f, 1.0f), 4000.0f);

 

 

 

-    ////////////////////////////

-    // Create irrBullet World //

-    ////////////////////////////

-    world = createIrrBulletWorld(device, true, debugDraw);

+  ////////////////////////////

+  // Create irrBullet World //

+  ////////////////////////////

+  world = createIrrBulletWorld(device, true, debugDraw);

 

-    world->setDebugMode(EPDM_DrawAabb |

-            EPDM_DrawContactPoints);

+  world->setDebugMode(EPDM_DrawAabb |

+		      EPDM_DrawContactPoints);

 

-    world->setGravity(vector3df(0,-10,0));

+  world->setGravity(vector3df(0,-10,0));

 

 

-    camera = device->getSceneManager()->addCameraSceneNodeFPS();

-	camera->setPosition(vector3df(50,15,200));

+  camera = device->getSceneManager()->addCameraSceneNodeFPS();

+  camera->setPosition(vector3df(50,15,200));

 

 

-	createGround();

-	createBoxes();

+  createGround();

+  createBoxes();

+  

 

-

-    // Set our delta time and time stamp

-    u32 TimeStamp = device->getTimer()->getTime();

-    u32 DeltaTime = 0;

-    while(device->run())

+  // Set our delta time and time stamp

+  u32 TimeStamp = device->getTimer()->getTime();

+  u32 DeltaTime = 0;

+  while(device->run())

     {

-        device->getVideoDriver()->beginScene(true, true, SColor(255,100,101,140));

-

-        DeltaTime = device->getTimer()->getTime() - TimeStamp;

-		TimeStamp = device->getTimer()->getTime();

-

-		// Step the simulation with our delta time

-        world->stepSimulation(DeltaTime*0.001f, 120);

-

-

-        world->debugDrawWorld(debugDraw);

-        // This call will draw the technical properties of the physics simulation

-        // to the GUI environment.

-        world->debugDrawProperties(true);

-

-

-        device->getSceneManager()->drawAll();

-        device->getGUIEnvironment()->drawAll();

-

-        device->getVideoDriver()->endScene();

+      device->getVideoDriver()->beginScene(true, true, SColor(255,100,101,140));

+      

+      DeltaTime = device->getTimer()->getTime() - TimeStamp;

+      TimeStamp = device->getTimer()->getTime();

+      

+      // Step the simulation with our delta time

+      world->stepSimulation(DeltaTime*0.001f, 120);

+      

+      

+      world->debugDrawWorld(debugDraw);

+      // This call will draw the technical properties of the physics simulation

+      // to the GUI environment.

+      world->debugDrawProperties(true);

+      

+      

+      device->getSceneManager()->drawAll();

+      device->getGUIEnvironment()->drawAll();

+      

+      device->getVideoDriver()->endScene();

     }

-

-    // We're done with the IrrBullet world, so we free the memory that it takes up.

-    if(world)

-        delete world;

-

-    if(device)

-        device->drop();

+  

+  // We're done with the IrrBullet world, so we free the memory that it takes up.

+  if(world)

+    delete world;

+  

+  if(device)

+    device->drop();

 }

 

 

 void CHelloWorldExample::createBoxes()

 {

-    for(u32 j=0; j < columns; j++)

+  for(u32 j=0; j < columns; j++)

     {

-        for(u32 i=0; i < rows; i++)

+      for(u32 i=0; i < rows; i++)

         {

-            addCube(vector3df(3 * i, 0 + 3 * j + 3, 0), vector3df(3,3,3), 3);

+	  addCube(vector3df(3 * i, 0 + 3 * j + 3, 0), vector3df(3,3,3), 3);

         }

     }

 }

@@ -173,22 +173,22 @@
 

 void CHelloWorldExample::createGround()

 {

-    ISceneNode *Node = device->getSceneManager()->addCubeSceneNode(1.0);

-	Node->setScale(vector3df(300,3,300)); // 400, 3, 400

-	Node->setPosition(vector3df(20,0,10));

-	Node->setMaterialFlag(video::EMF_LIGHTING, true);

-	Node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);

-	Node->setMaterialTexture(0, device->getVideoDriver()->getTexture("rockwall.jpg"));

-

-    if(drawWireFrame)

-        Node->setMaterialFlag(EMF_WIREFRAME, true);

-

-	ICollisionShape *shape = new IBoxShape(Node, 0, false);

-

-	//shape->setMargin(0.01);

-

-	IRigidBody *body;

-	body = world->addRigidBody(shape);

+  ISceneNode *Node = device->getSceneManager()->addCubeSceneNode(1.0);

+  Node->setScale(vector3df(300,3,300)); // 400, 3, 400

+  Node->setPosition(vector3df(20,0,10));

+  Node->setMaterialFlag(video::EMF_LIGHTING, true);

+  Node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);

+  Node->setMaterialTexture(0, device->getVideoDriver()->getTexture("rockwall.jpg"));

+  

+  if(drawWireFrame)

+    Node->setMaterialFlag(EMF_WIREFRAME, true);

+  

+  ICollisionShape *shape = new IBoxShape(Node, 0, false);

+  

+  //shape->setMargin(0.01);

+  

+  IRigidBody *body;

+  body = world->addRigidBody(shape);

 }

 

 


--- a/examples/HelloWorld/helloworldexample.h
+++ b/examples/HelloWorld/helloworldexample.h
@@ -10,23 +10,21 @@
 

 class CHelloWorldExample : public CExampleFramework

 {

-    public:

-        CHelloWorldExample();

-        virtual ~CHelloWorldExample();

-

-        virtual void runExample();

-

-        virtual bool OnEvent(const irr::SEvent& event);

-

-        void createBoxes();

-

-        void createGround();

-

-    private:

-        irr::u32 rows;

-        irr::u32 columns;

-

-

+public:

+  CHelloWorldExample();

+  virtual ~CHelloWorldExample();

+  

+  virtual void runExample();

+  

+  virtual bool OnEvent(const irr::SEvent& event);

+  

+  void createBoxes();

+  

+  void createGround();

+  

+private:

+  irr::u32 rows;

+  irr::u32 columns;

 };

 

 #endif // __HELLO_WORLD_EXAMPLE_H_INCLUDED__


--- /dev/null
+++ b/examples/LiquidBody/Makefile
@@ -1,1 +1,10 @@
+OBJS=main.o liquidbodyexample.o ../framework/exampleframework.o
+APP=LiquidBody
 
+CFLAGS=-I/home/kkrizka/dev/irrlicht-svn/include/irrlicht -I/home/kkrizka/dev/irrbullet-svn/include/irrBullet -g `pkg-config bullet --cflags`
+CXXFLAGS=${CFLAGS}
+LDFLAGS= -g `pkg-config bullet --libs` -lIrrlicht -L/home/kkrizka/dev/irrlicht-svn/lib -lIrrBullet -L/home/kkrizka/dev/irrbullet-svn/lib -lbz2
+
+all: ${OBJS}
+	g++ ${LDFLAGS} -o ${APP} ${OBJS}
+

--- a/examples/LiquidBody/liquidbodyexample.cpp
+++ b/examples/LiquidBody/liquidbodyexample.cpp
@@ -1,6 +1,6 @@
 #include "liquidbodyexample.h"

 #include <irrlicht.h>

-#include <irrBullet.h>

+#include <irrbullet.h>

 

 using namespace irr;

 using namespace core;


--- /dev/null
+++ b/examples/RaycastTank/Makefile
@@ -1,1 +1,10 @@
+OBJS=main.o raycasttankexample.o ../framework/exampleframework.o
+APP=RaycastTank
 
+CFLAGS=-I/home/kkrizka/dev/irrlicht-svn/include/irrlicht -I/home/kkrizka/dev/irrbullet-svn/include/irrBullet -g `pkg-config bullet --cflags`
+CXXFLAGS=${CFLAGS}
+LDFLAGS= -g `pkg-config bullet --libs` -lIrrlicht -L/home/kkrizka/dev/irrlicht-svn/lib -lIrrBullet -L/home/kkrizka/dev/irrbullet-svn/lib -lbz2
+
+all: ${OBJS}
+	g++ ${LDFLAGS} -o ${APP} ${OBJS}
+

--- a/examples/RaycastTank/raycasttankexample.cpp
+++ b/examples/RaycastTank/raycasttankexample.cpp
@@ -1,5 +1,5 @@
 #include <irrlicht.h>

-#include <irrBullet.h>

+#include <irrbullet.h>

 #include "raycasttankexample.h"

 

 


--- /dev/null
+++ b/examples/SoftBody/Makefile
@@ -1,1 +1,10 @@
+OBJS=main.o softbodyexample.o ../framework/exampleframework.o
+APP=SoftBody
 
+CFLAGS=-I/home/kkrizka/dev/irrlicht-svn/include/irrlicht -I/home/kkrizka/dev/irrbullet-svn/include/irrBullet -g `pkg-config bullet --cflags`
+CXXFLAGS=${CFLAGS}
+LDFLAGS= -g `pkg-config bullet --libs` -lIrrlicht -L/home/kkrizka/dev/irrlicht-svn/lib -lIrrBullet -L/home/kkrizka/dev/irrbullet-svn/lib -lbz2
+
+all: ${OBJS}
+	g++ ${LDFLAGS} -o ${APP} ${OBJS}
+

--- a/examples/SoftBody/softbodyexample.cpp
+++ b/examples/SoftBody/softbodyexample.cpp
@@ -1,6 +1,6 @@
 #include "softbodyexample.h"

 #include <irrlicht.h>

-#include <irrBullet.h>

+#include <irrbullet.h>

 

 using namespace irr;

 using namespace core;


--- a/examples/framework/exampleframework.cpp
+++ b/examples/framework/exampleframework.cpp
@@ -17,259 +17,259 @@
 

 IRigidBody* const CExampleFramework::addCube(const irr::core::vector3df &pos, const irr::core::vector3df &scale, irr::f32 mass, irr::core::stringc textureFile) const

 {

-    irr::scene::ISceneNode *Node = device->getSceneManager()->addCubeSceneNode(1.0f);

-	Node->setScale(scale);

-	Node->setPosition(pos);

-	Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);

-	Node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);

-	Node->setMaterialTexture(0, device->getVideoDriver()->getTexture(textureFile.c_str()));

-

+  irr::scene::ISceneNode *Node = device->getSceneManager()->addCubeSceneNode(1.0f);

+  Node->setScale(scale);

+  Node->setPosition(pos);

+  Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);

+  Node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);

+  Node->setMaterialTexture(0, device->getVideoDriver()->getTexture(textureFile.c_str()));

+  

+  Node->setMaterialFlag(irr::video::EMF_WIREFRAME, drawWireFrame);

+  

+  ICollisionShape *shape = new IBoxShape(Node, mass, false);

+  

+  //shape->setMargin(0.01);

+  

+  IRigidBody *body;

+  body = world->addRigidBody(shape);

+  

+  return body;

+}

+

+IRigidBody* const CExampleFramework::shootCube(const irr::core::vector3df &scale, irr::f32 mass, irr::core::stringc textureFile) const

+{

+  irr::core::vector3df pos(camera->getPosition().X,camera->getPosition().Y,camera->getPosition().Z);

+  

+  irr::scene::ISceneNode *Node = device->getSceneManager()->addCubeSceneNode(1.0f);

+  Node->setScale(scale);

+  Node->setPosition(pos);

+  Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);

+  Node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);

+  Node->setMaterialTexture(0, device->getVideoDriver()->getTexture(textureFile.c_str()));

+  

+  Node->setMaterialFlag(irr::video::EMF_WIREFRAME, drawWireFrame);

+  

+  ICollisionShape *shape = new IBoxShape(Node, mass, true);

+  

+  //shape->setMargin(0.01);

+  

+  IRigidBody *body = world->addRigidBody(shape);

+  

+  irr::core::vector3df rot = camera->getRotation();

+  irr::core::matrix4 mat;

+  mat.setRotationDegrees(rot);

+  irr::core::vector3df forwardDir(irr::core::vector3df(mat[8],mat[9],mat[10]) * 120);

+  

+  body->setLinearVelocity(forwardDir);

+  //body->setActivationState(EAS_DISABLE_DEACTIVATION);

+  

+  body->setDamping(0.2,0.2);

+  body->setFriction(0.4f);

+  

+  //ICollisionObjectAffectorDelete *deleteAffector = new ICollisionObjectAffectorDelete(4000);

+  //body->addAffector(deleteAffector);

+  

+  body->getAttributes()->addBool("collide", true);

+  

+  //ICollisionObjectAffectorAttract* affector = new ICollisionObjectAffectorAttract(irr::core::vector3df(0,1000,0), 2500);

+  //ICollisionObjectAffectorAttract* affector = new ICollisionObjectAffectorAttract(device->getSceneManager()->getActiveCamera(), 2500);

+  //body->addAffector(affector);

+  

+  return body;

+}

+

+IRigidBody* const CExampleFramework::shootSphere(const irr::core::vector3df &scale, irr::f32 mass) const

+{

+  irr::core::vector3df pos(camera->getPosition().X,camera->getPosition().Y,camera->getPosition().Z);

+  

+  irr::scene::ISceneNode *Node = device->getSceneManager()->addSphereSceneNode();

+  Node->setScale(scale);

+  Node->setPosition(pos);

+  Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);

+  Node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);

+  Node->setMaterialTexture(0, device->getVideoDriver()->getTexture("rockwall.jpg"));

+  

+  if(drawWireFrame)

     Node->setMaterialFlag(irr::video::EMF_WIREFRAME, drawWireFrame);

-

-	ICollisionShape *shape = new IBoxShape(Node, mass, false);

-

-	//shape->setMargin(0.01);

-

-	IRigidBody *body;

-	body = world->addRigidBody(shape);

-

-	return body;

-}

-

-IRigidBody* const CExampleFramework::shootCube(const irr::core::vector3df &scale, irr::f32 mass, irr::core::stringc textureFile) const

-{

-	irr::core::vector3df pos(camera->getPosition().X,camera->getPosition().Y,camera->getPosition().Z);

-

-	irr::scene::ISceneNode *Node = device->getSceneManager()->addCubeSceneNode(1.0f);

-	Node->setScale(scale);

-	Node->setPosition(pos);

-	Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);

-	Node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);

-	Node->setMaterialTexture(0, device->getVideoDriver()->getTexture(textureFile.c_str()));

-

-    Node->setMaterialFlag(irr::video::EMF_WIREFRAME, drawWireFrame);

-

-	ICollisionShape *shape = new IBoxShape(Node, mass, true);

-

-	//shape->setMargin(0.01);

-

-	IRigidBody *body = world->addRigidBody(shape);

-

-	irr::core::vector3df rot = camera->getRotation();

-    irr::core::matrix4 mat;

-    mat.setRotationDegrees(rot);

-    irr::core::vector3df forwardDir(irr::core::vector3df(mat[8],mat[9],mat[10]) * 120);

-

-    body->setLinearVelocity(forwardDir);

-    //body->setActivationState(EAS_DISABLE_DEACTIVATION);

-

-    body->setDamping(0.2,0.2);

-    body->setFriction(0.4f);

-

-    //ICollisionObjectAffectorDelete *deleteAffector = new ICollisionObjectAffectorDelete(4000);

-    //body->addAffector(deleteAffector);

-

-    body->getAttributes()->addBool("collide", true);

-

-    //ICollisionObjectAffectorAttract* affector = new ICollisionObjectAffectorAttract(irr::core::vector3df(0,1000,0), 2500);

-    //ICollisionObjectAffectorAttract* affector = new ICollisionObjectAffectorAttract(device->getSceneManager()->getActiveCamera(), 2500);

-    //body->addAffector(affector);

-

-    return body;

-}

-

-IRigidBody* const CExampleFramework::shootSphere(const irr::core::vector3df &scale, irr::f32 mass) const

-{

-	irr::core::vector3df pos(camera->getPosition().X,camera->getPosition().Y,camera->getPosition().Z);

-

-	irr::scene::ISceneNode *Node = device->getSceneManager()->addSphereSceneNode();

-	Node->setScale(scale);

-	Node->setPosition(pos);

-	Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);

-	Node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);

-	Node->setMaterialTexture(0, device->getVideoDriver()->getTexture("rockwall.jpg"));

-

-	if(drawWireFrame)

-        Node->setMaterialFlag(irr::video::EMF_WIREFRAME, drawWireFrame);

-

-	ICollisionShape *shape = new ISphereShape(Node, mass, true);

-

-	//shape->setMargin(0.01);

-

-	IRigidBody *body = world->addRigidBody(shape);

-	body->setDamping(0.2,0.2);

-

-    // Since we use a "bumpy" triangle mesh for the terrain, we need to set the CCD radius and

-    // motion threshold to ensure that we don't have any tunneling problems.

-    // This doesn't work very well for box shapes.

-	// ALSO: If you use setLocalScaling() on the collision shape, be sure to call this again

-	// after scaling to make sure that it matches the actual object.

-

-	irr::core::vector3df rot = camera->getRotation();

-    irr::core::matrix4 mat;

-    mat.setRotationDegrees(rot);

-    irr::core::vector3df forwardDir(irr::core::vector3df(mat[8],mat[9],mat[10]) * 120);

-

-    body->setLinearVelocity(forwardDir);

-

-

-

-    //ICollisionObjectAffectorDelete *deleteAffector = new ICollisionObjectAffectorDelete(4000);

-    //body->addAffector(deleteAffector);

-

-    return body;

+  

+  ICollisionShape *shape = new ISphereShape(Node, mass, true);

+  

+  //shape->setMargin(0.01);

+  

+  IRigidBody *body = world->addRigidBody(shape);

+  body->setDamping(0.2,0.2);

+  

+  // Since we use a "bumpy" triangle mesh for the terrain, we need to set the CCD radius and

+  // motion threshold to ensure that we don't have any tunneling problems.

+  // This doesn't work very well for box shapes.

+  // ALSO: If you use setLocalScaling() on the collision shape, be sure to call this again

+  // after scaling to make sure that it matches the actual object.

+  

+  irr::core::vector3df rot = camera->getRotation();

+  irr::core::matrix4 mat;

+  mat.setRotationDegrees(rot);

+  irr::core::vector3df forwardDir(irr::core::vector3df(mat[8],mat[9],mat[10]) * 120);

+  

+  body->setLinearVelocity(forwardDir);

+  

+  

+  

+  //ICollisionObjectAffectorDelete *deleteAffector = new ICollisionObjectAffectorDelete(4000);

+  //body->addAffector(deleteAffector);

+  

+  return body;

 }

 

 IRigidBody* const CExampleFramework::createTank(const irr::core::stringw& file, const irr::core::stringw& collFile,

     const irr::core::vector3df &pos, const irr::f32 mass) const

 {

-    irr::scene::IAnimatedMeshSceneNode *Node = device->getSceneManager()->addAnimatedMeshSceneNode(

-        device->getSceneManager()->getMesh(file.c_str()));

-	Node->setPosition(pos);

-	Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);

-

-

-	IGImpactMeshShape *shape = new IGImpactMeshShape(Node, device->getSceneManager()->getMesh(collFile.c_str()), mass);

-	//ICollisionShape *shape = new IBoxShape(Node, mass, false);

-

-

-	IRigidBody* tank = world->addRigidBody(shape);

-	tank->includeNodeOnRemoval(false);

-

-    tank->setName("Tank");

-	tank->getAttributes()->addBool("vehicle", true);

-	tank->getAttributes()->addBool("destroyable", true);

-	tank->getAttributes()->addBool("isDestroyed", false);

-

-    // When using a raycast vehicle, we don't want this rigid body to deactivate.

-	tank->setActivationState(EAS_DISABLE_DEACTIVATION);

-

-    // We create our vehicle, passing our newly created rigid body as a parameter.

-	IRaycastVehicle* vehicle = world->addRaycastVehicle(tank);

-

-

-    // Set up our wheel construction info. These values can be changed for each wheel,

-    // and the values that you want to keep will stay the same, that way

-    // all parameters for each wheel can stay the same for what needs to remain equal,

-    // such as directions and suspension rest length.

-    SWheelInfoConstructionInfo wheel;

-    wheel.chassisConnectionPointCS = irr::core::vector3df(0.0,-0.88,4.0);

-    wheel.wheelDirectionCS = irr::core::vector3df(0.0,-1,0.0);

-    wheel.wheelAxleCS = irr::core::vector3df(-2,0.0,0.0);

-    wheel.suspensionRestLength = 0.6;

-    wheel.wheelRadius = 8.0;

-    wheel.isFrontWheel = false;

-

-    wheel.chassisConnectionPointCS = irr::core::vector3df(-4, -0.6, 12);

-    vehicle->addWheel(wheel);

-

-    wheel.chassisConnectionPointCS = irr::core::vector3df(4, -0.6, 12);

-    vehicle->addWheel(wheel);

-

-    wheel.chassisConnectionPointCS = irr::core::vector3df(-4, -0.6, -12);

-    vehicle->addWheel(wheel);

-

-    wheel.chassisConnectionPointCS = irr::core::vector3df(4, -0.6, -12);

-    vehicle->addWheel(wheel);

-

-	for(irr::u32 i=0;i<vehicle->getNumWheels();i++)

-    {

-        SWheelInfo &info = vehicle->getWheelInfo(i);

-

-        info.suspensionStiffness = 0.15f;

-        info.wheelDampingRelaxation = 2.3f;

-        info.wheelDampingCompression = 4.4f;

-        info.frictionSlip = 1000; // Higher values keeps the aircraft from jittering when landing unevenly

-        info.rollInfluence = 0.1f; // Rolls easier at higher values

-

-

-        // We call updateWheel, which takes SWheelInfo as the first parameter,

-        // and the ID of the wheel to apply that info to. This must

-        // be called after any changes in order for the changes to actually take effect.

-        vehicle->updateWheelInfo(i);

-    }

-

-    // Set a reference to the raycast vehicle so that irrBullet will automatically remove it when the object is removed

-    tank->setVehicleReference(vehicle);

-

-    return tank;

+  irr::scene::IAnimatedMeshSceneNode *Node = device->getSceneManager()->addAnimatedMeshSceneNode(

+												 device->getSceneManager()->getMesh(file.c_str()));

+  Node->setPosition(pos);

+  Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);

+  

+  

+  IGImpactMeshShape *shape = new IGImpactMeshShape(Node, device->getSceneManager()->getMesh(collFile.c_str()), mass);

+  //ICollisionShape *shape = new IBoxShape(Node, mass, false);

+  

+  

+  IRigidBody* tank = world->addRigidBody(shape);

+  tank->includeNodeOnRemoval(false);

+  

+  tank->setName("Tank");

+  tank->getAttributes()->addBool("vehicle", true);

+  tank->getAttributes()->addBool("destroyable", true);

+  tank->getAttributes()->addBool("isDestroyed", false);

+  

+  // When using a raycast vehicle, we don't want this rigid body to deactivate.

+  tank->setActivationState(EAS_DISABLE_DEACTIVATION);

+  

+  // We create our vehicle, passing our newly created rigid body as a parameter.

+  IRaycastVehicle* vehicle = world->addRaycastVehicle(tank);

+  

+  

+  // Set up our wheel construction info. These values can be changed for each wheel,

+  // and the values that you want to keep will stay the same, that way

+  // all parameters for each wheel can stay the same for what needs to remain equal,

+  // such as directions and suspension rest length.

+  SWheelInfoConstructionInfo wheel;

+  wheel.chassisConnectionPointCS = irr::core::vector3df(0.0,-0.88,4.0);

+  wheel.wheelDirectionCS = irr::core::vector3df(0.0,-1,0.0);

+  wheel.wheelAxleCS = irr::core::vector3df(-2,0.0,0.0);

+  wheel.suspensionRestLength = 0.6;

+  wheel.wheelRadius = 8.0;

+  wheel.isFrontWheel = false;

+  

+  wheel.chassisConnectionPointCS = irr::core::vector3df(-4, -0.6, 12);

+  vehicle->addWheel(wheel);

+  

+  wheel.chassisConnectionPointCS = irr::core::vector3df(4, -0.6, 12);

+  vehicle->addWheel(wheel);

+  

+  wheel.chassisConnectionPointCS = irr::core::vector3df(-4, -0.6, -12);

+  vehicle->addWheel(wheel);

+  

+  wheel.chassisConnectionPointCS = irr::core::vector3df(4, -0.6, -12);

+  vehicle->addWheel(wheel);

+  

+  for(irr::u32 i=0;i<vehicle->getNumWheels();i++)

+    {

+      SWheelInfo &info = vehicle->getWheelInfo(i);

+      

+      info.suspensionStiffness = 0.15f;

+      info.wheelDampingRelaxation = 2.3f;

+      info.wheelDampingCompression = 4.4f;

+      info.frictionSlip = 1000; // Higher values keeps the aircraft from jittering when landing unevenly

+      info.rollInfluence = 0.1f; // Rolls easier at higher values

+      

+      

+      // We call updateWheel, which takes SWheelInfo as the first parameter,

+      // and the ID of the wheel to apply that info to. This must

+      // be called after any changes in order for the changes to actually take effect.

+      vehicle->updateWheelInfo(i);

+    }

+  

+  // Set a reference to the raycast vehicle so that irrBullet will automatically remove it when the object is removed

+  tank->setVehicleReference(vehicle);

+  

+  return tank;

 }

 

 irr::scene::IParticleSystemSceneNode* const CExampleFramework::createParticleSystem(const irr::core::vector3df& dir, irr::f32 min, irr::f32 max,

-    const irr::video::SColor& darkest, const irr::video::SColor& brightest, irr::f32 minAge, irr::f32 maxAge, irr::f32 angle,

-    const irr::core::dimension2df& minSize, const irr::core::dimension2df maxSize, const irr::core::stringc& textureFile,

-    irr::f32 lifeTime, bool gravity, irr::video::E_MATERIAL_TYPE materialType, bool fadeOut) const

-{

-    irr::scene::IParticleSystemSceneNode* ps =

+										    const irr::video::SColor& darkest, const irr::video::SColor& brightest, irr::f32 minAge, irr::f32 maxAge, irr::f32 angle,

+										    const irr::core::dimension2df& minSize, const irr::core::dimension2df maxSize, const irr::core::stringc& textureFile,

+										    irr::f32 lifeTime, bool gravity, irr::video::E_MATERIAL_TYPE materialType, bool fadeOut) const

+{

+  irr::scene::IParticleSystemSceneNode* ps =

     device->getSceneManager()->addParticleSystemSceneNode(false);

-

-    irr::scene::IParticleEmitter* em = ps->createBoxEmitter(

-        irr::core::aabbox3d<irr::f32>(-7,0,-7,7,1,7), // emitter size

-        dir,   // initial direction core::vector3df(0.0f,0.01f,0.0f)

-        min,max,                             // emit rate

-        darkest,       // darkest color

-        brightest,       // brightest color

-        minAge,maxAge,angle,                         // min and max age, angle

-        minSize,         // min size

-        maxSize);        // max size

-

-    ps->setEmitter(em); // this grabs the emitter

-    em->drop(); // so we can drop it here without deleting it

-

-    if(fadeOut)

-    {

-        irr::scene::IParticleAffector* paf = ps->createFadeOutParticleAffector();

-        ps->addAffector(paf); // same goes for the affector

-        paf->drop();

-    }

-

-    if(gravity==true)

-    {

-        irr::scene::IParticleAffector* paf = ps->createGravityAffector(irr::core::vector3df(0.0f,-0.007f, 0.0f), 1800);

-        ps->addAffector(paf); // same goes for the affector

-        paf->drop();

-    }

-

-    ps->setScale(irr::core::vector3df(0.4,0.4,0.4));

-    ps->setMaterialFlag(irr::video::EMF_LIGHTING, false);

-    ps->setMaterialFlag(irr::video::EMF_ZWRITE_ENABLE, false);

-    ps->setMaterialTexture(0, device->getVideoDriver()->getTexture(textureFile.c_str()));

-    ps->setMaterialType(materialType);

-

-    //ps->setParent(info->getBody0()->getCollisionShape()->getSceneNode());

-    //ps->setPosition(vector3df(0,2,0));

-

-    if(lifeTime > 0.0f)

-    {

-        irr::scene::ISceneNodeAnimator* anim = device->getSceneManager()->createDeleteAnimator(lifeTime);

-        ps->addAnimator(anim);

-        anim->drop();

-    }

-

+  

+  irr::scene::IParticleEmitter* em = ps->createBoxEmitter(

+							  irr::core::aabbox3d<irr::f32>(-7,0,-7,7,1,7), // emitter size

+							  dir,   // initial direction core::vector3df(0.0f,0.01f,0.0f)

+							  min,max,                             // emit rate

+							  darkest,       // darkest color

+							  brightest,       // brightest color

+							  minAge,maxAge,angle,                         // min and max age, angle

+							  minSize,         // min size

+							  maxSize);        // max size

+  

+  ps->setEmitter(em); // this grabs the emitter

+  em->drop(); // so we can drop it here without deleting it

+  

+  if(fadeOut)

+    {

+      irr::scene::IParticleAffector* paf = ps->createFadeOutParticleAffector();

+      ps->addAffector(paf); // same goes for the affector

+      paf->drop();

+    }

+  

+  if(gravity==true)

+    {

+      irr::scene::IParticleAffector* paf = ps->createGravityAffector(irr::core::vector3df(0.0f,-0.007f, 0.0f), 1800);

+      ps->addAffector(paf); // same goes for the affector

+      paf->drop();

+    }

+  

+  ps->setScale(irr::core::vector3df(0.4,0.4,0.4));

+  ps->setMaterialFlag(irr::video::EMF_LIGHTING, false);

+  ps->setMaterialFlag(irr::video::EMF_ZWRITE_ENABLE, false);

+  ps->setMaterialTexture(0, device->getVideoDriver()->getTexture(textureFile.c_str()));

+  ps->setMaterialType(materialType);

+  

+  //ps->setParent(info->getBody0()->getCollisionShape()->getSceneNode());

+  //ps->setPosition(vector3df(0,2,0));

+  

+  if(lifeTime > 0.0f)

+    {

+      irr::scene::ISceneNodeAnimator* anim = device->getSceneManager()->createDeleteAnimator(lifeTime);

+      ps->addAnimator(anim);

+      anim->drop();

+    }

+  

     return ps;

 }

 

 

 IRigidBody* const CExampleFramework::createGround() const

 {

-    irr::scene::ISceneNode *Node = device->getSceneManager()->addCubeSceneNode(1.0);

-	Node->setScale(irr::core::vector3df(600,3,600)); // 400, 3, 400

-	Node->setPosition(irr::core::vector3df(200,0,100));

-	Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);

-	Node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);

-	Node->setMaterialTexture(0, device->getVideoDriver()->getTexture("rockwall.jpg"));

-

-    if(drawWireFrame)

-        Node->setMaterialFlag(irr::video::EMF_WIREFRAME, true);

-

-	ICollisionShape *shape = new IBoxShape(Node, 0, false);

-

-	//shape->setMargin(0.01);

-

-	IRigidBody *body;

-	body = world->addRigidBody(shape);

-

-	return body;

+  irr::scene::ISceneNode *Node = device->getSceneManager()->addCubeSceneNode(1.0);

+  Node->setScale(irr::core::vector3df(600,3,600)); // 400, 3, 400

+  Node->setPosition(irr::core::vector3df(200,0,100));

+  Node->setMaterialFlag(irr::video::EMF_LIGHTING, true);

+  Node->setMaterialFlag(irr::video::EMF_NORMALIZE_NORMALS, true);

+  Node->setMaterialTexture(0, device->getVideoDriver()->getTexture("rockwall.jpg"));

+  

+  if(drawWireFrame)

+    Node->setMaterialFlag(irr::video::EMF_WIREFRAME, true);

+  

+  ICollisionShape *shape = new IBoxShape(Node, 0, false);

+  

+  //shape->setMargin(0.01);

+  

+  IRigidBody *body;

+  body = world->addRigidBody(shape);

+  

+  return body;

 }