| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#ifndef HEMICUBE_H |
| 20 |
#define HEMICUBE_H |
| 21 |
|
| 22 |
#include "3d.h" |
| 23 |
#include "radiosity.h" |
| 24 |
#include "gr.h" |
| 25 |
|
| 26 |
struct rad_hemicube { |
| 27 |
matrix view_matrix; |
| 28 |
matrix head_matrix; |
| 29 |
vector view_position; |
| 30 |
rad_element *shooting_element; |
| 31 |
rad_surface *shooting_surface; |
| 32 |
|
| 33 |
grHardwareSurface drawing_surface; |
| 34 |
grViewport *vport; |
| 35 |
int *id_grid; |
| 36 |
float *depth_grid; |
| 37 |
|
| 38 |
float *top_array; |
| 39 |
float *side_array; |
| 40 |
|
| 41 |
int ff_res; |
| 42 |
int grid_dim; |
| 43 |
}; |
| 44 |
|
| 45 |
struct hemicube_point { |
| 46 |
float sx, sy; |
| 47 |
float z; |
| 48 |
}; |
| 49 |
|
| 50 |
extern rad_hemicube rad_Hemicube; |
| 51 |
extern int Hemicube_resolution; |
| 52 |
|
| 53 |
|
| 54 |
void CalculateFormFactorsHemiCube(); |
| 55 |
|
| 56 |
|
| 57 |
void InitHemicube(int resolution); |
| 58 |
|
| 59 |
void CloseHemicube(); |
| 60 |
|
| 61 |
|
| 62 |
void ClearHemicubeGrid(); |
| 63 |
|
| 64 |
|
| 65 |
void SetElementView(rad_element *ep); |
| 66 |
|
| 67 |
|
| 68 |
void SetSurfaceView(rad_surface *ep); |
| 69 |
|
| 70 |
|
| 71 |
void BuildTransform(vector *nu, vector *nv, vector *nn); |
| 72 |
|
| 73 |
|
| 74 |
void StartHemicubeDrawing(); |
| 75 |
|
| 76 |
|
| 77 |
void EndHemicubeDrawing(int); |
| 78 |
|
| 79 |
|
| 80 |
void UpdateView(int face_id); |
| 81 |
|
| 82 |
|
| 83 |
void ScanRadiosityPoly(g3Point **pl, int nv, int element_id); |
| 84 |
void DrawRadiosityPoly(int nv, g3Point **pointlist, int id); |
| 85 |
void GetVertexOrdering(hemicube_point *t, int nv, int *vlt, int *vlb, int *vrt, int *vrb, int *bottom_y_ind); |
| 86 |
int PrevIndex(int val, int modulus); |
| 87 |
int NextIndex(int val, int modulus); |
| 88 |
|
| 89 |
|
| 90 |
void SumDeltas(float *ff_array, int face_id); |
| 91 |
|
| 92 |
float GetTopFactor(int row, int col); |
| 93 |
|
| 94 |
|
| 95 |
float GetSideFactor(int row, int col); |
| 96 |
|
| 97 |
#endif |