71 int _get_points_inside(
int p_node,
const Vector3* p_points,
int *p_indices,
const Vector3& p_center,
const Vector3& p_half_extents,
int p_indices_count)
const;
74 bool _test_convex(
const Node* p_nodes,
const Plane* p_planes,
int p_current,
const T& p_convex)
const;
78 bool is_empty()
const {
return nodes.size()==0; }
81 AABB get_aabb()
const;
83 bool point_is_inside(
const Vector3& p_point)
const;
84 int get_points_inside(
const Vector3* p_points,
int p_point_count)
const;
86 bool convex_is_inside(
const T& p_convex)
const;
90 void from_aabb(
const AABB& p_aabb);
101 bool BSP_Tree::_test_convex(
const Node* p_nodes,
const Plane* p_planes,
int p_current,
const T& p_convex)
const {
103 if (p_current==UNDER_LEAF)
105 else if (p_current==OVER_LEAF)
109 const Node&n=p_nodes[p_current];
111 const Plane& p=p_planes[n.plane];
114 p_convex.project_range(p.normal,min,max);
116 bool go_under = min < p.d;
117 bool go_over = max >= p.d;
119 if (go_under && _test_convex(p_nodes,p_planes,n.under,p_convex))
121 if (go_over && _test_convex(p_nodes,p_planes,n.over,p_convex))
129 bool BSP_Tree::convex_is_inside(
const T& p_convex)
const {
131 int node_count = nodes.size();
134 const Node* nodes=&this->nodes[0];
135 const Plane* planes = &this->planes[0];
137 return _test_convex(nodes,planes,node_count-1,p_convex);
Definition: bsp_tree.h:53
Definition: bsp_tree.h:42