MCPcopy Create free account
hub / github.com/demoth/jake2 / R_RenderDlight

Method R_RenderDlight

client/src/main/java/jake2/client/render/fast/Light.java:68–94  ·  view source on GitHub ↗

R_RenderDlight

(dlight_t light)

Source from the content-addressed store, hash-verified

66 * R_RenderDlight
67 */
68 void R_RenderDlight(dlight_t light)
69 {
70 float rad = light.intensity * 0.35f;
71
72 Math3D.VectorSubtract (light.origin, r_origin, v);
73
74 gl.glBegin (GL_TRIANGLE_FAN);
75 gl.glColor3f (light.color[0]*0.2f, light.color[1]*0.2f, light.color[2]*0.2f);
76 int i;
77 for (i=0 ; i<3 ; i++)
78 v[i] = light.origin[i] - vpn[i]*rad;
79
80 gl.glVertex3f(v[0], v[1], v[2]);
81 gl.glColor3f (0,0,0);
82
83 int j;
84 float a;
85 for (i=16 ; i>=0 ; i--)
86 {
87 a = (float)(i/16.0f * Math.PI*2);
88 for (j=0 ; j<3 ; j++)
89 v[j] = (float)(light.origin[j] + vright[j]*Math.cos(a)*rad
90 + vup[j]*Math.sin(a)*rad);
91 gl.glVertex3f(v[0], v[1], v[2]);
92 }
93 gl.glEnd ();
94 }
95
96 /**
97 * R_RenderDlights

Callers 1

R_RenderDlightsMethod · 0.95

Calls 5

VectorSubtractMethod · 0.95
glBeginMethod · 0.65
glColor3fMethod · 0.65
glVertex3fMethod · 0.65
glEndMethod · 0.65

Tested by

no test coverage detected