Tramway SDK v0.1.1
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tram::AABBTree Class Reference

#include <aabb.h>

Classes

struct  Node
 

Public Member Functions

 AABBTree ()
 
 ~AABBTree ()
 
vec3 GetAABBMin ()
 
vec3 GetAABBMax ()
 
NodeInsertLeaf (uint32_t value, vec3 min, vec3 max)
 
void RemoveLeaf (Node *node)
 
void RemoveHierarchy (Node *node)
 
void FindIntersection (vec3 ray_pos, vec3 ray_dir, Node *node, std::vector< uint32_t > &result) const
 
uint32_t FindIntersection (vec3 ray_pos, vec3 ray_dir, float distance_limit, auto filter) const
 
void FindIntersectionRecursive (vec3 ray_pos, vec3 ray_dir, float &nearest_dist, uint32_t &nearest_index, float distance_limit, Node *node, auto filter) const
 
void FindAABBIntersection (vec3 min, vec3 max, auto callback)
 
void FindAABBIntersection (Node *node, vec3 min, vec3 max, auto callback)
 
void UpdateParentAABB (Node *node)
 
NodeFindSibling (vec3 min, vec3 max, Node *node)
 
void ValidateTree (Node *node)
 
void ValidateTree (Node *node, size_t num)
 

Static Public Member Functions

static vec3 MergeAABBMin (vec3 a, vec3 b)
 
static vec3 MergeAABBMax (vec3 a, vec3 b)
 
static bool AABBOverlap (vec3 min, vec3 max, vec3 other_min, vec3 other_max)
 
static float AABBVolume (vec3 min, vec3 max)
 
static float AABBSurface (vec3 min, vec3 max)
 
static bool AABBIntersect (vec3 ray_pos, vec3 ray_dir, vec3 min, vec3 max)
 
static float AABBDistance (vec3 ray_pos, vec3 ray_dir, vec3 min, vec3 max)
 

Public Attributes

Noderoot = new Node {nullptr, nullptr, nullptr, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}
 

Constructor & Destructor Documentation

◆ AABBTree()

tram::AABBTree::AABBTree ( )
inline

◆ ~AABBTree()

tram::AABBTree::~AABBTree ( )
inline

Member Function Documentation

◆ AABBDistance()

static float tram::AABBTree::AABBDistance ( vec3  ray_pos,
vec3  ray_dir,
vec3  min,
vec3  max 
)
inlinestatic

◆ AABBIntersect()

static bool tram::AABBTree::AABBIntersect ( vec3  ray_pos,
vec3  ray_dir,
vec3  min,
vec3  max 
)
inlinestatic

◆ AABBOverlap()

static bool tram::AABBTree::AABBOverlap ( vec3  min,
vec3  max,
vec3  other_min,
vec3  other_max 
)
inlinestatic

◆ AABBSurface()

static float tram::AABBTree::AABBSurface ( vec3  min,
vec3  max 
)
inlinestatic

◆ AABBVolume()

static float tram::AABBTree::AABBVolume ( vec3  min,
vec3  max 
)
inlinestatic

◆ FindAABBIntersection() [1/2]

void tram::AABBTree::FindAABBIntersection ( Node node,
vec3  min,
vec3  max,
auto  callback 
)
inline

◆ FindAABBIntersection() [2/2]

void tram::AABBTree::FindAABBIntersection ( vec3  min,
vec3  max,
auto  callback 
)
inline

◆ FindIntersection() [1/2]

uint32_t tram::AABBTree::FindIntersection ( vec3  ray_pos,
vec3  ray_dir,
float  distance_limit,
auto  filter 
) const
inline

◆ FindIntersection() [2/2]

void tram::AABBTree::FindIntersection ( vec3  ray_pos,
vec3  ray_dir,
Node node,
std::vector< uint32_t > &  result 
) const
inline

◆ FindIntersectionRecursive()

void tram::AABBTree::FindIntersectionRecursive ( vec3  ray_pos,
vec3  ray_dir,
float &  nearest_dist,
uint32_t &  nearest_index,
float  distance_limit,
Node node,
auto  filter 
) const
inline

◆ FindSibling()

Node * tram::AABBTree::FindSibling ( vec3  min,
vec3  max,
Node node 
)
inline

◆ GetAABBMax()

vec3 tram::AABBTree::GetAABBMax ( )
inline

◆ GetAABBMin()

vec3 tram::AABBTree::GetAABBMin ( )
inline

◆ InsertLeaf()

Node * tram::AABBTree::InsertLeaf ( uint32_t  value,
vec3  min,
vec3  max 
)
inline

◆ MergeAABBMax()

static vec3 tram::AABBTree::MergeAABBMax ( vec3  a,
vec3  b 
)
inlinestatic

◆ MergeAABBMin()

static vec3 tram::AABBTree::MergeAABBMin ( vec3  a,
vec3  b 
)
inlinestatic

◆ RemoveHierarchy()

void tram::AABBTree::RemoveHierarchy ( Node node)
inline

◆ RemoveLeaf()

void tram::AABBTree::RemoveLeaf ( Node node)
inline

◆ UpdateParentAABB()

void tram::AABBTree::UpdateParentAABB ( Node node)
inline

◆ ValidateTree() [1/2]

void tram::AABBTree::ValidateTree ( Node node)
inline

◆ ValidateTree() [2/2]

void tram::AABBTree::ValidateTree ( Node node,
size_t  num 
)
inline

Member Data Documentation

◆ root

Node* tram::AABBTree::root = new Node {nullptr, nullptr, nullptr, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}

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