niedziela, 30 czerwca 2013

Edytor punktów ulubionych dla programu AutoMapa


Pod adresem amfavedit.appspot.com znajduje się mój edytor punktów ulubionych dla programu AutoMapa:


Zrobiony w dwa dni przy użyciu Google App Engine, napisany w Pythonie i JavaScripcie.

niedziela, 3 lutego 2013

Poprawka dla znikających cząsteczek w kodzie Doom'a 3

Here's a patch that fixes the disappearing particles problem in Doom 3 engine. Use this code in idRenderModelStatic::FinishSurfaces() in file renderer/Model.cpp

// if the surface has a deformation, increase the bounds
switch ( surf->shader->Deform() ) {
case DFRM_NONE:
 break;
case DFRM_PARTICLE2: {
  // expand surface bounds to include any emitted particles
  srfTriangles_t *tri = surf->geometry;
  const idDeclParticle *particleSystem = (idDeclParticle *)surf->shader->GetDeformDecl();
  tri->bounds.AddBounds(particleSystem->bounds);
 }
 break;
default: {
  // the amount here is somewhat arbitrary, designed to handle
  // autosprites and flares, but could be done better with exact
  // deformation information.
  // Note that this doesn't handle deformations that are skinned in
  // at run time...
  srfTriangles_t *tri = surf->geometry;
  idVec3 mid = ( tri->bounds[1] + tri->bounds[0] ) * 0.5f;
  float radius = ( tri->bounds[0] - mid ).Length();
  radius += 20.0f;
 
  tri->bounds[0][0] = mid[0] - radius;
  tri->bounds[0][1] = mid[1] - radius;
  tri->bounds[0][2] = mid[2] - radius;
 
  tri->bounds[1][0] = mid[0] + radius;
  tri->bounds[1][1] = mid[1] + radius;
  tri->bounds[1][2] = mid[2] + radius;
 }
 break;
}

Link to entry in the The Dark Mod  issue tracker: http://bugs.thedarkmod.com/view.php?id=3278