diff options
author | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-07-09 00:04:40 +0400 |
---|---|---|
committer | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-07-09 00:04:40 +0400 |
commit | 85f6c108aca9f86fb5e219ade03e15791bb822e8 (patch) | |
tree | 21909f774a946af9d704a27c656812c8bb6f93b0 /source/blender/render/intern/include/rayobject.h | |
parent | 8105454cba0be3405fc0e6fe95c979f429ed0ca4 (diff) |
*Added support for variable cost per RayObject
Suposedly usefull for creating trees of objects (where objects have very diferent size-NumFaces and shape-BB)
Altought the implemented costs maybe not be very correct (for now), as i didnt cared about following a specific "corrected" model
Diffstat (limited to 'source/blender/render/intern/include/rayobject.h')
-rw-r--r-- | source/blender/render/intern/include/rayobject.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h index c611e2ceca2..de36a1e4888 100644 --- a/source/blender/render/intern/include/rayobject.h +++ b/source/blender/render/intern/include/rayobject.h @@ -86,11 +86,13 @@ struct RayObject }; + typedef int (*RE_rayobject_raycast_callback)(RayObject *, Isect *); -typedef void (*RE_rayobject_add_callback)(RayObject *, RayObject *); +typedef void (*RE_rayobject_add_callback)(RayObject *raytree, RayObject *rayobject); typedef void (*RE_rayobject_done_callback)(RayObject *); typedef void (*RE_rayobject_free_callback)(RayObject *); typedef void (*RE_rayobject_merge_bb_callback)(RayObject *, float *min, float *max); +typedef float (*RE_rayobject_cost_callback)(RayObject *); typedef struct RayObjectAPI { @@ -99,6 +101,7 @@ typedef struct RayObjectAPI RE_rayobject_done_callback done; RE_rayobject_free_callback free; RE_rayobject_merge_bb_callback bb; + RE_rayobject_cost_callback cost; } RayObjectAPI; @@ -128,6 +131,12 @@ int RE_rayobject_intersect(RayObject *r, Isect *i); */ float RE_rayobject_bb_intersect(const Isect *i, const float *bb); +/* + * Returns the expected cost of raycast on this node, primitives have a cost of 1 + */ +float RE_rayobject_cost(RayObject *r); + + #define ISECT_EPSILON ((float)FLT_EPSILON) |