일리히트 터래인툴관련 소스입니다.

|





-실시간 폭파 효과 예제- 
void explode(ITerrainSceneNode* terrain, s32 indexMid, u8 nbBarrels, s32 size) 

  //printf("desired impact (%.2f,%.2f)\n", X, Z); 
  
  //elevation around impact. This array can be stored as raw image: 
  static const char eai[25]={ 
    0, 0, 0, 0, 0, 
    0, 1, 1, 1, 0, 
    0, 1, 2, 1, 0, // <- impact point vertex will be lowered by -2 units 
    0, 1, 1, 1, 0, 
    0, 0, 0, 0, 0 
  }; 
  
  //ok lets get terrain vertices 
  
  for (u8 n=0; n<nbBarrels; n++) 
  { 
  
    //apply the crater transformation 
    int cpt = 0; 
    for (u8 v=0; v<5; v++) 
      for (u8 u=0; u<5; u++) 
      { 
        s32 index = indexMid - 2 * size + v*size - 2 + u; 
                RaiseTerrainVertex(terrain, index, eai[cpt++], false); 
      } 
  
    // force terrain render buffer to reload 
    //terrain->setPosition(terrain->getPosition()); 
  
    //emit particles... 
  
  } 
  //shaking... 
  
  //play sound... 
}




And