#include <RegularGrid.h>
|
| RegularGrid2D () |
|
| ~RegularGrid2D () |
|
void | insert (const T &value) |
|
void | remove (const T &value) |
|
void | balance () |
|
bool | contains (const T &value) const |
|
int | size () const |
|
Node & | getGridFor (float fx, float fy) |
|
Node & | getGrid (int x, int y) |
|
template<typename RayCallback > |
void | intersectRay (const G3D::Ray &ray, RayCallback &intersectCallback, float max_dist) |
|
template<typename RayCallback > |
void | intersectRay (const G3D::Ray &ray, RayCallback &intersectCallback, float &max_dist, const G3D::Vector3 &end) |
|
template<typename IsectCallback > |
void | intersectPoint (const G3D::Vector3 &point, IsectCallback &intersectCallback) |
|
template<typename RayCallback > |
void | intersectZAllignedRay (const G3D::Ray &ray, RayCallback &intersectCallback, float &max_dist) |
|
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
Definition: RegularGrid.h:28
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
Node * nodes[CELL_NUMBER][CELL_NUMBER]
Definition: RegularGrid.h:37
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
G3D::int16 y
Definition: Vector2int16.h:38
Node * nodes[CELL_NUMBER][CELL_NUMBER]
Definition: RegularGrid.h:37
Definition: RegularGrid.h:28
G3D::int16 x
Definition: Vector2int16.h:37
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
void RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::balance |
( |
| ) |
|
|
inline |
G3D::int16 y
Definition: Vector2int16.h:38
Node * nodes[CELL_NUMBER][CELL_NUMBER]
Definition: RegularGrid.h:37
Definition: RegularGrid.h:28
G3D::int16 x
Definition: Vector2int16.h:37
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
MemberTable memberTable
Definition: RegularGrid.h:36
const FieldDescriptor value
Definition: descriptor.h:1522
bool containsKey(const Key &key) const
Definition: Table.h:874
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
Node& RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::getGrid |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
101 nodes[
x][
y] = NodeCreatorFunc::makeNode(
x, y);
G3D::int16 y
Definition: Vector2int16.h:38
Node * nodes[CELL_NUMBER][CELL_NUMBER]
Definition: RegularGrid.h:37
Definition: RegularGrid.h:28
#define ASSERT
Definition: Errors.h:55
G3D::int16 x
Definition: Vector2int16.h:37
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
Node& RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::getGridFor |
( |
float |
fx, |
|
|
float |
fy |
|
) |
| |
|
inline |
static Cell ComputeCell(float fx, float fy)
Definition: RegularGrid.h:81
Node & getGrid(int x, int y)
Definition: RegularGrid.h:97
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
52 PositionFunc::getPosition(
value, pos);
float x
Definition: Vector3.h:62
void set(const Key &key, const Value &value)
Definition: Table.h:599
float y
Definition: Vector3.h:62
Node & getGridFor(float fx, float fy)
Definition: RegularGrid.h:91
MemberTable memberTable
Definition: RegularGrid.h:36
const FieldDescriptor value
Definition: descriptor.h:1522
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
template<typename IsectCallback >
193 if (Node* node =
nodes[cell.x][cell.y])
194 node->intersectPoint(point, intersectCallback);
static Cell ComputeCell(float fx, float fy)
Definition: RegularGrid.h:81
float x
Definition: Vector3.h:62
float y
Definition: Vector3.h:62
Node * nodes[CELL_NUMBER][CELL_NUMBER]
Definition: RegularGrid.h:37
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
template<typename RayCallback >
void RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::intersectRay |
( |
const G3D::Ray & |
ray, |
|
|
RayCallback & |
intersectCallback, |
|
|
float |
max_dist |
|
) |
| |
|
inline |
void intersectRay(const G3D::Ray &ray, RayCallback &intersectCallback, float max_dist)
Definition: RegularGrid.h:106
const Point3 & origin() const
Definition: Ray.h:56
const Vector3 & direction() const
Definition: Ray.h:61
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
template<typename RayCallback >
120 if (cell == last_cell)
122 if (Node* node =
nodes[cell.x][cell.y])
123 node->intersectRay(ray, intersectCallback, max_dist);
136 float x_border = (cell.x+1) * voxel;
137 tMaxX = (x_border - bx) * kx_inv;
142 float x_border = (cell.x-1) * voxel;
143 tMaxX = (x_border - bx) * kx_inv;
149 float y_border = (cell.y+1) * voxel;
150 tMaxY = (y_border - by) * ky_inv;
155 float y_border = (cell.y-1) * voxel;
156 tMaxY = (y_border - by) * ky_inv;
162 float tDeltaX = voxel * std::fabs(kx_inv);
163 float tDeltaY = voxel * std::fabs(ky_inv);
166 if (Node* node =
nodes[cell.x][cell.y])
169 node->intersectRay(ray, intersectCallback, max_dist);
171 if (cell == last_cell)
184 }
while (cell.isValid());
static Cell ComputeCell(float fx, float fy)
Definition: RegularGrid.h:81
#define CELL_SIZE
Definition: RegularGrid.h:32
float x
Definition: Vector3.h:62
float y
Definition: Vector3.h:62
const Vector3 & invDirection() const
Definition: Ray.h:66
Node * nodes[CELL_NUMBER][CELL_NUMBER]
Definition: RegularGrid.h:37
const Point3 & origin() const
Definition: Ray.h:56
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
template<typename RayCallback >
void RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::intersectZAllignedRay |
( |
const G3D::Ray & |
ray, |
|
|
RayCallback & |
intersectCallback, |
|
|
float & |
max_dist |
|
) |
| |
|
inline |
204 if (Node* node =
nodes[cell.x][cell.y])
205 node->intersectRay(ray, intersectCallback, max_dist);
static Cell ComputeCell(float fx, float fy)
Definition: RegularGrid.h:81
float x
Definition: Vector3.h:62
float y
Definition: Vector3.h:62
Node * nodes[CELL_NUMBER][CELL_NUMBER]
Definition: RegularGrid.h:37
const Point3 & origin() const
Definition: Ray.h:56
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
bool remove(const Key &key, Key &removedKey, Value &removedValue, bool updateRemoved)
Definition: Table.h:606
MemberTable memberTable
Definition: RegularGrid.h:36
const FieldDescriptor value
Definition: descriptor.h:1522
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
int RegularGrid2D< T, Node, NodeCreatorFunc, PositionFunc >::size |
( |
| ) |
const |
|
inline |
size_t size() const
Definition: Table.h:589
MemberTable memberTable
Definition: RegularGrid.h:36
uint32_t uint32
Definition: g3dmath.h:168
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
template<class T , class Node , class NodeCreatorFunc = NodeCreator<Node>, class PositionFunc = PositionTrait<T>>
The documentation for this class was generated from the following file: