Need some help to finalize AmigaOS4 port of AssaultCube
#27
EDIT: Got it. The new method checks for mapmodels too. Still, I'm not sure if this fix is a gameplay-relevant change (you can e.g. shoot through parts of fences), so better ask a dev before you play online with that.

Again, just comment the current content of the readdepth() function and put this in there:

Code:
float yaw = camera1->yaw-90, pitch = -camera1->pitch; vec from = camera1->o, dir, surface; float sin_yaw = sinf(yaw*RAD); float cos_yaw = cosf(yaw*RAD); float sin_pitch = sinf(pitch*RAD); float cos_pitch = cosf(pitch*RAD); dir.x = cos_pitch * cos_yaw; dir.y = cos_pitch * sin_yaw; dir.z = -sin_pitch; vec ray = dir; float dist = raycube(from, ray, surface); if(dist < 0) dist = 1000.0f; // if skymap was hit, dist is always -1 ... pos = vec(dir).mul(dist).add(from); loopv(ents) { entity &e = ents[i]; if(e.type != MAPMODEL) continue; if(from.dist(vec(e.x, e.y, e.z)) < dist && intersect(&e, from, pos)) dist = from.dist(vec(e.x, e.y, e.z)); } pos = dir.mul(dist).add(from); // once again, now with correct dist
Thanks given by:


Messages In This Thread
RE: Need some help to finalize AmigaOS4 port of AssaultCube - by tempest - 15 Nov 10, 08:04PM