Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
octa.hpp File Reference
#include "inexor/engine/material.hpp"
#include "inexor/engine/octree.hpp"
#include "inexor/engine/world.hpp"
#include "inexor/network/SharedVar.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/geom.hpp"

Go to the source code of this file.

Functions

cubenewcubes (uint face=F_EMPTY, int mat=MAT_AIR)
 
cubeextgrowcubeext (cubeext *ext, int maxverts)
 
void setcubeext (cube &c, cubeext *ext)
 
cubeextnewcubeext (cube &c, int maxverts=0, bool init=true)
 
void getcubevector (cube &c, int d, int x, int y, int z, ivec &p)
 
void setcubevector (cube &c, int d, int x, int y, int z, const ivec &p)
 
int familysize (const cube &c)
 
void freeocta (cube *c)
 
void discardchildren (cube &c, bool fixtex=false, int depth=0)
 
void optiface (uchar *p, cube &c)
 
void validatec (cube *c, int size=0)
 
bool isvalidcube (const cube &c)
 
cubelookupcube (const ivec &to, int tsize=0, ivec &ro=lu, int &rsize=lusize)
 
const cubeneighbourcube (const cube &c, int orient, const ivec &co, int size, ivec &ro=lu, int &rsize=lusize)
 
void resetclipplanes ()
 
int getmippedtexture (const cube &p, int orient)
 
void forcemip (cube &c, bool fixtex=true)
 
bool subdividecube (cube &c, bool fullcheck=true, bool brighten=true)
 
void edgespan2vectorcube (cube &c)
 
int faceconvexity (const ivec v[4])
 
int faceconvexity (const ivec v[4], int &vis)
 
int faceconvexity (const vertinfo *verts, int numverts, int size)
 
int faceconvexity (const cube &c, int orient)
 
void calcvert (const cube &c, const ivec &co, int size, ivec &vert, int i, bool solid=false)
 
void calcvert (const cube &c, const ivec &co, int size, vec &vert, int i, bool solid=false)
 
uint faceedges (const cube &c, int orient)
 
bool collapsedface (const cube &c, int orient)
 
bool touchingface (const cube &c, int orient)
 
bool flataxisface (const cube &c, int orient)
 
bool collideface (const cube &c, int orient)
 
int genclipplane (const cube &c, int i, vec *v, plane *clip)
 
void genclipplanes (const cube &c, const ivec &co, int size, clipplanes &p, bool collide=true)
 
bool visibleface (const cube &c, int orient, const ivec &co, int size, ushort mat=MAT_AIR, ushort nmat=MAT_AIR, ushort matmask=MATF_VOLUME)
 
int classifyface (const cube &c, int orient, const ivec &co, int size)
 
int visibletris (const cube &c, int orient, const ivec &co, int size, ushort nmat=MAT_ALPHA, ushort matmask=MAT_ALPHA)
 
int visibleorient (const cube &c, int orient)
 
void genfaceverts (const cube &c, int orient, ivec v[4])
 
int calcmergedsize (int orient, const ivec &co, int size, const vertinfo *verts, int numverts)
 
void invalidatemerges (cube &c, const ivec &co, int size, bool msg)
 
void calcmerges ()
 
int mergefaces (int orient, facebounds *m, int sz)
 
void mincubeface (const cube &cu, int orient, const ivec &o, int size, const facebounds &orig, facebounds &cf, ushort nmat=MAT_AIR, ushort matmask=MATF_VOLUME)
 
static cubeextext (cube &c)
 
int lookupmaterial (const vec &o)
 
static bool insideworld (const vec &o)
 
static bool insideworld (const ivec &o)
 

Variables

ivec lu
 lookup integer vector More...
 
int lusize
 lookup size More...
 
const cubeneighbourstack [32]
 
int neighbourdepth
 
const ivec cubecoords [8]
 
const ivec facecoords [6][4]
 
const uchar fv [6][4]
 
const uchar fvmasks [64]
 
const uchar faceedgesidx [6][4]
 

Function Documentation

int calcmergedsize ( int  orient,
const ivec co,
int  size,
const vertinfo verts,
int  numverts 
)
void calcmerges ( )

References genmergeprogress, and genmerges().

Referenced by mpremip().

void calcvert ( const cube c,
const ivec co,
int  size,
ivec vert,
int  i,
bool  solid = false 
)
void calcvert ( const cube c,
const ivec co,
int  size,
vec vert,
int  i,
bool  solid = false 
)

References vec::add(), f(), gencubevert(), and vec::mul().

int classifyface ( const cube c,
int  orient,
const ivec co,
int  size 
)
bool collapsedface ( const cube c,
int  orient 
)
bool collideface ( const cube c,
int  orient 
)

References faceedgesidx, flataxisface(), and orient.

Referenced by setcubevisibility().

void discardchildren ( cube c,
bool  fixtex = false,
int  depth = 0 
)
void edgespan2vectorcube ( cube c)

References cubeedge, edgeset, genedgespanvert(), isempty, isentirelysolid, and loop.

Referenced by loadc().

static cubeext& ext ( cube c)
inlinestatic
int faceconvexity ( const ivec  v[4])
int faceconvexity ( const ivec  v[4],
int &  vis 
)
int faceconvexity ( const vertinfo verts,
int  numverts,
int  size 
)
int faceconvexity ( const cube c,
int  orient 
)
uint faceedges ( const cube c,
int  orient 
)

References faceedges().

int familysize ( const cube c)

References cube::children, familysize(), and loopi().

Referenced by familysize(), and undosize().

bool flataxisface ( const cube c,
int  orient 
)
void forcemip ( cube c,
bool  fixtex = true 
)
void freeocta ( cube c)
int genclipplane ( const cube c,
int  i,
vec v,
plane clip 
)
void genclipplanes ( const cube c,
const ivec co,
int  size,
clipplanes p,
bool  collide = true 
)
void genfaceverts ( const cube c,
int  orient,
ivec  v[4] 
)
void getcubevector ( cube c,
int  d,
int  x,
int  y,
int  z,
ivec p 
)

References C, cubeedge, D, edgeget, loopi(), and R.

Referenced by forcemip(), linkedpush(), hmap::pushside(), and subdividecube().

int getmippedtexture ( const cube p,
int  orient 
)
cubeext* growcubeext ( cubeext ext,
int  maxverts 
)
static bool insideworld ( const vec o)
inlinestatic
static bool insideworld ( const ivec o)
inlinestatic

References worldsize.

void invalidatemerges ( cube c,
const ivec co,
int  size,
bool  msg 
)
bool isvalidcube ( const cube c)
cube& lookupcube ( const ivec to,
int  tsize = 0,
ivec ro = lu,
int &  rsize = lusize 
)
int lookupmaterial ( const vec o)
int mergefaces ( int  orient,
facebounds m,
int  sz 
)

References loopi(), mergeface(), mergefacecmp(), and quicksort().

Referenced by addskyverts().

void mincubeface ( const cube cu,
int  orient,
const ivec o,
int  size,
const facebounds orig,
facebounds cf,
ushort  nmat = MAT_AIR,
ushort  matmask = MATF_VOLUME 
)
const cube& neighbourcube ( const cube c,
int  orient,
const ivec co,
int  size,
ivec ro = lu,
int &  rsize = lusize 
)
cubeext* newcubeext ( cube c,
int  maxverts = 0,
bool  init = true 
)
cube* newcubes ( uint  face = F_EMPTY,
int  mat = MAT_AIR 
)
void optiface ( uchar p,
cube c 
)

References emptyfaces, and f().

Referenced by mpeditface().

void resetclipplanes ( )

References clipcacheversion.

Referenced by allchanged(), and commitchanges().

void setcubeext ( cube c,
cubeext ext 
)

References ext(), and cube::ext.

Referenced by cleanupthreads(), newcubeext(), and setsurface().

void setcubevector ( cube c,
int  d,
int  x,
int  y,
int  z,
const ivec p 
)

References C, cubeedge, D, edgeset, loopi(), and R.

Referenced by forcemip(), and hmap::pushside().

bool subdividecube ( cube c,
bool  fullcheck = true,
bool  brighten = true 
)
bool touchingface ( const cube c,
int  orient 
)
void validatec ( cube c,
int  size = 0 
)
bool visibleface ( const cube c,
int  orient,
const ivec co,
int  size,
ushort  mat = MAT_AIR,
ushort  nmat = MAT_AIR,
ushort  matmask = MATF_VOLUME 
)
int visibleorient ( const cube c,
int  orient 
)
int visibletris ( const cube c,
int  orient,
const ivec co,
int  size,
ushort  nmat = MAT_ALPHA,
ushort  matmask = MAT_ALPHA 
)

Variable Documentation

const ivec cubecoords[8]
const ivec facecoords[6][4]

Referenced by addskyverts(), and convertoldsurfaces().

const uchar faceedgesidx[6][4]
const uchar fv[6][4]
const uchar fvmasks[64]
ivec lu

lookup integer vector

Referenced by normalizelookupcube(), printcube(), and rendereditcursor().

int lusize
int neighbourdepth
const cube* neighbourstack[32]