10 |
|
#define _SM_H_ |
11 |
|
|
12 |
|
#include "rhd_sample.h" |
13 |
+ |
#define NEWSETS |
14 |
|
|
15 |
|
|
16 |
|
#ifndef TRUE |
18 |
|
#define FALSE 0 |
19 |
|
#endif |
20 |
|
|
21 |
< |
#define S_REPLACE_EPS 0.06 /* if (distance on sphere between sample |
21 |
> |
|
22 |
> |
#define ON_V 1 |
23 |
> |
#define ON_P 2 |
24 |
> |
#define ON_E 3 |
25 |
> |
#define IN_T 4 |
26 |
> |
|
27 |
> |
#define S_REPLACE_EPS 0.04 /* if (distance on sphere between sample |
28 |
|
and a base point) < S_REPLACE_EPS, |
29 |
< |
replace base |
29 |
> |
replace base: |
30 |
|
*/ |
31 |
|
#define S_REPLACE_SCALE (5.*5.) /* if (distance to new point squared) is |
32 |
|
> (triangle edge length squared* |
39 |
|
#define SQRT3_2 0.8660254 |
40 |
|
|
41 |
|
#define SM_DEFAULT 0 |
42 |
< |
#define SM_EXTRA_POINTS 8 |
42 |
> |
#define SM_EXTRA_POINTS 162 |
43 |
> |
#define SM_BASE_TRIS 320 |
44 |
|
#define SM_EXTRA_VERTS SM_EXTRA_POINTS |
45 |
|
|
46 |
|
#define SM_INC_PERCENT 0.60 /* If number of new triangles added |
86 |
|
#define T_WHICH_V(t,i) \ |
87 |
|
(T_NTH_V(t,0)==(i)?0:T_NTH_V(t,1)==(i)?1:T_NTH_V(t,2)==(i)?2:-1) |
88 |
|
#define T_NEXT_FREE(t) ((t)->nbrs[0]) |
89 |
+ |
#define T_NEXT_AVAILABLE(t) ((t)->nbrs[0]) |
90 |
|
#define T_VALID_FLAG(t) ((t)->nbrs[1]) |
91 |
|
#define T_IS_VALID(t) (T_VALID_FLAG(t)!=-1) |
92 |
|
#define T_FLAGS 3 |
99 |
|
int num_tri; /* Current number of triangles */ |
100 |
|
int sample_tris; /* Current number of non-base triangles*/ |
101 |
|
int free_tris; /* pointer to free_list */ |
102 |
+ |
int available_tris; /* pointer to available_list */ |
103 |
|
int max_verts; /* Maximum number of vertices in the mesh */ |
104 |
|
TRI *tris; /* Pointer to list of triangle structs */ |
105 |
|
VERT *verts; /* List of vertices */ |
119 |
|
#define SM_NUM_TRI(m) ((m)->num_tri) |
120 |
|
#define SM_SAMPLE_TRIS(m) ((m)->sample_tris) |
121 |
|
#define SM_FREE_TRIS(m) ((m)->free_tris) |
122 |
+ |
#define SM_AVAILABLE_TRIS(m) ((m)->available_tris) |
123 |
|
#define SM_MAX_VERTS(m) ((m)->max_verts) |
124 |
|
#define SM_TRIS(m) ((m)->tris) |
125 |
|
#define SM_VERTS(m) ((m)->verts) |
145 |
|
|
146 |
|
#define SM_NTH_TRI(m,n) (&(SM_TRIS(m)[(n)])) |
147 |
|
#define SM_NTH_VERT(m,n) (SM_VERTS(m)[(n)]) |
148 |
+ |
|
149 |
+ |
#define SM_T_ID_VALID(s,t_id) T_IS_VALID(SM_NTH_TRI(s,t_id)) |
150 |
|
|
151 |
|
#define SM_MAX_SAMP(m) S_MAX_SAMP(SM_SAMP(m)) |
152 |
|
#define SM_MAX_POINTS(m) S_MAX_POINTS(SM_SAMP(m)) |
294 |
|
* been output since the last call to smClean(). (The last view drawn will |
295 |
|
* be vp==&odev.v each time.) |
296 |
|
*/ |
284 |
– |
|
297 |
|
#endif |
298 |
|
|
299 |
|
|