Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions | Variables

rayobject_octree.cpp File Reference

#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 Branchaddbranch (Octree *oc, Branch *br, short ocb)
static Nodeaddnode (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)
RayObjectRE_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 Nodeocread (Octree *oc, int x, int y, int z)
static int cliptest (float p, float q, float *u1, float *u2)

Variables

static RayObjectAPI octree_api

Detailed Description

Definition in file rayobject_octree.cpp.


Define Documentation

#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().


Typedef Documentation

typedef struct Branch Branch
typedef struct Node Node
typedef struct Octree Octree
typedef struct OcVal OcVal

Function Documentation

static Branch* addbranch ( Octree oc,
Branch br,
short  ocb 
) [static]

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().

static Node* addnode ( Octree oc) [static]

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().

static Node* ocread ( Octree oc,
int  x,
int  y,
int  z 
) [static]

Definition at line 723 of file rayobject_octree.cpp.

References Octree::adrbranch, Branch::b, NULL, and Octree::ocres.

Referenced by RE_rayobject_octree_intersect().

static void octree_fill_rayface ( Octree oc,
RayFace face 
) [static]
static void ocwrite ( Octree oc,
RayFace face,
int  quad,
short  x,
short  y,
short  z,
float  rtf[4][3] 
) [static]
static void RE_rayobject_octree_add ( RayObject o,
RayObject ob 
) [static]
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 
)
static void RE_rayobject_octree_done ( RayObject o) [static]
static void RE_rayobject_octree_free ( RayObject o) [static]
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.

static int RE_rayobject_octree_intersect ( RayObject o,
Isect isec 
) [static]
static int testnode ( Octree UNUSEDoc,
Isect is,
Node no,
OcVal  ocval 
) [static]

Variable Documentation