#define CONTENTSQ3_JUMPPAD 0x00080000 // hint for Q3's bots
#define CONTENTSQ3_CLUSTERPORTAL 0x00100000 // hint for Q3's bots
#define CONTENTSQ3_DONOTENTER 0x00200000 // hint for Q3's bots
+#define CONTENTSQ3_BOTCLIP 0x00400000 // hint for Q3's bots
#define CONTENTSQ3_ORIGIN 0x01000000 // used by origin brushes to indicate origin of bmodel (removed by map compiler)
#define CONTENTSQ3_BODY 0x02000000 // used by bbox entities (should never be on a brush)
#define CONTENTSQ3_CORPSE 0x04000000 // used by dead bodies (SOLID_CORPSE in darkplaces)
#define SUPERCONTENTS_PLAYERCLIP 0x00000100
#define SUPERCONTENTS_MONSTERCLIP 0x00000200
#define SUPERCONTENTS_DONOTENTER 0x00000400
+#define SUPERCONTENTS_BOTCLIP 0x00000800
+#define SUPERCONTENTS_OPAQUE 0x00001000
+// TODO: is there any reason to define:
+// fog?
+// areaportal?
+// teleporter?
+// jumppad?
+// clusterportal?
+// detail? (div0) no, game code should not be allowed to differentiate between structural and detail
+// structural? (div0) no, game code should not be allowed to differentiate between structural and detail
+// trigger? (div0) no, as these are always solid anyway, and that's all that matters for trigger brushes
#define SUPERCONTENTS_LIQUIDSMASK (SUPERCONTENTS_LAVA | SUPERCONTENTS_SLIME | SUPERCONTENTS_WATER)
/*
for (i = 0, surface = model->data_surfaces;i < model->num_surfaces;i++, surface++)
{
model->AnimateVertices(model, frameblend, vertex3f, NULL, NULL, NULL);
- Collision_TraceLineTriangleMeshFloat(trace, start, end, model->surfmesh.num_triangles, model->surfmesh.data_element3i, vertex3f, SUPERCONTENTS_SOLID, 0, surface->texture, segmentmins, segmentmaxs);
+ Collision_TraceLineTriangleMeshFloat(trace, start, end, model->surfmesh.num_triangles, model->surfmesh.data_element3i, vertex3f, SUPERCONTENTS_SOLID | (surface->texture->basematerialflags & MATERIALFLAGMASK_TRANSLUCENT ? 0 : SUPERCONTENTS_OPAQUE), 0, surface->texture, segmentmins, segmentmaxs);
}
}
else
vertex3f = (float *)Z_Malloc(maxvertices * sizeof(float[3]));
}
model->AnimateVertices(model, frameblend, vertex3f, NULL, NULL, NULL);
- Collision_TraceBrushTriangleMeshFloat(trace, thisbrush_start, thisbrush_end, model->surfmesh.num_triangles, model->surfmesh.data_element3i, vertex3f, SUPERCONTENTS_SOLID, 0, surface->texture, segmentmins, segmentmaxs);
+ Collision_TraceBrushTriangleMeshFloat(trace, thisbrush_start, thisbrush_end, model->surfmesh.num_triangles, model->surfmesh.data_element3i, vertex3f, SUPERCONTENTS_SOLID | (surface->texture->basematerialflags & MATERIALFLAGMASK_TRANSLUCENT ? 0 : SUPERCONTENTS_OPAQUE), 0, surface->texture, segmentmins, segmentmaxs);
}
}
}
case CONTENTS_EMPTY:
return 0;
case CONTENTS_SOLID:
- return SUPERCONTENTS_SOLID;
+ return SUPERCONTENTS_SOLID | SUPERCONTENTS_OPAQUE;
case CONTENTS_WATER:
return SUPERCONTENTS_WATER;
case CONTENTS_SLIME:
case CONTENTS_LAVA:
return SUPERCONTENTS_LAVA | SUPERCONTENTS_NODROP;
case CONTENTS_SKY:
- return SUPERCONTENTS_SKY | SUPERCONTENTS_NODROP;
+ return SUPERCONTENTS_SKY | SUPERCONTENTS_NODROP | SUPERCONTENTS_OPAQUE; // to match behaviour of Q3 maps, let sky count as opaque
}
return 0;
}
supercontents |= SUPERCONTENTS_MONSTERCLIP;
if (nativecontents & CONTENTSQ3_DONOTENTER)
supercontents |= SUPERCONTENTS_DONOTENTER;
+ if (nativecontents & CONTENTSQ3_BOTCLIP)
+ supercontents |= SUPERCONTENTS_BOTCLIP;
+ if (!(nativecontents & CONTENTSQ3_TRANSLUCENT))
+ supercontents |= SUPERCONTENTS_OPAQUE;
return supercontents;
}
nativecontents |= CONTENTSQ3_MONSTERCLIP;
if (supercontents & SUPERCONTENTS_DONOTENTER)
nativecontents |= CONTENTSQ3_DONOTENTER;
+ if (supercontents & SUPERCONTENTS_BOTCLIP)
+ nativecontents |= CONTENTSQ3_BOTCLIP;
+ if (!(supercontents & SUPERCONTENTS_OPAQUE))
+ nativecontents |= CONTENTSQ3_TRANSLUCENT;
return nativecontents;
}
#define MATERIALFLAG_MODELLIGHT_DIRECTIONAL 8388608
// combined mask of all attributes that require depth sorted rendering
#define MATERIALFLAGMASK_DEPTHSORTED (MATERIALFLAG_BLENDED | MATERIALFLAG_NODEPTHTEST)
+// combined mask of all attributes that cause some sort of transparency
+#define MATERIALFLAGMASK_TRANSLUCENT (MATERIALFLAG_WATERALPHA | MATERIALFLAG_SKY | MATERIALFLAG_NODRAW | MATERIALFLAG_ALPHATEST | MATERIALFLAG_BLENDED | MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION)
typedef struct medge_s
{