]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
now pretends gfx.wad pics are in the gfx/ directory, this changes the override path...
[xonotic/darkplaces.git] / gl_rmain.c
index 0b21178968aac487bc607e33519b039d29a1e428..a0152b15b96706fad3367d1e06b8b1250ef15c60 100644 (file)
@@ -289,6 +289,7 @@ extern void R_Particles_Init(void);
 extern void R_Explosion_Init(void);
 extern void ui_init(void);
 extern void gl_backend_init(void);
+extern void Sbar_Init(void);
 
 void Render_Init(void)
 {
@@ -307,6 +308,7 @@ void Render_Init(void)
        R_Particles_Init();
        R_Explosion_Init();
        ui_init();
+       Sbar_Init();
        R_Modules_Start();
 }
 
@@ -823,3 +825,33 @@ void R_DrawNoModel(entity_render_t *ent)
        //      R_DrawNoModelCallback(ent, 0);
 }
 
+void R_CalcBeamVerts (float *vert, vec3_t org1, vec3_t org2, float width)
+{
+       vec3_t right1, right2, diff, normal;
+
+       VectorSubtract (org2, org1, normal);
+       VectorNormalizeFast (normal);
+
+       // calculate 'right' vector for start
+       VectorSubtract (r_origin, org1, diff);
+       VectorNormalizeFast (diff);
+       CrossProduct (normal, diff, right1);
+
+       // calculate 'right' vector for end
+       VectorSubtract (r_origin, org2, diff);
+       VectorNormalizeFast (diff);
+       CrossProduct (normal, diff, right2);
+
+       vert[ 0] = org1[0] + width * right1[0];
+       vert[ 1] = org1[1] + width * right1[1];
+       vert[ 2] = org1[2] + width * right1[2];
+       vert[ 4] = org1[0] - width * right1[0];
+       vert[ 5] = org1[1] - width * right1[1];
+       vert[ 6] = org1[2] - width * right1[2];
+       vert[ 8] = org2[0] - width * right2[0];
+       vert[ 9] = org2[1] - width * right2[1];
+       vert[10] = org2[2] - width * right2[2];
+       vert[12] = org2[0] + width * right2[0];
+       vert[13] = org2[1] + width * right2[1];
+       vert[14] = org2[2] + width * right2[2];
+}