33 vec4 lbn = inv *
vec4(-1, -1, -1, 1);
34 vec4 ltn = inv * vec4(-1, 1, -1, 1);
35 vec4 lbf = inv * vec4(-1, -1, 1, 1);
36 vec4 rbn = inv * vec4( 1, -1, -1, 1);
37 vec4 rtn = inv * vec4( 1, 1, -1, 1);
38 vec4 rbf = inv * vec4( 1, -1, 1, 1);
39 vec4 rtf = inv * vec4( 1, 1, 1, 1);
75 planes[0] = vec4(near_normal, -
vec_dot(near_normal, lbn_pos));
77 planes[2] = vec4(left_normal, -
vec_dot(left_normal, lbn_pos));
78 planes[3] = vec4(right_normal, -
vec_dot(right_normal, rbn_pos));
80 planes[5] = vec4(bottom_normal, -
vec_dot(bottom_normal, lbn_pos));
90 for (
unsigned int c = 0; c < 8; c++)
96 for (
unsigned int p = 0; p < 6; p++)
98 bool inside_plane =
false;
99 for (
unsigned int c = 0; c < 8; c++)
bool intersects_aabb(const AABB &aabb) const
[Compute plane equations]
float vec_dot(const T &a, const T &b)
vec3 vec_cross(const vec3 &a, const vec3 &b)
vec3 corner(unsigned int index) const
mat4 mat_inverse(const mat4 &a)
T vec_normalize(const T &vec)
vec3 vec_project(const vec4 &vec)