Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Susano Pinto <andresusanopinto@gmail.com>2009-07-01 15:27:43 +0400
committerAndre Susano Pinto <andresusanopinto@gmail.com>2009-07-01 15:27:43 +0400
commit91226e6807435c6e0163865fea4cb45e22b14e16 (patch)
tree4ccd28dd08b8bc8fa22b22ed8f613be1d239a354 /source/blender/render/intern/include
parent1deba75110aebda447beb79a8f07dae35f5bcc65 (diff)
*Added rayobject_bvh
A bvh structure to use on the raytracer
Diffstat (limited to 'source/blender/render/intern/include')
-rw-r--r--source/blender/render/intern/include/rayobject.h6
-rw-r--r--source/blender/render/intern/include/rayobject_rtbuild.h23
2 files changed, 11 insertions, 18 deletions
diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h
index d516c122bcc..3b77341f229 100644
--- a/source/blender/render/intern/include/rayobject.h
+++ b/source/blender/render/intern/include/rayobject.h
@@ -123,6 +123,12 @@ void RE_rayobject_merge_bb(RayObject *ob, float *min, float *max);
*/
int RE_rayobject_intersect(RayObject *r, Isect *i);
+/*
+ * Returns distance ray must travel to hit the given bounding box
+ * BB should be in format [2][3]
+ */
+float RE_rayobject_bb_intersect(const Isect *i, const float *bb);
+
#define ISECT_EPSILON ((float)FLT_EPSILON)
diff --git a/source/blender/render/intern/include/rayobject_rtbuild.h b/source/blender/render/intern/include/rayobject_rtbuild.h
index b1458a571dd..fbe3930149c 100644
--- a/source/blender/render/intern/include/rayobject_rtbuild.h
+++ b/source/blender/render/intern/include/rayobject_rtbuild.h
@@ -50,8 +50,8 @@ typedef struct RTBuilder
/* axis used (if any) on the split method */
int split_axis;
- /* links to child partitions calculated during splitting */
- RayObject **child[MAX_CHILDS+1];
+ /* child partitions calculated during splitting */
+ int child_offset[MAX_CHILDS+1];
} RTBuilder;
@@ -63,22 +63,9 @@ int rtbuild_size(RTBuilder *b);
/* used during tree reorganization */
RTBuilder* rtbuild_get_child(RTBuilder *b, int child, RTBuilder *tmp);
-void rtbuild_mean_split(RTBuilder *b, int nchilds, int axis);
-void rtbuild_mean_split_largest_axis(RTBuilder *b, int nchilds);
-/*
-static BVHNode *bvh_rearrange(BVHTree *tree, RTBuilder *b)
-{
- int i;
- int nc = rtbuild_mean_split_largest_axis(b, BVH_NCHILDS);
- RTBuilder tmp;
-
- BVHNode *bvh = tree->next_node++;
-
- bvh->split_axis = tmp->split_axis;
- for(i=0; i<nc; i++)
- bvh->child[i] = bvh_rearrange( rtbuild_get_child(b, i, &tmp) );
-}
- */
+/* Calculates child partitions and returns number of efectively needed partitions */
+int rtbuild_mean_split(RTBuilder *b, int nchilds, int axis);
+int rtbuild_mean_split_largest_axis(RTBuilder *b, int nchilds);
#endif