Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
normal.cpp File Reference
#include <math.h>
#include <stdlib.h>
#include <algorithm>
#include "inexor/engine/lightmap.hpp"
#include "inexor/engine/octa.hpp"
#include "inexor/engine/octarender.hpp"
#include "inexor/engine/octree.hpp"
#include "inexor/engine/renderbackground.hpp"
#include "inexor/engine/world.hpp"
#include "inexor/network/SharedVar.hpp"
#include "inexor/shared/command.hpp"
#include "inexor/shared/cube_hash.hpp"
#include "inexor/shared/cube_loops.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/cube_vector.hpp"
#include "inexor/shared/geom.hpp"
#include "inexor/shared/tools.hpp"

Classes

struct  normalgroup
 
struct  normal
 
struct  tnormal
 

Functions

static bool htcmp (const vec &v, const normalgroup &n)
 
 VARR (lerpangle, 0, 44, 180)
 
static int addnormal (const vec &key, const vec &surface)
 
static void addtnormal (const vec &key, float offset, int normal1, int normal2, normalgroup *group1, normalgroup *group2)
 
static int addnormal (const vec &key, int axis)
 
static void findnormal (const normalgroup &g, const vec &surface, vec &v)
 
static bool findtnormal (const normalgroup &g, const vec &surface, vec &v)
 
void findnormal (const vec &key, const vec &surface, vec &v)
 
 VARR (lerpsubdiv, 0, 2, 4)
 
 VARR (lerpsubdivsize, 4, 4, 128)
 
void show_addnormals_progress ()
 
void addnormals (cube &c, const ivec &o, int size)
 
void calcnormals (bool lerptjoints)
 
void clearnormals ()
 
void calclerpverts (const vec2 *c, const vec *n, lerpvert *lv, int &numv)
 
void setlerpstep (float v, lerpbounds &bounds)
 
void initlerpbounds (float u, float v, const lerpvert *lv, int numv, lerpbounds &start, lerpbounds &end)
 
void updatelerpbounds (float v, const lerpvert *lv, int numv, lerpbounds &start, lerpbounds &end)
 
void lerpnormal (float u, float v, const lerpvert *lv, int numv, lerpbounds &start, lerpbounds &end, vec &normal, vec &nstep)
 

Variables

hashset< normalgroupnormalgroups (1<< 16)
 
vector< normalnormals
 
vector< tnormaltnormals
 
static float lerpthreshold = 0
 
static bool usetnormals = true
 
static uint progress = 0
 

Class Documentation

struct normal
Class Members
int next
vec surface
struct tnormal
Class Members
normalgroup * groups[2]
int next
int normals[2]
float offset

Function Documentation

static int addnormal ( const vec key,
const vec surface 
)
static
static int addnormal ( const vec key,
int  axis 
)
static

References normalgroup::flat, and normalgroups.

void addnormals ( cube c,
const ivec o,
int  size 
)
static void addtnormal ( const vec key,
float  offset,
int  normal1,
int  normal2,
normalgroup group1,
normalgroup group2 
)
static
void calclerpverts ( const vec2 c,
const vec n,
lerpvert lv,
int &  numv 
)

References loopj, lerpvert::normal, and lerpvert::tc.

Referenced by setupsurface().

void calcnormals ( bool  lerptjoints)
void clearnormals ( )
static void findnormal ( const normalgroup g,
const vec surface,
vec v 
)
inlinestatic
void findnormal ( const vec key,
const vec surface,
vec v 
)
static bool findtnormal ( const normalgroup g,
const vec surface,
vec v 
)
inlinestatic
static bool htcmp ( const vec v,
const normalgroup n 
)
inlinestatic

References normalgroup::pos.

void initlerpbounds ( float  u,
float  v,
const lerpvert lv,
int  numv,
lerpbounds start,
lerpbounds end 
)
void lerpnormal ( float  u,
float  v,
const lerpvert lv,
int  numv,
lerpbounds start,
lerpbounds end,
vec normal,
vec nstep 
)
void setlerpstep ( float  v,
lerpbounds bounds 
)
void show_addnormals_progress ( )

References allocnodes, progress, and renderprogress().

Referenced by addnormals().

void updatelerpbounds ( float  v,
const lerpvert lv,
int  numv,
lerpbounds start,
lerpbounds end 
)
VARR ( lerpangle  ,
,
44  ,
180   
)
VARR ( lerpsubdiv  ,
,
,
 
)
VARR ( lerpsubdivsize  ,
,
,
128   
)

Variable Documentation

float lerpthreshold = 0
static
hashset<normalgroup> normalgroups(1<< 16)
vector<normal> normals
uint progress = 0
static
vector<tnormal> tnormals
bool usetnormals = true
static

Referenced by addnormals(), and calcnormals().