![]() |
Blender V2.61 - r43446
|
#include <math.h>#include <string.h>#include <stdlib.h>#include <float.h>#include <assert.h>#include "MEM_guardedalloc.h"#include "DNA_material_types.h"#include "BLI_math.h"#include "BLI_utildefines.h"#include "rayintersection.h"#include "rayobject.h"Go to the source code of this file.
Classes | |
| struct | Branch |
| struct | OcVal |
| struct | Node |
| class | Octree |
Defines | |
| #define | BRANCH_ARRAY 1024 |
| #define | NODE_ARRAY 4096 |
| #define | OCVALRES 15 |
| #define | BROW16(min, max) (((max)>=OCVALRES? 0xFFFF: (1<<(max+1))-1) - ((min>0)? ((1<<(min))-1):0) ) |
Typedefs | |
| typedef struct Branch | Branch |
| typedef struct OcVal | OcVal |
| typedef struct Node | Node |
| typedef struct Octree | Octree |
Functions | |
| static int | RE_rayobject_octree_intersect (RayObject *o, Isect *isec) |
| static void | RE_rayobject_octree_add (RayObject *o, RayObject *ob) |
| static void | RE_rayobject_octree_done (RayObject *o) |
| static void | RE_rayobject_octree_free (RayObject *o) |
| static void | RE_rayobject_octree_bb (RayObject *o, float *min, float *max) |
| static float | RE_rayobject_octree_cost (RayObject *UNUSED(o)) |
| static void | RE_rayobject_octree_hint_bb (RayObject *UNUSED(o), RayHint *UNUSED(hint), float *UNUSED(min), float *UNUSED(max)) |
| static void | calc_ocval_face (float *v1, float *v2, float *v3, float *v4, short x, short y, short z, OcVal *ov) |
| static void | calc_ocval_ray (OcVal *ov, float xo, float yo, float zo, float *vec1, float *vec2) |
| static Branch * | addbranch (Octree *oc, Branch *br, short ocb) |
| static Node * | addnode (Octree *oc) |
| static int | face_in_node (RayFace *face, short x, short y, short z, float rtf[][3]) |
| static void | ocwrite (Octree *oc, RayFace *face, int quad, short x, short y, short z, float rtf[4][3]) |
| static void | d2dda (Octree *oc, short b1, short b2, short c1, short c2, char *ocface, short rts[][3], float rtf[][3]) |
| static void | filltriangle (Octree *oc, short c1, short c2, char *ocface, short *ocmin, short *ocmax) |
| RayObject * | RE_rayobject_octree_create (int ocres, int size) |
| static void | octree_fill_rayface (Octree *oc, RayFace *face) |
| static int | testnode (Octree *UNUSED(oc), Isect *is, Node *no, OcVal ocval) |
| static Node * | ocread (Octree *oc, int x, int y, int z) |
| static int | cliptest (float p, float q, float *u1, float *u2) |
Variables | |
| static RayObjectAPI | octree_api |
Definition in file rayobject_octree.cpp.
| #define BRANCH_ARRAY 1024 |
Definition at line 51 of file rayobject_octree.cpp.
Referenced by addbranch(), and RE_rayobject_octree_done().
| #define BROW16 | ( | min, | |
| max | |||
| ) | (((max)>=OCVALRES? 0xFFFF: (1<<(max+1))-1) - ((min>0)? ((1<<(min))-1):0) ) |
Definition at line 125 of file rayobject_octree.cpp.
Referenced by calc_ocval_face(), and calc_ocval_ray().
| #define NODE_ARRAY 4096 |
Definition at line 52 of file rayobject_octree.cpp.
Referenced by addnode(), and RE_rayobject_octree_done().
| #define OCVALRES 15 |
Definition at line 124 of file rayobject_octree.cpp.
Referenced by calc_ocval_face(), and calc_ocval_ray().
Definition at line 188 of file rayobject_octree.cpp.
References Octree::adrbranch, Branch::b, BRANCH_ARRAY, Octree::branchcount, MEM_callocN(), and NULL.
Referenced by ocwrite().
Definition at line 208 of file rayobject_octree.cpp.
References Octree::adrnode, MEM_callocN(), NODE_ARRAY, Octree::nodecount, and NULL.
Referenced by ocwrite().
| static void calc_ocval_face | ( | float * | v1, |
| float * | v2, | ||
| float * | v3, | ||
| float * | v4, | ||
| short | x, | ||
| short | y, | ||
| short | z, | ||
| OcVal * | ov | ||
| ) | [static] |
Definition at line 127 of file rayobject_octree.cpp.
References BROW16, copy_v3_v3(), DO_MINMAX, max, min, OCVALRES, OcVal::ocx, OcVal::ocy, and OcVal::ocz.
Referenced by ocwrite().
| static void calc_ocval_ray | ( | OcVal * | ov, |
| float | xo, | ||
| float | yo, | ||
| float | zo, | ||
| float * | vec1, | ||
| float * | vec2 | ||
| ) | [static] |
Definition at line 154 of file rayobject_octree.cpp.
References BROW16, OCVALRES, OcVal::ocx, OcVal::ocy, and OcVal::ocz.
Referenced by RE_rayobject_octree_intersect().
| static int cliptest | ( | float | p, |
| float | q, | ||
| float * | u1, | ||
| float * | u2 | ||
| ) | [static] |
Definition at line 781 of file rayobject_octree.cpp.
References p.
Referenced by RE_rayobject_octree_intersect().
| static void d2dda | ( | Octree * | oc, |
| short | b1, | ||
| short | b2, | ||
| short | c1, | ||
| short | c2, | ||
| char * | ocface, | ||
| short | rts[][3], | ||
| float | rtf[][3] | ||
| ) | [static] |
Definition at line 324 of file rayobject_octree.cpp.
References MIN2, Octree::ocres, and TRUE.
Referenced by octree_fill_rayface().
| static int face_in_node | ( | RayFace * | face, |
| short | x, | ||
| short | y, | ||
| short | z, | ||
| float | rtf[][3] | ||
| ) | [static] |
Definition at line 226 of file rayobject_octree.cpp.
References simple_enum_gen::d, and normal_tri_v3().
Referenced by octree_fill_rayface().
| static void filltriangle | ( | Octree * | oc, |
| short | c1, | ||
| short | c2, | ||
| char * | ocface, | ||
| short * | ocmin, | ||
| short * | ocmax | ||
| ) | [static] |
Definition at line 406 of file rayobject_octree.cpp.
References Octree::ocres.
Referenced by octree_fill_rayface().
Definition at line 723 of file rayobject_octree.cpp.
References Octree::adrbranch, Branch::b, NULL, and Octree::ocres.
Referenced by RE_rayobject_octree_intersect().
Definition at line 496 of file rayobject_octree.cpp.
References copy_v3_v3(), d2dda(), face_in_node(), filltriangle(), MAX3(), MAX4, Octree::min, MIN3, MIN4, NULL, Octree::ocface, Octree::ocfacx, Octree::ocfacy, Octree::ocfacz, Octree::ocres, ocwrite(), RE_rayface_isQuad, RayFace::v1, RayFace::v2, RayFace::v3, and RayFace::v4.
Referenced by RE_rayobject_octree_done().
| static void ocwrite | ( | Octree * | oc, |
| RayFace * | face, | ||
| int | quad, | ||
| short | x, | ||
| short | y, | ||
| short | z, | ||
| float | rtf[4][3] | ||
| ) | [static] |
Definition at line 266 of file rayobject_octree.cpp.
References addbranch(), addnode(), Octree::adrbranch, Branch::b, calc_ocval_face(), Node::next, NULL, Octree::ocres, Node::ov, RE_rayobject_align, and Node::v.
Referenced by octree_fill_rayface().
Definition at line 487 of file rayobject_octree.cpp.
References assert, RE_rayobject_align, RE_rayobject_isRayFace, Octree::ro_nodes, Octree::ro_nodes_size, and Octree::ro_nodes_used.
| static void RE_rayobject_octree_bb | ( | RayObject * | o, |
| float * | min, | ||
| float * | max | ||
| ) | [static] |
Definition at line 667 of file rayobject_octree.cpp.
References DO_MINMAX, Octree::max, and Octree::min.
| static float RE_rayobject_octree_cost | ( | RayObject * | UNUSEDo | ) | [static] |
Definition at line 99 of file rayobject_octree.cpp.
| RayObject* RE_rayobject_octree_create | ( | int | ocres, |
| int | size | ||
| ) |
Definition at line 469 of file rayobject_octree.cpp.
References RayObject::api, assert, MEM_callocN(), Octree::ocres, octree_api, Octree::rayobj, RE_rayobject_isAligned, RE_rayobject_unalignRayAPI, Octree::ro_nodes, Octree::ro_nodes_size, Octree::ro_nodes_used, and size().
Referenced by RE_rayobject_create().
| static void RE_rayobject_octree_done | ( | RayObject * | o | ) | [static] |
Definition at line 613 of file rayobject_octree.cpp.
References Octree::adrbranch, Octree::adrnode, BRANCH_ARRAY, INIT_MINMAX, Octree::max, MEM_callocN(), MEM_freeN(), Octree::min, NODE_ARRAY, NULL, Octree::ocface, Octree::ocfacx, Octree::ocfacy, Octree::ocfacz, Octree::ocres, Octree::ocsize, octree_fill_rayface(), RE_rayobject_merge_bb(), RE_rayobject_unalignRayFace, Octree::ro_nodes, Octree::ro_nodes_used, and sqrt().
| static void RE_rayobject_octree_free | ( | RayObject * | o | ) | [static] |
Definition at line 428 of file rayobject_octree.cpp.
References Octree::adrbranch, Octree::adrnode, Octree::branchcount, MEM_freeN(), Octree::nodecount, NULL, and Octree::ocface.
| static void RE_rayobject_octree_hint_bb | ( | RayObject * | UNUSEDo, |
| RayHint * | UNUSEDhint, | ||
| float * | UNUSEDmin, | ||
| float * | UNUSEDmax | ||
| ) | [static] |
Definition at line 104 of file rayobject_octree.cpp.
Definition at line 839 of file rayobject_octree.cpp.
References Octree::branchcount, calc_ocval_ray(), cliptest(), copy_v3_v3(), Isect::dir, Isect::dist, Isect::isect, madd_v3_v3v3fl(), Octree::max, Octree::min, MIN3, NULL, Octree::ocfacx, Octree::ocfacy, Octree::ocfacz, ocread(), Isect::start, testnode(), TRUE, and Isect::userdata.
Definition at line 675 of file rayobject_octree.cpp.
References Isect::mode, Node::next, OcVal::ocx, OcVal::ocy, OcVal::ocz, Node::ov, RE_RAY_SHADOW, RE_rayobject_intersect(), RE_rayobject_unalignRayFace, and Node::v.
Referenced by RE_rayobject_octree_intersect().
RayObjectAPI octree_api [static] |
{
RE_rayobject_octree_intersect,
RE_rayobject_octree_add,
RE_rayobject_octree_done,
RE_rayobject_octree_free,
RE_rayobject_octree_bb,
RE_rayobject_octree_cost,
RE_rayobject_octree_hint_bb
}
Definition at line 110 of file rayobject_octree.cpp.
Referenced by RE_rayobject_octree_create().