Advertisement
Guest User

Untitled

a guest
Sep 11th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.89 KB | None | 0 0
  1. #ifndef _TREE_H_
  2. #define _TREE_H_
  3.  
  4. #include <xmmintrin.h>
  5. #include <stdint.h>
  6.  
  7. #define N 3
  8. #define NS 8
  9. #define MAX_DOTS 7
  10.  
  11. #define LEAF 0
  12. #define FULL 1
  13.  
  14. typedef union
  15. {
  16.     float c[4];
  17.     __v4sf vect;
  18. } dot;
  19.  
  20. typedef struct
  21. {
  22.     unsigned int dots_num;
  23.     dot dots[MAX_DOTS];
  24. } leaf_data;
  25.  
  26. typedef struct
  27. {
  28.     dot center;
  29.     struct node *children[NS];
  30. } inner_data;
  31.  
  32. union node_data
  33. {
  34.     leaf_data leaf;
  35.     inner_data inner;
  36. };
  37.  
  38. struct node
  39. {
  40.     unsigned int flags;
  41.     dot bb_min;
  42.     dot bb_max;
  43.  
  44.     union node_data data;
  45. };
  46.  
  47. extern dot voxel;
  48.  
  49. void calc_bounding_box (const dot*, unsigned int, dot*, dot*);
  50. dot calc_avg (const dot*, unsigned int);
  51. uint8_t get_subspace_idx (dot, dot);
  52. dot align_on_voxel (dot);
  53. unsigned int filter_set (const dot*, dot*, unsigned int, uint8_t, dot);
  54. struct node* make_tree (const dot*, unsigned int);
  55.  
  56. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement