Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hashableVector3d Class Reference

#include <adj.h>

Public Member Functions

 hashableVector3d (const vector3d &v)
 

Static Public Member Functions

static void checkVector (const vector3d &v)
 

Static Public Attributes

static double scale =1.0/initNodeQuant
 
static double offset =originMapsTo+0.5*initNodeQuant
 

Private Attributes

int x
 
int y
 
int z
 

Detailed Description

Definition at line 178 of file adj.h.

Constructor & Destructor Documentation

hashableVector3d ( const vector3d v)

Definition at line 220 of file adj.cpp.

References offset, scale, vector3d::x, x, vector3d::y, y, vector3d::z, and z.

221 {
222  x=(int)(scale*v.x+offset);
223  y=(int)(scale*v.y+offset);
224  z=(int)(scale*v.z+offset);
225 }
real x
Definition: vector3d.h:88
static double offset
Definition: adj.h:181
real y
Definition: vector3d.h:88
static double scale
Definition: adj.h:181
real z
Definition: vector3d.h:88

Member Function Documentation

void checkVector ( const vector3d v)
static

Definition at line 209 of file adj.cpp.

References vector3d::mag(), offset, originMapsTo, and scale.

Referenced by block::block().

209  {
210  const double safetyFactor=5; //<- Needed since we only check the corners
211  double mag=safetyFactor*v.mag();
212  while (mag*scale>1.0e9) {//If our hashableVectors would overflow:
213  scale*=0.1; //Use a smaller scale (coarser quantization)
214  double newQuant=1.0/scale;
215  offset=originMapsTo+0.5*newQuant;
216  printf("Encountered large node coordinates: quantizing to %.3g\n",newQuant);
217  }
218 }
static int originMapsTo
Definition: adj.cpp:203
static double offset
Definition: adj.h:181
static double scale
Definition: adj.h:181
real mag(void) const
Definition: vector3d.h:130

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

double offset =originMapsTo+0.5*initNodeQuant
static

Definition at line 181 of file adj.h.

Referenced by checkVector(), and hashableVector3d().

double scale =1.0/initNodeQuant
static

Definition at line 181 of file adj.h.

Referenced by checkVector(), and hashableVector3d().

int x
private

Definition at line 179 of file adj.h.

Referenced by hashableVector3d().

int y
private

Definition at line 179 of file adj.h.

Referenced by hashableVector3d().

int z
private

Definition at line 179 of file adj.h.

Referenced by hashableVector3d().


The documentation for this class was generated from the following files: