Fixed #19571
(was crashing when building a raytree from a scene withouth any geometry)
This commit is contained in:
@@ -535,3 +535,43 @@ int RE_rayobjectcontrol_test_break(RayObjectControl *control)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Empty raytree
|
||||
*/
|
||||
static int RE_rayobject_empty_intersect(RayObject *o, Isect *is)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void RE_rayobject_empty_free(RayObject *o)
|
||||
{
|
||||
}
|
||||
|
||||
static void RE_rayobject_empty_bb(RayObject *o, float *min, float *max)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static float RE_rayobject_empty_cost(RayObject *o)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
static RayObjectAPI empty_api =
|
||||
{
|
||||
RE_rayobject_empty_intersect,
|
||||
NULL, //static void RE_rayobject_instance_add(RayObject *o, RayObject *ob);
|
||||
NULL, //static void RE_rayobject_instance_done(RayObject *o);
|
||||
RE_rayobject_empty_free,
|
||||
RE_rayobject_empty_bb,
|
||||
RE_rayobject_empty_cost
|
||||
};
|
||||
|
||||
static RayObject empty_raytree = { &empty_api, {0, 0} };
|
||||
|
||||
RayObject *RE_rayobject_empty_create()
|
||||
{
|
||||
return RE_rayobject_unalignRayAPI( &empty_raytree );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user