28 vec3d uvec, fvec, rvec, center, reye, rfvec;
70 { &pts[3], &pts[2], &pts[1], &pts[0],
71 &pts[0], &pts[1], &pts[2], &pts[3]};
78 for (i=0; i<4; i++ ) {
123 return g3_draw_laser_htl(headp, head_width, tailp, tail_width, 255,255,255, tmap_flags | TMAP_HTL_3D_UNLIT);
126 float headx, heady, headr, tailx, taily, tailr;
157 float len_2d =
fl_sqrt( (tailx-headx)*(tailx-headx) + (taily-heady)*(taily-heady) );
160 if ( (max_len > 1.0
f) && (len_2d > max_len) ) {
161 float ratio = max_len / len_2d;
163 tailx = headx + ( tailx - headx ) * ratio;
164 taily = heady + ( taily - heady ) * ratio;
165 tailr = headr + ( tailr - headr ) * ratio;
167 len_2d =
fl_sqrt( (tailx-headx)*(tailx-headx) + (taily-heady)*(taily-heady) );
180 float mx, my,
w, h1,h2;
182 if ( len_2d < max_r ) {
184 h1 = headr + (max_r-len_2d);
185 if ( h1 > max_r ) h1 = max_r;
186 h2 = tailr + (max_r-len_2d);
187 if ( h2 > max_r ) h2 = max_r;
190 if (
fl_abs(tailx - headx) > 0.01f ) {
191 a = (
float)atan2( taily-heady, tailx-headx );
207 mx = (tailx+headx)/2.0
f;
208 my = (taily+heady)/2.0
f;
213 if ( h1 < 1.0
f ) h1 = 1.0f;
214 if ( h2 < 1.0
f ) h2 = 1.0f;
222 vertex *vertlist[4] = { &v[3], &v[2], &v[1], &v[0] };
223 memset(v,0,
sizeof(
vertex)*4);
225 if ( depth < 0.0
f ) depth = 0.0f;
227 v[0].
screen.
xyw.x = (-w/2.0f)*ca + (-h1/2.0
f)*sa + mx;
228 v[0].
screen.
xyw.y = (-w/2.0f)*sa - (-h1/2.0
f)*ca + my;
235 v[1].
screen.
xyw.x = (w/2.0f)*ca + (-h2/2.0
f)*sa + mx;
236 v[1].
screen.
xyw.y = (w/2.0f)*sa - (-h2/2.0
f)*ca + my;
243 v[2].
screen.
xyw.x = (w/2.0f)*ca + (h2/2.0
f)*sa + mx;
244 v[2].
screen.
xyw.y = (w/2.0f)*sa - (h2/2.0
f)*ca + my;
251 v[3].
screen.
xyw.x = (-w/2.0f)*ca + (h1/2.0
f)*sa + mx;
252 v[3].
screen.
xyw.y = (-w/2.0f)*sa - (h1/2.0
f)*ca + my;
273 return g3_draw_laser_htl(headp, head_width, tailp, tail_width, r, g, b, tmap_flags | TMAP_HTL_3D_UNLIT);
275 float headx, heady, headr, tailx, taily, tailr;
306 float len_2d =
fl_sqrt( (tailx-headx)*(tailx-headx) + (taily-heady)*(taily-heady) );
309 if ( (max_len > 1.0
f) && (len_2d > max_len) ) {
310 float ratio = max_len / len_2d;
312 tailx = headx + ( tailx - headx ) * ratio;
313 taily = heady + ( taily - heady ) * ratio;
314 tailr = headr + ( tailr - headr ) * ratio;
316 len_2d =
fl_sqrt( (tailx-headx)*(tailx-headx) + (taily-heady)*(taily-heady) );
329 float mx, my,
w, h1,h2;
331 if ( len_2d < max_r ) {
333 h1 = headr + (max_r-len_2d);
334 if ( h1 > max_r ) h1 = max_r;
335 h2 = tailr + (max_r-len_2d);
336 if ( h2 > max_r ) h2 = max_r;
339 if (
fl_abs(tailx - headx) > 0.01f ) {
340 a = (
float)atan2( taily-heady, tailx-headx );
356 mx = (tailx+headx)/2.0
f;
357 my = (taily+heady)/2.0
f;
362 if ( h1 < 1.0
f ) h1 = 1.0f;
363 if ( h2 < 1.0
f ) h2 = 1.0f;
371 vertex *vertlist[4] = { &v[3], &v[2], &v[1], &v[0] };
372 memset(v,0,
sizeof(
vertex)*4);
374 if ( depth < 0.0
f ) depth = 0.0f;
376 v[0].
screen.
xyw.x = (-w/2.0f)*ca + (-h1/2.0
f)*sa + mx;
377 v[0].
screen.
xyw.y = (-w/2.0f)*sa - (-h1/2.0
f)*ca + my;
387 v[1].
screen.
xyw.x = (w/2.0f)*ca + (-h2/2.0
f)*sa + mx;
388 v[1].
screen.
xyw.y = (w/2.0f)*sa - (-h2/2.0
f)*ca + my;
398 v[2].
screen.
xyw.x = (w/2.0f)*ca + (h2/2.0
f)*sa + mx;
399 v[2].
screen.
xyw.y = (w/2.0f)*sa - (h2/2.0
f)*ca + my;
409 v[3].
screen.
xyw.x = (-w/2.0f)*ca + (h1/2.0
f)*sa + mx;
410 v[3].
screen.
xyw.y = (-w/2.0f)*sa - (h1/2.0
f)*ca + my;
struct screen3d::@234::@236 xyw
void vm_vec_scale_add(vec3d *dest, const vec3d *src1, const vec3d *src2, float k)
ubyte g3_transfer_vertex(vertex *dest, const vec3d *src)
GLint GLint GLsizei GLsizei GLsizei depth
struct vec3d::@225::@227 xyz
#define TMAP_HTL_3D_UNLIT
float atan2_safe(float y, float x)
float g3_draw_laser_rgb(const vec3d *headp, float head_width, const vec3d *tailp, float tail_width, int r, int g, int b, uint tmap_flags, float max_len)
GLdouble GLdouble GLdouble r
#define TMAP_FLAG_GOURAUD
float g3_draw_laser(const vec3d *headp, float head_width, const vec3d *tailp, float tail_width, uint tmap_flags, float max_len)
GLboolean GLboolean GLboolean GLboolean a
int vm_test_parallel(const vec3d *src0, const vec3d *src1)
ubyte g3_rotate_vertex(vertex *dest, const vec3d *src)
float vm_vec_normalize_safe(vec3d *v)
int g3_project_vertex(vertex *point)
void vm_vec_copy_scale(vec3d *dest, const vec3d *src, float s)
#define TMAP_FLAG_CORRECT
void vm_vec_sub(vec3d *dest, const vec3d *src0, const vec3d *src1)
float g3_draw_laser_htl(const vec3d *p0, float width1, const vec3d *p1, float width2, int r, int g, int b, uint tmap_flags)
GLboolean GLboolean GLboolean b
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
#define DCF_BOOL(function_name, bool_variable)
An overhauled/updated debug console to allow monitoring, testing, and general debugging of new featur...
vec3d * vm_vec_avg(vec3d *dest, const vec3d *src0, const vec3d *src1)
vec3d * vm_vec_cross(vec3d *dest, const vec3d *src0, const vec3d *src1)
float vm_vec_normalize(vec3d *v)