diff options
author | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-10-04 20:56:00 +0400 |
---|---|---|
committer | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-10-04 20:56:00 +0400 |
commit | 55541d8a8143b97ce0d452caf4ececa8903c31a0 (patch) | |
tree | a381d591f2c9b7bd95bc5766ed4c498380e0b5c0 /source/blender/render/intern/include/rayobject.h | |
parent | 8da55763b541075dae4b1f7713c43af2b609e332 (diff) |
Added some test_break during the build process.
(Maybe later this should be done with some thread_cancel function instead of doing variable/callbacks tests)
Diffstat (limited to 'source/blender/render/intern/include/rayobject.h')
-rw-r--r-- | source/blender/render/intern/include/rayobject.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h index 337f9ca3fdd..9e35c0feac5 100644 --- a/source/blender/render/intern/include/rayobject.h +++ b/source/blender/render/intern/include/rayobject.h @@ -93,6 +93,21 @@ extern "C" { #define RE_rayobject_isVlakPrimitive(o) ((((intptr_t)o)&3) == 3) + +/* + * This class is intended as a place holder for control, configuration of the rayobject like: + * - stop building (TODO maybe when porting build to threads this could be implemented with some thread_cancel function) + * - max number of threads and threads callback to use during build + * ... + */ +typedef int (*RE_rayobjectcontrol_test_break_callback)(void *data); +typedef struct RayObjectControl RayObjectControl; +struct RayObjectControl +{ + void *data; + RE_rayobjectcontrol_test_break_callback test_break; +}; + /* * This rayobject represents a generic object. With it's own callbacks for raytrace operations. * It's suitable to implement things like LOD. @@ -100,9 +115,13 @@ extern "C" { struct RayObject { struct RayObjectAPI *api; + + struct RayObjectControl control; }; + + typedef int (*RE_rayobject_raycast_callback)(RayObject *, Isect *); typedef void (*RE_rayobject_add_callback)(RayObject *raytree, RayObject *rayobject); typedef void (*RE_rayobject_done_callback)(RayObject *); @@ -144,6 +163,11 @@ int RE_rayobject_bb_intersect_test(const Isect *i, const float *bb); /* same as float RE_rayobject_cost(RayObject *r); +/* + * Returns true if for some reason a heavy processing function should stop + * (eg.: user asked to stop during a tree a build) + */ +int RE_rayobjectcontrol_test_break(RayObjectControl *c); #define ISECT_EPSILON ((float)FLT_EPSILON) |