Cube  Diff

Differences From Artifact [fabee6f557]:

To Artifact [8d9314d707]:


1
2
3
4


5
6
7
8
9
10
11
1
2
3
4
5
6
7
8
9
10
11
12
13




+
+







// worldocull.cpp: occlusion map and occlusion test

#include "cube.h"

#import "DynamicEntity.h"

#define NUMRAYS 512

float rdist[NUMRAYS];
bool ocull = true;
float odist = 256;

void
22
23
24
25
26
27
28
29

30
31
32


33
34
35
36
37
38
39
24
25
26
27
28
29
30

31
32


33
34
35
36
37
38
39
40
41







-
+

-
-
+
+







computeraytable(float vx, float vy)
{
	if (!ocull)
		return;

	odist = getvar(@"fog") * 1.5f;

	float apitch = (float)fabs(player1->pitch);
	float apitch = (float)fabs(player1.pitch);
	float af = getvar(@"fov") / 2 + apitch / 1.5f + 3;
	float byaw = (player1->yaw - 90 + af) / 360 * PI2;
	float syaw = (player1->yaw - 90 - af) / 360 * PI2;
	float byaw = (player1.yaw - 90 + af) / 360 * PI2;
	float syaw = (player1.yaw - 90 - af) / 360 * PI2;

	loopi(NUMRAYS)
	{
		float angle = i * PI2 / NUMRAYS;
		if ((apitch > 45 // must be bigger if fov>120
		        || (angle < byaw && angle > syaw) ||
		        (angle < byaw - PI2 && angle > syaw - PI2) ||