Inherited by DD::Image::rPrimitive, and DD::Image::Scene.
Public Member Functions | |
Box3 (float x, float y, float z) | |
Box3 (const Vector3 p) | |
Box3 (const Vector3 p1, const Vector3 p2) | |
const Vector3 & | min () const |
const Vector3 & | max () const |
float | x () const |
float | y () const |
float | n () const |
near, min z | |
float | r () const |
right, max x | |
float | t () const |
top, max y | |
float | f () const |
far, max z | |
float | w () const |
width | |
float | h () const |
height | |
float | d () const |
depth | |
Vector3 | center () const |
float | radius () const |
void | set (float x, float y, float z, float r, float t, float f) |
void | set (Vector3 p1, Vector3 p2) |
void | set (const Box3 &v) |
void | set_min (float x, float y, float z) |
void | set_max (float x, float y, float z) |
bool | empty () const |
void | clear () |
bool | inside (const Vector3 &p) const |
void | expand (const Box3 &v) |
void | expand (const Vector3 &p) |
void | intersect (const Box3 &v) |
void | transform (const Matrix4 &m) |
void | project (const Matrix4 &m, Box &bbox) const |
void | append (Hash &h) const |
void | print_info (const char *title=nullptr) const |
3D Box
|
inline |
Return true if the box is empty.
Referenced by DD::Image::GeoOp::add_draw_geometry(), DD::Image::GeoOp::build_scene(), expand(), DD::Image::ViewerContext::expand_bbox(), and DD::Image::Scene::validate().
|
inline |
Return true if the Vector3 point is inside this box.
Referenced by DD::Image::rTriangle::intersect(), DD::Image::rTriangle::intersect_dist_squared(), and DD::Image::Scene::validate().
void Box3::expand | ( | const Box3 & | v | ) |
Union the box with box v. If this is empty it is set to the other box, if the other one is empty this is unchanged.
References empty(), MAX(), and MIN().
Referenced by DD::Image::Render::_request(), DD::Image::Render::_validate(), DD::Image::Primitive::get_bbox(), transform(), DD::Image::Scene::validate(), and DD::Image::Iop::vertex_shader().
void Box3::expand | ( | const Vector3 & | p | ) |
void Box3::transform | ( | const Matrix4 & | m | ) |
Transform each corner of the box by the matrix, merging them into a new axis-aligned box.
References expand(), t(), and DD::Image::Matrix4::vtransform().
Referenced by DD::Image::GeoOp::add_draw_geometry(), DD::Image::GeoOp::build_scene(), DD::Image::ViewerContext::expand_bbox(), and DD::Image::Scene::validate().
Transform each corner of the box by a projection matrix, merging them into 2D bbox. This is typically used to project into screen space. Pass false to 'wnormalize' if the perspective division is not wanted.
References DD::Image::Box::set().
Referenced by DD::Image::Scene::validate().
©2020 The Foundry Visionmongers, Ltd. All Rights Reserved. |