Blender V2.61 - r43446
|
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <algorithm>
#include "rayobject_rtbuild.h"
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
Go to the source code of this file.
Classes | |
struct | SweepCost |
Functions | |
static bool | selected_node (RTBuilder::Object *node) |
static void | rtbuild_init (RTBuilder *b) |
RTBuilder * | rtbuild_create (int size) |
void | rtbuild_free (RTBuilder *b) |
void | rtbuild_add (RTBuilder *b, RayObject *o) |
int | rtbuild_size (RTBuilder *b) |
template<class Obj , int Axis> | |
static bool | obj_bb_compare (const Obj &a, const Obj &b) |
template<class Item > | |
static void | object_sort (Item *begin, Item *end, int axis) |
void | rtbuild_done (RTBuilder *b, RayObjectControl *ctrl) |
RayObject * | rtbuild_get_primitive (RTBuilder *b, int index) |
RTBuilder * | rtbuild_get_child (RTBuilder *b, int child, RTBuilder *tmp) |
void | rtbuild_calc_bb (RTBuilder *b) |
void | rtbuild_merge_bb (RTBuilder *b, float *min, float *max) |
int | rtbuild_heuristic_object_split (RTBuilder *b, int nchilds) |
float | bb_volume (float *min, float *max) |
float | bb_area (float *min, float *max) |
int | bb_largest_axis (float *min, float *max) |
int | bb_fits_inside (float *outer_min, float *outer_max, float *inner_min, float *inner_max) |
Definition in file rayobject_rtbuild.cpp.
float bb_area | ( | float * | min, |
float * | max | ||
) |
Definition at line 482 of file rayobject_rtbuild.cpp.
Referenced by bvh_refit(), VBVH_optimalPackSIMD< Node, TestCost >::calc_best::calc_best(), VBVH_optimalPackSIMD< Node, TestCost >::calc_costs(), pushup(), reorganize_find_fittest_parent(), and rtbuild_heuristic_object_split().
int bb_fits_inside | ( | float * | outer_min, |
float * | outer_max, | ||
float * | inner_min, | ||
float * | inner_max | ||
) |
Definition at line 519 of file rayobject_rtbuild.cpp.
References i.
Referenced by hint_test_bb(), node_fits_inside(), and pushdown().
int bb_largest_axis | ( | float * | min, |
float * | max | ||
) |
Definition at line 496 of file rayobject_rtbuild.cpp.
float bb_volume | ( | float * | min, |
float * | max | ||
) |
Definition at line 477 of file rayobject_rtbuild.cpp.
static bool obj_bb_compare | ( | const Obj & | a, |
const Obj & | b | ||
) | [static] |
Definition at line 142 of file rayobject_rtbuild.cpp.
static void object_sort | ( | Item * | begin, |
Item * | end, | ||
int | axis | ||
) | [static] |
Definition at line 150 of file rayobject_rtbuild.cpp.
References assert, and sort().
Referenced by rtbuild_done().
Definition at line 98 of file rayobject_rtbuild.cpp.
References assert, Object::bb, RTBuilder::begin, copy_v3_v3(), RTBuilder::end, i, INIT_MINMAX, RTBuilder::maxsize, RTBuilder::primitives, RE_rayobject_cost(), RE_rayobject_merge_bb(), and RTBuilder::sorted_end.
Referenced by bvh_add().
void rtbuild_calc_bb | ( | RTBuilder * | b | ) |
Definition at line 192 of file rayobject_rtbuild.cpp.
References RTBuilder::bb, RE_rayobject_merge_bb(), RTBuilder::sorted_begin, and RTBuilder::sorted_end.
Referenced by rtbuild_merge_bb().
RTBuilder* rtbuild_create | ( | int | size | ) |
Definition at line 66 of file rayobject_rtbuild.cpp.
References RTBuilder::begin, RTBuilder::end, i, RTBuilder::maxsize, MEM_mallocN(), RTBuilder::primitives, rtbuild_init(), size(), RTBuilder::sorted_begin, and RTBuilder::sorted_end.
Referenced by bvh_create_tree().
void rtbuild_done | ( | RTBuilder * | b, |
RayObjectControl * | ctrl | ||
) |
Definition at line 158 of file rayobject_rtbuild.cpp.
References i, object_sort(), RE_rayobjectcontrol_test_break(), RTBuilder::sorted_begin, and RTBuilder::sorted_end.
Referenced by bvh_done< VBVHTree >().
void rtbuild_free | ( | RTBuilder * | b | ) |
Definition at line 87 of file rayobject_rtbuild.cpp.
References RTBuilder::begin, i, MEM_freeN(), RTBuilder::primitives, and RTBuilder::sorted_begin.
Referenced by bvh_done< VBVHTree >(), and bvh_free().
Definition at line 173 of file rayobject_rtbuild.cpp.
References RTBuilder::child_offset, i, rtbuild_init(), RTBuilder::sorted_begin, and RTBuilder::sorted_end.
Referenced by BuildBinaryVBVH< Node >::_transform().
Definition at line 168 of file rayobject_rtbuild.cpp.
References RTBuilder::sorted_begin.
Referenced by BuildBinaryVBVH< Node >::_transform().
int rtbuild_heuristic_object_split | ( | RTBuilder * | b, |
int | nchilds | ||
) |
Definition at line 333 of file rayobject_rtbuild.cpp.
References assert, SweepCost::bb, RTBuilder::Object::bb, bb_area(), RTBuilder::child_offset, copy_v3_v3(), SweepCost::cost, RTBuilder::Object::cost, DO_MAX, DO_MIN, FLT_MAX, i, MAX2, MEM_freeN(), MEM_mallocN(), MIN2, rtbuild_size(), selected_node(), size(), RTBuilder::sorted_begin, and RTBuilder::sorted_end.
Referenced by BuildBinaryVBVH< Node >::rtbuild_split().
static void rtbuild_init | ( | RTBuilder * | b | ) | [static] |
Definition at line 50 of file rayobject_rtbuild.cpp.
References RTBuilder::bb, RTBuilder::begin, RTBuilder::child_offset, RTBuilder::end, i, INIT_MINMAX, RTBuilder::maxsize, RTBuilder::primitives, RTBUILD_MAX_CHILDS, RTBuilder::sorted_begin, RTBuilder::sorted_end, and RTBuilder::split_axis.
Referenced by rtbuild_create(), and rtbuild_get_child().
void rtbuild_merge_bb | ( | RTBuilder * | b, |
float * | min, | ||
float * | max | ||
) |
Definition at line 201 of file rayobject_rtbuild.cpp.
References RTBuilder::bb, DO_MAX, DO_MIN, and rtbuild_calc_bb().
Referenced by BuildBinaryVBVH< Node >::_transform().
int rtbuild_size | ( | RTBuilder * | b | ) |
Definition at line 135 of file rayobject_rtbuild.cpp.
References RTBuilder::sorted_begin, and RTBuilder::sorted_end.
Referenced by BuildBinaryVBVH< Node >::_transform(), and rtbuild_heuristic_object_split().
static bool selected_node | ( | RTBuilder::Object * | node | ) | [static] |
Definition at line 45 of file rayobject_rtbuild.cpp.
References RTBuilder::Object::selected.
Referenced by rtbuild_heuristic_object_split().