Material Based Effects - Detection - Diffs

From TDN

interior.h:

#include "ts/tsmesh.h"

interiorCollision.cc/cpp: (yes, I'm still use the oldschool file naming convention for ease of file comparrison with other resources. shoot me :P)

#include "interior/interiorInstance.h"
#include "materials/material.h"
#include "materials/matInstance.h"
#include "materials/materialList.h"


replace in, or clone and overload:

bool Interior::castRay_r(

         if(inside)
         {
            info->face = surfaceIndex;
            break;
         }
      }

      return true;


to

         if(inside)
         {
			 info->face = surfaceIndex;
             info->material = rSurface.textureIndex;

             MatInstance* matInst = mMaterialList->getMaterialInst( rSurface.textureIndex );
             if ( matInst && matInst->getMaterial() )
			 {
				 info->material = matInst->getMaterial()->getId();
			 }
			 else
			 {
				 info->material = 0;
			 }

	  }
	  return true;

Backtrace: Material Based Effects Projects