#include "gluos.h"
#include <assert.h>
#include "geom.h"
Go to the source code of this file.
|
#define | RealInterpolate(a, x, b, y) |
|
#define | Interpolate(a, x, b, y) RealInterpolate(a,x,b,y) |
|
#define | Swap(a, b) do { GLUvertex *t = a; a = b; b = t; } while (0) |
|
|
int | __gl_vertLeq (GLUvertex *u, GLUvertex *v) |
|
GLdouble | __gl_edgeEval (GLUvertex *u, GLUvertex *v, GLUvertex *w) |
|
GLdouble | __gl_edgeSign (GLUvertex *u, GLUvertex *v, GLUvertex *w) |
|
GLdouble | __gl_transEval (GLUvertex *u, GLUvertex *v, GLUvertex *w) |
|
GLdouble | __gl_transSign (GLUvertex *u, GLUvertex *v, GLUvertex *w) |
|
int | __gl_vertCCW (GLUvertex *u, GLUvertex *v, GLUvertex *w) |
|
void | __gl_edgeIntersect (GLUvertex *o1, GLUvertex *d1, GLUvertex *o2, GLUvertex *d2, GLUvertex *v) |
|
◆ Interpolate
◆ RealInterpolate
Value: (
a = (
a < 0) ? 0 :
a,
b = (
b < 0) ? 0 :
b, \
((
a <=
b) ? ((
b == 0) ? ((
x+
y) / 2) \
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
Definition at line 172 of file geom.c.
◆ Swap
◆ __gl_edgeEval()
Definition at line 47 of file geom.c.
48{
49
50
51
52
53
54
55
56
57
58
60
62
65
66 if( gapL + gapR > 0 ) {
67 if( gapL < gapR ) {
68 return (
v->t -
u->t) + (
u->t -
w->t) * (gapL / (gapL + gapR));
69 } else {
70 return (
v->t -
w->t) + (
w->t -
u->t) * (gapR / (gapL + gapR));
71 }
72 }
73
74 return 0;
75}
GLubyte GLubyte GLubyte GLubyte w
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
◆ __gl_edgeIntersect()
Definition at line 203 of file geom.c.
210{
212
213
214
215
216
217
218
219
220
224
226
227 v->s = (o2->
s + d1->
s) / 2;
228 }
else if(
VertLeq( d1, d2 )) {
229
232 if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
234 } else {
235
238 if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
240 }
241
242
243
247
249
250 v->t = (o2->
t + d1->
t) / 2;
252
255 if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
257 } else {
258
261 if( z1+z2 < 0 ) { z1 = -z1; z2 = -z2; }
263 }
264}
#define Interpolate(a, x, b, y)
#define TransEval(u, v, w)
#define EdgeSign(u, v, w)
#define TransSign(u, v, w)
#define EdgeEval(u, v, w)
Referenced by CheckForIntersect().
◆ __gl_edgeSign()
Definition at line 77 of file geom.c.
78{
79
80
81
82
84
86
89
90 if( gapL + gapR > 0 ) {
91 return (
v->t -
w->t) * gapL + (
v->t -
u->t) * gapR;
92 }
93
94 return 0;
95}
◆ __gl_transEval()
Definition at line 102 of file geom.c.
103{
104
105
106
107
108
109
110
111
112
113
115
117
120
121 if( gapL + gapR > 0 ) {
122 if( gapL < gapR ) {
123 return (
v->s -
u->s) + (
u->s -
w->s) * (gapL / (gapL + gapR));
124 } else {
125 return (
v->s -
w->s) + (
w->s -
u->s) * (gapR / (gapL + gapR));
126 }
127 }
128
129 return 0;
130}
◆ __gl_transSign()
Definition at line 132 of file geom.c.
133{
134
135
136
137
139
141
144
145 if( gapL + gapR > 0 ) {
146 return (
v->s -
w->s) * gapL + (
v->s -
u->s) * gapR;
147 }
148
149 return 0;
150}
◆ __gl_vertCCW()
Definition at line 153 of file geom.c.
154{
155
156
157
158
159
160
161 return (
u->s*(
v->t -
w->t) +
v->s*(
w->t -
u->t) +
w->s*(
u->t -
v->t)) >= 0;
162}
◆ __gl_vertLeq()